@@ -37,12 +37,12 @@ discard block |
||
37 | 37 | public function build(&$parent = null) |
38 | 38 | { |
39 | 39 | if (is_null($parent)) { |
40 | - throw new \Exception(__METHOD__ . " expects a YamlObject as parent", 1); |
|
40 | + throw new \Exception(__METHOD__." expects a YamlObject as parent", 1); |
|
41 | 41 | } |
42 | 42 | if (!is_null($this->value)) { |
43 | 43 | if ($this->value instanceof Tag) { |
44 | 44 | preg_match(Regex::TAG_PARTS, $this->value->raw, $tagparts); |
45 | - if (preg_match("/(?(DEFINE)" . Regex::TAG_URI . ')(?&url)/', $tagparts['tagname'], $matches)) { |
|
45 | + if (preg_match("/(?(DEFINE)".Regex::TAG_URI.')(?&url)/', $tagparts['tagname'], $matches)) { |
|
46 | 46 | $parent->addTag($tagparts['handle'], $tagparts['tagname']); |
47 | 47 | } else { |
48 | 48 | $this->value->build($parent); |
@@ -60,11 +60,11 @@ discard block |
||
60 | 60 | return $this->value instanceof NodeGeneric && $this->value->isOneOf('Anchor', 'Literal', 'LiteralFolded'); |
61 | 61 | } |
62 | 62 | |
63 | - public function getTargetOnEqualIndent(NodeGeneric &$node): NodeGeneric |
|
63 | + public function getTargetOnEqualIndent(NodeGeneric&$node): NodeGeneric |
|
64 | 64 | { |
65 | 65 | if ($this->value instanceof NodeGeneric) { |
66 | 66 | if ($this->value instanceof Tag) { |
67 | - if (!preg_match("/" . Regex::TAG_URI . "/", $this->value->raw)) { |
|
67 | + if (!preg_match("/".Regex::TAG_URI."/", $this->value->raw)) { |
|
68 | 68 | return $this->value; |
69 | 69 | } |
70 | 70 | } elseif ($this->value->isAwaitingChild($node)) { |
@@ -8,17 +8,17 @@ |
||
8 | 8 | * |
9 | 9 | * use as follows : "php examples/testing.php DEBUG_LEVEL YAML_FILENAME" |
10 | 10 | */ |
11 | -const JSON_OPTIONS = JSON_UNESCAPED_SLASHES | JSON_UNESCAPED_LINE_TERMINATORS | JSON_UNESCAPED_UNICODE | JSON_PRESERVE_ZERO_FRACTION | JSON_PARTIAL_OUTPUT_ON_ERROR; |
|
11 | +const JSON_OPTIONS = JSON_UNESCAPED_SLASHES|JSON_UNESCAPED_LINE_TERMINATORS|JSON_UNESCAPED_UNICODE|JSON_PRESERVE_ZERO_FRACTION|JSON_PARTIAL_OUTPUT_ON_ERROR; |
|
12 | 12 | |
13 | 13 | $debug = (int) (isset($argv[1]) ? $argv[1] : null); |
14 | 14 | $file = (string) (isset($argv[2]) ? $argv[2] : null); |
15 | -echo memory_get_usage() . "\n"; |
|
15 | +echo memory_get_usage()."\n"; |
|
16 | 16 | /* USE CASE 1 |
17 | 17 | * load and parse if file exists |
18 | 18 | */ |
19 | 19 | $content = file_get_contents($file); |
20 | 20 | $yaml = Yaml::parse($content, 0, $debug); |
21 | 21 | |
22 | -echo memory_get_usage() . "\n"; |
|
22 | +echo memory_get_usage()."\n"; |
|
23 | 23 | |
24 | 24 | print_r(json_encode($yaml, JSON_OPTIONS)); |
25 | 25 | \ No newline at end of file |