@@ -1733,6 +1733,9 @@ discard block |
||
| 1733 | 1733 | return '"' . substr($this->string, $this->position) . '"'; |
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | + /** |
|
| 1737 | + * @param string $expecting |
|
| 1738 | + */ |
|
| 1736 | 1739 | protected function report($position, $expecting) |
| 1737 | 1740 | { |
| 1738 | 1741 | if ($this->cut) { |
@@ -1755,6 +1758,9 @@ discard block |
||
| 1755 | 1758 | return implode(', ', end($this->warnings)); |
| 1756 | 1759 | } |
| 1757 | 1760 | |
| 1761 | + /** |
|
| 1762 | + * @param string $_string |
|
| 1763 | + */ |
|
| 1758 | 1764 | public function parse($_string) |
| 1759 | 1765 | { |
| 1760 | 1766 | $this->string = $_string; |
@@ -107,7 +107,7 @@ discard block |
||
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | if ($_success) { |
| 110 | - $this->value = call_user_func(function () use (&$examples) { |
|
| 110 | + $this->value = call_user_func(function() use (&$examples) { |
|
| 111 | 111 | return array_values(array_filter($examples)); |
| 112 | 112 | }); |
| 113 | 113 | } |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | if ($_success) { |
| 213 | - $this->value = call_user_func(function () { |
|
| 213 | + $this->value = call_user_func(function() { |
|
| 214 | 214 | return ''; |
| 215 | 215 | }); |
| 216 | 216 | } |
@@ -277,7 +277,7 @@ discard block |
||
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | if ($_success) { |
| 280 | - $this->value = call_user_func(function () use (&$annotations, &$code) { |
|
| 280 | + $this->value = call_user_func(function() use (&$annotations, &$code) { |
|
| 281 | 281 | return ['annotations' => (array)$annotations, 'code' => $code]; |
| 282 | 282 | }); |
| 283 | 283 | } |
@@ -340,7 +340,7 @@ discard block |
||
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | if ($_success) { |
| 343 | - $this->value = call_user_func(function () use (&$groups) { |
|
| 343 | + $this->value = call_user_func(function() use (&$groups) { |
|
| 344 | 344 | return call_user_func_array('array_merge', $groups); |
| 345 | 345 | }); |
| 346 | 346 | } |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | if ($_success) { |
| 426 | - $this->value = call_user_func(function () use (&$annotations) { |
|
| 426 | + $this->value = call_user_func(function() use (&$annotations) { |
|
| 427 | 427 | return $annotations; |
| 428 | 428 | }); |
| 429 | 429 | } |
@@ -698,7 +698,7 @@ discard block |
||
| 698 | 698 | } |
| 699 | 699 | |
| 700 | 700 | if ($_success) { |
| 701 | - $this->value = call_user_func(function () use (&$name, &$args) { |
|
| 701 | + $this->value = call_user_func(function() use (&$name, &$args) { |
|
| 702 | 702 | return [$name, $args]; |
| 703 | 703 | }); |
| 704 | 704 | } |
@@ -773,7 +773,7 @@ discard block |
||
| 773 | 773 | } |
| 774 | 774 | |
| 775 | 775 | if ($_success) { |
| 776 | - $this->value = call_user_func(function () use (&$string) { |
|
| 776 | + $this->value = call_user_func(function() use (&$string) { |
|
| 777 | 777 | return $string; |
| 778 | 778 | }); |
| 779 | 779 | } |
@@ -814,7 +814,7 @@ discard block |
||
| 814 | 814 | } |
| 815 | 815 | |
| 816 | 816 | if ($_success) { |
| 817 | - $this->value = call_user_func(function () { |
|
| 817 | + $this->value = call_user_func(function() { |
|
| 818 | 818 | return ''; |
| 819 | 819 | }); |
| 820 | 820 | } |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | } |
| 936 | 936 | |
| 937 | 937 | if ($_success) { |
| 938 | - $this->value = call_user_func(function () use (&$string) { |
|
| 938 | + $this->value = call_user_func(function() use (&$string) { |
|
| 939 | 939 | return implode($string); |
| 940 | 940 | }); |
| 941 | 941 | } |
@@ -976,7 +976,7 @@ discard block |
||
| 976 | 976 | } |
| 977 | 977 | |
| 978 | 978 | if ($_success) { |
| 979 | - $this->value = call_user_func(function () { |
|
| 979 | + $this->value = call_user_func(function() { |
|
| 980 | 980 | return '"'; |
| 981 | 981 | }); |
| 982 | 982 | } |
@@ -1390,7 +1390,7 @@ discard block |
||
| 1390 | 1390 | } |
| 1391 | 1391 | |
| 1392 | 1392 | if ($_success) { |
| 1393 | - $this->value = call_user_func(function () use (&$code) { |
|
| 1393 | + $this->value = call_user_func(function() use (&$code) { |
|
| 1394 | 1394 | return $code; |
| 1395 | 1395 | }); |
| 1396 | 1396 | } |
@@ -1730,7 +1730,7 @@ discard block |
||
| 1730 | 1730 | |
| 1731 | 1731 | private function rest() |
| 1732 | 1732 | { |
| 1733 | - return '"' . substr($this->string, $this->position) . '"'; |
|
| 1733 | + return '"'.substr($this->string, $this->position).'"'; |
|
| 1734 | 1734 | } |
| 1735 | 1735 | |
| 1736 | 1736 | protected function report($position, $expecting) |
@@ -37,7 +37,7 @@ |
||
| 37 | 37 | $name = $this->readName($def['annotations']) ?: (string)$index + 1; |
| 38 | 38 | |
| 39 | 39 | if (isset($examples[$name])) { |
| 40 | - throw new \RuntimeException("Example '$name' already exists in definition " . ($index + 1)); |
|
| 40 | + throw new \RuntimeException("Example '$name' already exists in definition ".($index + 1)); |
|
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | $examples[$name] = new Example( |