Nathanmac\Utilities\Parser\Parser::bson PHP Method

bson() public method

BSON parser, helper function.
public bson ( $payload ) : array
$payload
return array
    public function bson($payload)
    {
        return $this->parse($payload, new BSON());
    }

Usage Example

Example #1
0
 /** @test */
 public function throws_an_exception_when_parsed_bson_bad_data()
 {
     if (!function_exists('bson_decode')) {
         $parser = new Parser();
         $this->setExpectedException('Exception', 'Failed To Parse BSON');
         $parser->bson('as|df>ASFBw924hg2=');
     }
 }