yaml() public method

YAML parser, helper function.
public yaml ( $payload ) : array
$payload
return array
Beispiel #1
0
 /** @test */
 public function throws_an_exception_when_parsed_yaml_bad_data()
 {
     $parser = new Parser();
     $this->setExpectedException('Exception', 'Failed To Parse YAML');
     $parser->yaml('as|df>ASFBw924hg2=
                     sfgsaf:asdfasf');
 }
Beispiel #2
0
<?php

require "../vendor/autoload.php";
use Nathanmac\Utilities\Parser\Parser;
$parser = new Parser();
echo "<h1>YAML Example</h1>";
$parsed = $parser->yaml('---
message:
    to: "Jack Smith"
    from: "Jane Doe"
    subject: "Hello World"
    body: "Hello, whats going on..."
');
echo "<pre>";
print_r($parsed);
echo "</pre>";