@@ -85,9 +85,9 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * Parses a scalar to a YAML string |
| 87 | 87 | * |
| 88 | - * @param scalar $scalar |
|
| 88 | + * @param string $scalar |
|
| 89 | 89 | * @param string $delimiters |
| 90 | - * @param array $stringDelimiters |
|
| 90 | + * @param string[] $stringDelimiters |
|
| 91 | 91 | * @param int &$i |
| 92 | 92 | * @param bool $evaluate |
| 93 | 93 | * @param array $references |
@@ -145,6 +145,7 @@ discard block |
||
| 145 | 145 | * |
| 146 | 146 | * @param string $scalar |
| 147 | 147 | * @param int &$i |
| 148 | + * @param integer $i |
|
| 148 | 149 | * |
| 149 | 150 | * @throws ParseException When malformed inline YAML string is parsed |
| 150 | 151 | * @return string A YAML string |
@@ -1,31 +1,31 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Scabbia2 Yaml Component |
|
| 4 | - * https://github.com/eserozvataf/scabbia2 |
|
| 5 | - * |
|
| 6 | - * For the full copyright and license information, please view the LICENSE |
|
| 7 | - * file that was distributed with this source code. |
|
| 8 | - * |
|
| 9 | - * @link https://github.com/eserozvataf/scabbia2-yaml for the canonical source repository |
|
| 10 | - * @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
|
| 11 | - * @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
|
| 12 | - * |
|
| 13 | - * ------------------------- |
|
| 14 | - * Portions of this code are from Symfony YAML Component under the MIT license. |
|
| 15 | - * |
|
| 16 | - * (c) Fabien Potencier <[email protected]> |
|
| 17 | - * |
|
| 18 | - * For the full copyright and license information, please view the LICENSE-MIT |
|
| 19 | - * file that was distributed with this source code. |
|
| 20 | - * |
|
| 21 | - * Modifications made: |
|
| 22 | - * - Scabbia Framework code styles applied. |
|
| 23 | - * - All dump methods are moved under Dumper class. |
|
| 24 | - * - Redundant classes removed. |
|
| 25 | - * - Namespace changed. |
|
| 26 | - * - Tests ported to Scabbia2. |
|
| 27 | - * - Encoding checks removed. |
|
| 28 | - */ |
|
| 3 | + * Scabbia2 Yaml Component |
|
| 4 | + * https://github.com/eserozvataf/scabbia2 |
|
| 5 | + * |
|
| 6 | + * For the full copyright and license information, please view the LICENSE |
|
| 7 | + * file that was distributed with this source code. |
|
| 8 | + * |
|
| 9 | + * @link https://github.com/eserozvataf/scabbia2-yaml for the canonical source repository |
|
| 10 | + * @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
|
| 11 | + * @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
|
| 12 | + * |
|
| 13 | + * ------------------------- |
|
| 14 | + * Portions of this code are from Symfony YAML Component under the MIT license. |
|
| 15 | + * |
|
| 16 | + * (c) Fabien Potencier <[email protected]> |
|
| 17 | + * |
|
| 18 | + * For the full copyright and license information, please view the LICENSE-MIT |
|
| 19 | + * file that was distributed with this source code. |
|
| 20 | + * |
|
| 21 | + * Modifications made: |
|
| 22 | + * - Scabbia Framework code styles applied. |
|
| 23 | + * - All dump methods are moved under Dumper class. |
|
| 24 | + * - Redundant classes removed. |
|
| 25 | + * - Namespace changed. |
|
| 26 | + * - Tests ported to Scabbia2. |
|
| 27 | + * - Encoding checks removed. |
|
| 28 | + */ |
|
| 29 | 29 | |
| 30 | 30 | namespace Scabbia\Yaml; |
| 31 | 31 | |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | /** |
| 83 | 83 | * Gets the snippet of code near the error |
| 84 | 84 | * |
| 85 | - * @return string The snippet of code |
|
| 85 | + * @return integer|null The snippet of code |
|
| 86 | 86 | */ |
| 87 | 87 | public function getSnippet() |
| 88 | 88 | { |
@@ -1,31 +1,31 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Scabbia2 Yaml Component |
|
| 4 | - * https://github.com/eserozvataf/scabbia2 |
|
| 5 | - * |
|
| 6 | - * For the full copyright and license information, please view the LICENSE |
|
| 7 | - * file that was distributed with this source code. |
|
| 8 | - * |
|
| 9 | - * @link https://github.com/eserozvataf/scabbia2-yaml for the canonical source repository |
|
| 10 | - * @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
|
| 11 | - * @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
|
| 12 | - * |
|
| 13 | - * ------------------------- |
|
| 14 | - * Portions of this code are from Symfony YAML Component under the MIT license. |
|
| 15 | - * |
|
| 16 | - * (c) Fabien Potencier <[email protected]> |
|
| 17 | - * |
|
| 18 | - * For the full copyright and license information, please view the LICENSE-MIT |
|
| 19 | - * file that was distributed with this source code. |
|
| 20 | - * |
|
| 21 | - * Modifications made: |
|
| 22 | - * - Scabbia Framework code styles applied. |
|
| 23 | - * - All dump methods are moved under Dumper class. |
|
| 24 | - * - Redundant classes removed. |
|
| 25 | - * - Namespace changed. |
|
| 26 | - * - Tests ported to Scabbia2. |
|
| 27 | - * - Encoding checks removed. |
|
| 28 | - */ |
|
| 3 | + * Scabbia2 Yaml Component |
|
| 4 | + * https://github.com/eserozvataf/scabbia2 |
|
| 5 | + * |
|
| 6 | + * For the full copyright and license information, please view the LICENSE |
|
| 7 | + * file that was distributed with this source code. |
|
| 8 | + * |
|
| 9 | + * @link https://github.com/eserozvataf/scabbia2-yaml for the canonical source repository |
|
| 10 | + * @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
|
| 11 | + * @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
|
| 12 | + * |
|
| 13 | + * ------------------------- |
|
| 14 | + * Portions of this code are from Symfony YAML Component under the MIT license. |
|
| 15 | + * |
|
| 16 | + * (c) Fabien Potencier <[email protected]> |
|
| 17 | + * |
|
| 18 | + * For the full copyright and license information, please view the LICENSE-MIT |
|
| 19 | + * file that was distributed with this source code. |
|
| 20 | + * |
|
| 21 | + * Modifications made: |
|
| 22 | + * - Scabbia Framework code styles applied. |
|
| 23 | + * - All dump methods are moved under Dumper class. |
|
| 24 | + * - Redundant classes removed. |
|
| 25 | + * - Namespace changed. |
|
| 26 | + * - Tests ported to Scabbia2. |
|
| 27 | + * - Encoding checks removed. |
|
| 28 | + */ |
|
| 29 | 29 | |
| 30 | 30 | namespace Scabbia\Yaml; |
| 31 | 31 | |
@@ -149,7 +149,7 @@ |
||
| 149 | 149 | { |
| 150 | 150 | // array |
| 151 | 151 | $keys = array_keys($value); |
| 152 | - $func = function ($v, $w) { |
|
| 152 | + $func = function($v, $w) { |
|
| 153 | 153 | return (int)$v + $w; |
| 154 | 154 | }; |
| 155 | 155 | |
@@ -53,21 +53,21 @@ discard block |
||
| 53 | 53 | * avoids the use of strtr, which performs more slowly |
| 54 | 54 | */ |
| 55 | 55 | protected static $escapees = ["\\", "\\\\", "\\\"", "\"", |
| 56 | - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
| 57 | - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
| 58 | - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
| 59 | - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
| 56 | + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
| 57 | + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
| 58 | + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
| 59 | + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
| 60 | 60 | "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9"]; |
| 61 | 61 | /** |
| 62 | 62 | * @type array $escaped Mapping arrays for escaping a double quoted string. The backslash is first to ensure |
| 63 | 63 | * proper escaping because str_replace operates iteratively on the input arrays. This ordering of the characters |
| 64 | 64 | * avoids the use of strtr, which performs more slowly |
| 65 | 65 | */ |
| 66 | - protected static $escaped = ["\\\\", "\\\"", "\\\\", "\\\"", |
|
| 67 | - "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", |
|
| 68 | - "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", |
|
| 66 | + protected static $escaped = ["\\\\", "\\\"", "\\\\", "\\\"", |
|
| 67 | + "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", |
|
| 68 | + "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", |
|
| 69 | 69 | "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", |
| 70 | - "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", |
|
| 70 | + "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", |
|
| 71 | 71 | "\\N", "\\_", "\\L", "\\P"]; |
| 72 | 72 | |
| 73 | 73 | |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | public function unescapeDoubleQuotedString($value) |
| 142 | 142 | { |
| 143 | - $callback = function ($match) { |
|
| 143 | + $callback = function($match) { |
|
| 144 | 144 | return $this->unescapeCharacter($match[0]); |
| 145 | 145 | }; |
| 146 | 146 | |
@@ -1,31 +1,31 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Scabbia2 Yaml Component |
|
| 4 | - * https://github.com/eserozvataf/scabbia2 |
|
| 5 | - * |
|
| 6 | - * For the full copyright and license information, please view the LICENSE |
|
| 7 | - * file that was distributed with this source code. |
|
| 8 | - * |
|
| 9 | - * @link https://github.com/eserozvataf/scabbia2-yaml for the canonical source repository |
|
| 10 | - * @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
|
| 11 | - * @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
|
| 12 | - * |
|
| 13 | - * ------------------------- |
|
| 14 | - * Portions of this code are from Symfony YAML Component under the MIT license. |
|
| 15 | - * |
|
| 16 | - * (c) Fabien Potencier <[email protected]> |
|
| 17 | - * |
|
| 18 | - * For the full copyright and license information, please view the LICENSE-MIT |
|
| 19 | - * file that was distributed with this source code. |
|
| 20 | - * |
|
| 21 | - * Modifications made: |
|
| 22 | - * - Scabbia Framework code styles applied. |
|
| 23 | - * - All dump methods are moved under Dumper class. |
|
| 24 | - * - Redundant classes removed. |
|
| 25 | - * - Namespace changed. |
|
| 26 | - * - Tests ported to Scabbia2. |
|
| 27 | - * - Encoding checks removed. |
|
| 28 | - */ |
|
| 3 | + * Scabbia2 Yaml Component |
|
| 4 | + * https://github.com/eserozvataf/scabbia2 |
|
| 5 | + * |
|
| 6 | + * For the full copyright and license information, please view the LICENSE |
|
| 7 | + * file that was distributed with this source code. |
|
| 8 | + * |
|
| 9 | + * @link https://github.com/eserozvataf/scabbia2-yaml for the canonical source repository |
|
| 10 | + * @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
|
| 11 | + * @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
|
| 12 | + * |
|
| 13 | + * ------------------------- |
|
| 14 | + * Portions of this code are from Symfony YAML Component under the MIT license. |
|
| 15 | + * |
|
| 16 | + * (c) Fabien Potencier <[email protected]> |
|
| 17 | + * |
|
| 18 | + * For the full copyright and license information, please view the LICENSE-MIT |
|
| 19 | + * file that was distributed with this source code. |
|
| 20 | + * |
|
| 21 | + * Modifications made: |
|
| 22 | + * - Scabbia Framework code styles applied. |
|
| 23 | + * - All dump methods are moved under Dumper class. |
|
| 24 | + * - Redundant classes removed. |
|
| 25 | + * - Namespace changed. |
|
| 26 | + * - Tests ported to Scabbia2. |
|
| 27 | + * - Encoding checks removed. |
|
| 28 | + */ |
|
| 29 | 29 | |
| 30 | 30 | namespace Scabbia\Yaml; |
| 31 | 31 | |
@@ -1,31 +1,31 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Scabbia2 Yaml Component |
|
| 4 | - * https://github.com/eserozvataf/scabbia2 |
|
| 5 | - * |
|
| 6 | - * For the full copyright and license information, please view the LICENSE |
|
| 7 | - * file that was distributed with this source code. |
|
| 8 | - * |
|
| 9 | - * @link https://github.com/eserozvataf/scabbia2-yaml for the canonical source repository |
|
| 10 | - * @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
|
| 11 | - * @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
|
| 12 | - * |
|
| 13 | - * ------------------------- |
|
| 14 | - * Portions of this code are from Symfony YAML Component under the MIT license. |
|
| 15 | - * |
|
| 16 | - * (c) Fabien Potencier <[email protected]> |
|
| 17 | - * |
|
| 18 | - * For the full copyright and license information, please view the LICENSE-MIT |
|
| 19 | - * file that was distributed with this source code. |
|
| 20 | - * |
|
| 21 | - * Modifications made: |
|
| 22 | - * - Scabbia Framework code styles applied. |
|
| 23 | - * - All dump methods are moved under Dumper class. |
|
| 24 | - * - Redundant classes removed. |
|
| 25 | - * - Namespace changed. |
|
| 26 | - * - Tests ported to Scabbia2. |
|
| 27 | - * - Encoding checks removed. |
|
| 28 | - */ |
|
| 3 | + * Scabbia2 Yaml Component |
|
| 4 | + * https://github.com/eserozvataf/scabbia2 |
|
| 5 | + * |
|
| 6 | + * For the full copyright and license information, please view the LICENSE |
|
| 7 | + * file that was distributed with this source code. |
|
| 8 | + * |
|
| 9 | + * @link https://github.com/eserozvataf/scabbia2-yaml for the canonical source repository |
|
| 10 | + * @copyright 2010-2016 Eser Ozvataf. (http://eser.ozvataf.com/) |
|
| 11 | + * @license http://www.apache.org/licenses/LICENSE-2.0 - Apache License, Version 2.0 |
|
| 12 | + * |
|
| 13 | + * ------------------------- |
|
| 14 | + * Portions of this code are from Symfony YAML Component under the MIT license. |
|
| 15 | + * |
|
| 16 | + * (c) Fabien Potencier <[email protected]> |
|
| 17 | + * |
|
| 18 | + * For the full copyright and license information, please view the LICENSE-MIT |
|
| 19 | + * file that was distributed with this source code. |
|
| 20 | + * |
|
| 21 | + * Modifications made: |
|
| 22 | + * - Scabbia Framework code styles applied. |
|
| 23 | + * - All dump methods are moved under Dumper class. |
|
| 24 | + * - Redundant classes removed. |
|
| 25 | + * - Namespace changed. |
|
| 26 | + * - Tests ported to Scabbia2. |
|
| 27 | + * - Encoding checks removed. |
|
| 28 | + */ |
|
| 29 | 29 | |
| 30 | 30 | namespace Scabbia\Yaml; |
| 31 | 31 | |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | strpos(ltrim($values["value"], " "), "#") === 0) { |
| 122 | 122 | $c = $this->getRealCurrentLineNb() + 1; |
| 123 | 123 | $parser = new static($c); |
| 124 | - $parser->refs =& $this->refs; |
|
| 124 | + $parser->refs = & $this->refs; |
|
| 125 | 125 | $data[] = $parser->parse($this->getNextEmbedBlock(null, true)); |
| 126 | 126 | } else { |
| 127 | 127 | if (isset($values["leadspaces"]) |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | // this is a compact notation element, add to next block and parse |
| 138 | 138 | $c = $this->getRealCurrentLineNb(); |
| 139 | 139 | $parser = new static($c); |
| 140 | - $parser->refs =& $this->refs; |
|
| 140 | + $parser->refs = & $this->refs; |
|
| 141 | 141 | |
| 142 | 142 | $block = $values["value"]; |
| 143 | 143 | if ($this->isNextLineIndented()) { |
@@ -194,7 +194,7 @@ discard block |
||
| 194 | 194 | |
| 195 | 195 | $c = $this->getRealCurrentLineNb() + 1; |
| 196 | 196 | $parser = new static($c); |
| 197 | - $parser->refs =& $this->refs; |
|
| 197 | + $parser->refs = & $this->refs; |
|
| 198 | 198 | $parsed = $parser->parse($value); |
| 199 | 199 | |
| 200 | 200 | $merged = []; |
@@ -241,7 +241,7 @@ discard block |
||
| 241 | 241 | } else { |
| 242 | 242 | $c = $this->getRealCurrentLineNb() + 1; |
| 243 | 243 | $parser = new static($c); |
| 244 | - $parser->refs =& $this->refs; |
|
| 244 | + $parser->refs = & $this->refs; |
|
| 245 | 245 | $data[$key] = $parser->parse($this->getNextEmbedBlock()); |
| 246 | 246 | } |
| 247 | 247 | } else { |