@@ -304,7 +304,7 @@ |
||
304 | 304 | |
305 | 305 | /** |
306 | 306 | * @param \HDNET\Importr\Domain\Model\Import $import |
307 | - * @param bool|int $pointer |
|
307 | + * @param integer $pointer |
|
308 | 308 | */ |
309 | 309 | protected function updateImport(Import $import, $pointer = false) |
310 | 310 | { |
@@ -146,9 +146,9 @@ discard block |
||
146 | 146 | /** |
147 | 147 | * Parses a scalar to a YAML string. |
148 | 148 | * |
149 | - * @param scalar $scalar |
|
149 | + * @param string $scalar |
|
150 | 150 | * @param string $delimiters |
151 | - * @param array $stringDelimiters |
|
151 | + * @param string[] $stringDelimiters |
|
152 | 152 | * @param integer &$i |
153 | 153 | * @param Boolean $evaluate |
154 | 154 | * |
@@ -189,6 +189,7 @@ discard block |
||
189 | 189 | * |
190 | 190 | * @param string $scalar |
191 | 191 | * @param integer &$i |
192 | + * @param integer $i |
|
192 | 193 | * |
193 | 194 | * @return string A YAML string |
194 | 195 | * |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | return ''; |
38 | 38 | } |
39 | 39 | |
40 | - if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { |
|
40 | + if (function_exists('mb_internal_encoding') && ((int)ini_get('mbstring.func_overload')) & 2) { |
|
41 | 41 | $mbEncoding = mb_internal_encoding(); |
42 | 42 | mb_internal_encoding('ASCII'); |
43 | 43 | } |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | case is_resource($value): |
76 | 76 | throw new DumpException(sprintf('Unable to dump PHP resources in a YAML file ("%s").', get_resource_type($value))); |
77 | 77 | case is_object($value): |
78 | - return '!!php/object:'.serialize($value); |
|
78 | + return '!!php/object:' . serialize($value); |
|
79 | 79 | case is_array($value): |
80 | 80 | return self::dumpArray($value); |
81 | 81 | case NULL === $value: |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | case FALSE === $value: |
86 | 86 | return 'false'; |
87 | 87 | case ctype_digit($value): |
88 | - return is_string($value) ? "'$value'" : (int) $value; |
|
88 | + return is_string($value) ? "'$value'" : (int)$value; |
|
89 | 89 | case is_numeric($value): |
90 | 90 | $locale = setlocale(LC_NUMERIC, 0); |
91 | 91 | if (FALSE !== $locale) { |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | // array |
125 | 125 | $keys = array_keys($value); |
126 | 126 | if ((1 == count($keys) && '0' == $keys[0]) |
127 | - || (count($keys) > 1 && array_reduce($keys, function ($v, $w) { return (integer) $v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2) |
|
127 | + || (count($keys) > 1 && array_reduce($keys, function($v, $w) { return (integer)$v + $w; }, 0) == count($keys) * (count($keys) - 1) / 2) |
|
128 | 128 | ) { |
129 | 129 | $output = array(); |
130 | 130 | foreach ($value as $val) { |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | if (FALSE !== $strpos = strpos($output, ' #')) { |
172 | 172 | $output = rtrim(substr($output, 0, $strpos)); |
173 | 173 | } |
174 | - } elseif (preg_match('/^(.+?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) { |
|
174 | + } elseif (preg_match('/^(.+?)(' . implode('|', $delimiters) . ')/', substr($scalar, $i), $match)) { |
|
175 | 175 | $output = $match[1]; |
176 | 176 | $i += strlen($output); |
177 | 177 | } else { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | */ |
197 | 197 | static private function parseQuotedScalar($scalar, &$i) |
198 | 198 | { |
199 | - if (!preg_match('/'.self::REGEX_QUOTED_STRING.'/Au', substr($scalar, $i), $match)) { |
|
199 | + if (!preg_match('/' . self::REGEX_QUOTED_STRING . '/Au', substr($scalar, $i), $match)) { |
|
200 | 200 | throw new ParseException(sprintf('Malformed inline YAML string (%s).', substr($scalar, $i))); |
201 | 201 | } |
202 | 202 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | if (!$isQuoted && FALSE !== strpos($value, ': ')) { |
254 | 254 | // embedded mapping? |
255 | 255 | try { |
256 | - $value = self::parseMapping('{'.$value.'}'); |
|
256 | + $value = self::parseMapping('{' . $value . '}'); |
|
257 | 257 | } catch (\InvalidArgumentException $e) { |
258 | 258 | // no, it's not |
259 | 259 | } |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | case '~' == $scalar: |
352 | 352 | return NULL; |
353 | 353 | case 0 === strpos($scalar, '!str'): |
354 | - return (string) substr($scalar, 5); |
|
354 | + return (string)substr($scalar, 5); |
|
355 | 355 | case 0 === strpos($scalar, '! '): |
356 | 356 | return intval(self::parseScalar(substr($scalar, 2))); |
357 | 357 | case 0 === strpos($scalar, '!!php/object:'): |
@@ -360,13 +360,13 @@ discard block |
||
360 | 360 | $raw = $scalar; |
361 | 361 | $cast = intval($scalar); |
362 | 362 | |
363 | - return '0' == $scalar[0] ? octdec($scalar) : (((string) $raw == (string) $cast) ? $cast : $raw); |
|
363 | + return '0' == $scalar[0] ? octdec($scalar) : (((string)$raw == (string)$cast) ? $cast : $raw); |
|
364 | 364 | case 'true' === strtolower($scalar): |
365 | 365 | return TRUE; |
366 | 366 | case 'false' === strtolower($scalar): |
367 | 367 | return FALSE; |
368 | 368 | case is_numeric($scalar): |
369 | - return '0x' == $scalar[0].$scalar[1] ? hexdec($scalar) : floatval($scalar); |
|
369 | + return '0x' == $scalar[0] . $scalar[1] ? hexdec($scalar) : floatval($scalar); |
|
370 | 370 | case 0 == strcasecmp($scalar, '.inf'): |
371 | 371 | case 0 == strcasecmp($scalar, '.NaN'): |
372 | 372 | return -log(0); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | case preg_match(self::getTimestampRegex(), $scalar): |
378 | 378 | return strtotime($scalar); |
379 | 379 | default: |
380 | - return (string) $scalar; |
|
380 | + return (string)$scalar; |
|
381 | 381 | } |
382 | 382 | } |
383 | 383 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | }; |
54 | 54 | |
55 | 55 | // evaluate the string |
56 | - return preg_replace_callback('/'.self::REGEX_ESCAPED_CHARACTER.'/u', $callback, $value); |
|
56 | + return preg_replace_callback('/' . self::REGEX_ESCAPED_CHARACTER . '/u', $callback, $value); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $prefix = $indent ? str_repeat(' ', $indent) : ''; |
34 | 34 | |
35 | 35 | if ($inline <= 0 || !is_array($input) || empty($input)) { |
36 | - $output .= $prefix.Inline::dump($input); |
|
36 | + $output .= $prefix . Inline::dump($input); |
|
37 | 37 | } else { |
38 | 38 | $isAHash = array_keys($input) !== range(0, count($input) - 1); |
39 | 39 | |
@@ -42,10 +42,10 @@ discard block |
||
42 | 42 | |
43 | 43 | $output .= sprintf('%s%s%s%s', |
44 | 44 | $prefix, |
45 | - $isAHash ? Inline::dump($key).':' : '-', |
|
45 | + $isAHash ? Inline::dump($key) . ':' : '-', |
|
46 | 46 | $willBeInlined ? ' ' : "\n", |
47 | 47 | $this->dump($value, $inline - 1, $willBeInlined ? 0 : $indent + 4) |
48 | - ).($willBeInlined ? "\n" : ''); |
|
48 | + ) . ($willBeInlined ? "\n" : ''); |
|
49 | 49 | } |
50 | 50 | } |
51 | 51 |
@@ -9,9 +9,9 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -spl_autoload_register(function ($class) { |
|
12 | +spl_autoload_register(function($class) { |
|
13 | 13 | if (0 === strpos(ltrim($class, '/'), 'Symfony\Component\Yaml')) { |
14 | - if (file_exists($file = __DIR__.'/../'.substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Yaml')).'.php')) { |
|
14 | + if (file_exists($file = __DIR__ . '/../' . substr(str_replace('\\', '/', $class), strlen('Symfony\Component\Yaml')) . '.php')) { |
|
15 | 15 | require_once $file; |
16 | 16 | } |
17 | 17 | } |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | { |
26 | 26 | $this->parser = new Parser(); |
27 | 27 | $this->dumper = new Dumper(); |
28 | - $this->path = __DIR__.'/Fixtures'; |
|
28 | + $this->path = __DIR__ . '/Fixtures'; |
|
29 | 29 | } |
30 | 30 | |
31 | 31 | protected function tearDown() |
@@ -37,9 +37,9 @@ discard block |
||
37 | 37 | |
38 | 38 | public function testSpecifications() |
39 | 39 | { |
40 | - $files = $this->parser->parse(file_get_contents($this->path.'/index.yml')); |
|
40 | + $files = $this->parser->parse(file_get_contents($this->path . '/index.yml')); |
|
41 | 41 | foreach ($files as $file) { |
42 | - $yamls = file_get_contents($this->path.'/'.$file.'.yml'); |
|
42 | + $yamls = file_get_contents($this->path . '/' . $file . '.yml'); |
|
43 | 43 | |
44 | 44 | // split YAMLs documents |
45 | 45 | foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) { |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | } elseif (isset($test['todo']) && $test['todo']) { |
54 | 54 | // TODO |
55 | 55 | } else { |
56 | - $expected = eval('return '.trim($test['php']).';'); |
|
56 | + $expected = eval('return ' . trim($test['php']) . ';'); |
|
57 | 57 | |
58 | 58 | $this->assertEquals($expected, $this->parser->parse($this->dumper->dump($expected, 10)), $test['test']); |
59 | 59 | } |
@@ -129,7 +129,7 @@ |
||
129 | 129 | |
130 | 130 | $this->fail('charsets other than UTF-8 are rejected.'); |
131 | 131 | } catch (\Exception $e) { |
132 | - $this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other than UTF-8 are rejected.'); |
|
132 | + $this->assertInstanceOf('Symfony\Component\Yaml\Exception\ParseException', $e, 'charsets other than UTF-8 are rejected.'); |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | public function getDataFormSpecifications() |
40 | 40 | { |
41 | 41 | $parser = new Parser(); |
42 | - $path = __DIR__.'/Fixtures'; |
|
42 | + $path = __DIR__ . '/Fixtures'; |
|
43 | 43 | |
44 | 44 | $tests = array(); |
45 | - $files = $parser->parse(file_get_contents($path.'/index.yml')); |
|
45 | + $files = $parser->parse(file_get_contents($path . '/index.yml')); |
|
46 | 46 | foreach ($files as $file) { |
47 | - $yamls = file_get_contents($path.'/'.$file.'.yml'); |
|
47 | + $yamls = file_get_contents($path . '/' . $file . '.yml'); |
|
48 | 48 | |
49 | 49 | // split YAMLs documents |
50 | 50 | foreach (preg_split('/^---( %YAML\:1\.0)?/m', $yamls) as $yaml) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if (isset($test['todo']) && $test['todo']) { |
57 | 57 | // TODO |
58 | 58 | } else { |
59 | - $expected = var_export(eval('return '.trim($test['php']).';'), TRUE); |
|
59 | + $expected = var_export(eval('return ' . trim($test['php']) . ';'), TRUE); |
|
60 | 60 | |
61 | 61 | $tests[] = array($expected, $test['yaml'], $test['test']); |
62 | 62 | } |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $this->fail('YAML files must not contain tabs'); |
84 | 84 | } catch (\Exception $e) { |
85 | 85 | $this->assertInstanceOf('\Exception', $e, 'YAML files must not contain tabs'); |
86 | - $this->assertEquals('A YAML file cannot contain tabs as indentation at line 2 (near "'.strpbrk($yaml, "\t").'").', $e->getMessage(), 'YAML files must not contain tabs'); |
|
86 | + $this->assertEquals('A YAML file cannot contain tabs as indentation at line 2 (near "' . strpbrk($yaml, "\t") . '").', $e->getMessage(), 'YAML files must not contain tabs'); |
|
87 | 87 | } |
88 | 88 | } |
89 | 89 | } |
@@ -26,17 +26,17 @@ |
||
26 | 26 | // on the input arrays. This ordering of the characters avoids the use of strtr, |
27 | 27 | // which performs more slowly. |
28 | 28 | static private $escapees = array('\\\\', '\\"', |
29 | - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
30 | - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
31 | - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
32 | - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
33 | - "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9"); |
|
29 | + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
30 | + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
31 | + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
32 | + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
33 | + "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9"); |
|
34 | 34 | static private $escaped = array('\\"', '\\\\', |
35 | - "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", |
|
36 | - "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", |
|
37 | - "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", |
|
38 | - "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", |
|
39 | - "\\N", "\\_", "\\L", "\\P"); |
|
35 | + "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", |
|
36 | + "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", |
|
37 | + "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", |
|
38 | + "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", |
|
39 | + "\\N", "\\_", "\\L", "\\P"); |
|
40 | 40 | |
41 | 41 | /** |
42 | 42 | * Determines if a PHP value would require double quoting in YAML. |
@@ -26,16 +26,16 @@ discard block |
||
26 | 26 | // on the input arrays. This ordering of the characters avoids the use of strtr, |
27 | 27 | // which performs more slowly. |
28 | 28 | static private $escapees = array('\\\\', '\\"', |
29 | - "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
30 | - "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
31 | - "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
32 | - "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
29 | + "\x00", "\x01", "\x02", "\x03", "\x04", "\x05", "\x06", "\x07", |
|
30 | + "\x08", "\x09", "\x0a", "\x0b", "\x0c", "\x0d", "\x0e", "\x0f", |
|
31 | + "\x10", "\x11", "\x12", "\x13", "\x14", "\x15", "\x16", "\x17", |
|
32 | + "\x18", "\x19", "\x1a", "\x1b", "\x1c", "\x1d", "\x1e", "\x1f", |
|
33 | 33 | "\xc2\x85", "\xc2\xa0", "\xe2\x80\xa8", "\xe2\x80\xa9"); |
34 | - static private $escaped = array('\\"', '\\\\', |
|
35 | - "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", |
|
36 | - "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", |
|
34 | + static private $escaped = array('\\"', '\\\\', |
|
35 | + "\\0", "\\x01", "\\x02", "\\x03", "\\x04", "\\x05", "\\x06", "\\a", |
|
36 | + "\\b", "\\t", "\\n", "\\v", "\\f", "\\r", "\\x0e", "\\x0f", |
|
37 | 37 | "\\x10", "\\x11", "\\x12", "\\x13", "\\x14", "\\x15", "\\x16", "\\x17", |
38 | - "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", |
|
38 | + "\\x18", "\\x19", "\\x1a", "\\e", "\\x1c", "\\x1d", "\\x1e", "\\x1f", |
|
39 | 39 | "\\N", "\\_", "\\L", "\\P"); |
40 | 40 | |
41 | 41 | /** |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | */ |
48 | 48 | static public function requiresDoubleQuoting($value) |
49 | 49 | { |
50 | - return preg_match('/'.self::REGEX_CHARACTER_TO_ESCAPE.'/u', $value); |
|
50 | + return preg_match('/' . self::REGEX_CHARACTER_TO_ESCAPE . '/u', $value); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | throw new ParseException('The YAML value does not appear to be valid UTF-8.'); |
55 | 55 | } |
56 | 56 | |
57 | - if (function_exists('mb_internal_encoding') && ((int) ini_get('mbstring.func_overload')) & 2) { |
|
57 | + if (function_exists('mb_internal_encoding') && ((int)ini_get('mbstring.func_overload')) & 2) { |
|
58 | 58 | $mbEncoding = mb_internal_encoding(); |
59 | 59 | mb_internal_encoding('UTF-8'); |
60 | 60 | } |
@@ -81,21 +81,21 @@ discard block |
||
81 | 81 | if (!isset($values['value']) || '' == trim($values['value'], ' ') || 0 === strpos(ltrim($values['value'], ' '), '#')) { |
82 | 82 | $c = $this->getRealCurrentLineNb() + 1; |
83 | 83 | $parser = new Parser($c); |
84 | - $parser->refs =& $this->refs; |
|
84 | + $parser->refs = & $this->refs; |
|
85 | 85 | $data[] = $parser->parse($this->getNextEmbedBlock()); |
86 | 86 | } else { |
87 | 87 | if (isset($values['leadspaces']) |
88 | 88 | && ' ' == $values['leadspaces'] |
89 | - && preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $values['value'], $matches) |
|
89 | + && preg_match('#^(?P<key>' . Inline::REGEX_QUOTED_STRING . '|[^ \'"\{\[].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $values['value'], $matches) |
|
90 | 90 | ) { |
91 | 91 | // this is a compact notation element, add to next block and parse |
92 | 92 | $c = $this->getRealCurrentLineNb(); |
93 | 93 | $parser = new Parser($c); |
94 | - $parser->refs =& $this->refs; |
|
94 | + $parser->refs = & $this->refs; |
|
95 | 95 | |
96 | 96 | $block = $values['value']; |
97 | 97 | if (!$this->isNextLineIndented()) { |
98 | - $block .= "\n".$this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2); |
|
98 | + $block .= "\n" . $this->getNextEmbedBlock($this->getCurrentLineIndentation() + 2); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | $data[] = $parser->parse($block); |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $data[] = $this->parseValue($values['value']); |
104 | 104 | } |
105 | 105 | } |
106 | - } elseif (preg_match('#^(?P<key>'.Inline::REGEX_QUOTED_STRING.'|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values)) { |
|
106 | + } elseif (preg_match('#^(?P<key>' . Inline::REGEX_QUOTED_STRING . '|[^ \'"\[\{].*?) *\:(\s+(?P<value>.+?))?\s*$#u', $this->currentLine, $values)) { |
|
107 | 107 | try { |
108 | 108 | $key = Inline::parseScalar($values['key']); |
109 | 109 | } catch (ParseException $e) { |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | } |
128 | 128 | $c = $this->getRealCurrentLineNb() + 1; |
129 | 129 | $parser = new Parser($c); |
130 | - $parser->refs =& $this->refs; |
|
130 | + $parser->refs = & $this->refs; |
|
131 | 131 | $parsed = $parser->parse($value); |
132 | 132 | |
133 | 133 | $merged = array(); |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | } else { |
165 | 165 | $c = $this->getRealCurrentLineNb() + 1; |
166 | 166 | $parser = new Parser($c); |
167 | - $parser->refs =& $this->refs; |
|
167 | + $parser->refs = & $this->refs; |
|
168 | 168 | $data[$key] = $parser->parse($this->getNextEmbedBlock()); |
169 | 169 | } |
170 | 170 | } else { |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | return ''; |
404 | 404 | } |
405 | 405 | |
406 | - if (!preg_match('#^(?P<indent>'.($indentation ? str_repeat(' ', $indentation) : ' +').')(?P<text>.*)$#u', $this->currentLine, $matches)) { |
|
406 | + if (!preg_match('#^(?P<indent>' . ($indentation ? str_repeat(' ', $indentation) : ' +') . ')(?P<text>.*)$#u', $this->currentLine, $matches)) { |
|
407 | 407 | $this->moveToPreviousLine(); |
408 | 408 | |
409 | 409 | return ''; |
@@ -412,19 +412,19 @@ discard block |
||
412 | 412 | $textIndent = $matches['indent']; |
413 | 413 | $previousIndent = 0; |
414 | 414 | |
415 | - $text .= $matches['text'].$separator; |
|
415 | + $text .= $matches['text'] . $separator; |
|
416 | 416 | while ($this->currentLineNb + 1 < count($this->lines)) { |
417 | 417 | $this->moveToNextLine(); |
418 | 418 | |
419 | - if (preg_match('#^(?P<indent> {'.strlen($textIndent).',})(?P<text>.+)$#u', $this->currentLine, $matches)) { |
|
419 | + if (preg_match('#^(?P<indent> {' . strlen($textIndent) . ',})(?P<text>.+)$#u', $this->currentLine, $matches)) { |
|
420 | 420 | if (' ' == $separator && $previousIndent != $matches['indent']) { |
421 | - $text = substr($text, 0, -1)."\n"; |
|
421 | + $text = substr($text, 0, -1) . "\n"; |
|
422 | 422 | } |
423 | 423 | $previousIndent = $matches['indent']; |
424 | 424 | |
425 | - $text .= str_repeat(' ', $diff = strlen($matches['indent']) - strlen($textIndent)).$matches['text'].($diff ? "\n" : $separator); |
|
425 | + $text .= str_repeat(' ', $diff = strlen($matches['indent']) - strlen($textIndent)) . $matches['text'] . ($diff ? "\n" : $separator); |
|
426 | 426 | } elseif (preg_match('#^(?P<text> *)$#', $this->currentLine, $matches)) { |
427 | - $text .= preg_replace('#^ {1,'.strlen($textIndent).'}#', '', $matches['text'])."\n"; |
|
427 | + $text .= preg_replace('#^ {1,' . strlen($textIndent) . '}#', '', $matches['text']) . "\n"; |
|
428 | 428 | } else { |
429 | 429 | $this->moveToPreviousLine(); |
430 | 430 |