@@ -53,7 +53,7 @@ |
||
| 53 | 53 | |
| 54 | 54 | protected static function getArguments($arguments, $arrayToSequence = true) |
| 55 | 55 | { |
| 56 | - return array_map(function ($argument) use ($arrayToSequence) { |
|
| 56 | + return array_map(function($argument) use ($arrayToSequence) { |
|
| 57 | 57 | return self::getArgument($argument, $arrayToSequence); |
| 58 | 58 | }, $arguments); |
| 59 | 59 | } |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $success = new Success($length, $successes); |
| 99 | 99 | |
| 100 | 100 | // ResultTrait |
| 101 | - $success->addResultCallback(function (&$results) use ($input, $offset, $length) {
|
|
| 101 | + $success->addResultCallback(function(&$results) use ($input, $offset, $length) {
|
|
| 102 | 102 | $text = substr($input, $offset, $length); |
| 103 | 103 | |
| 104 | 104 | $this->resolveResultCallbacks($results, $text); |
@@ -106,7 +106,7 @@ discard block |
||
| 106 | 106 | |
| 107 | 107 | // AssignTrait |
| 108 | 108 | $callbacks = $this->callbacks; |
| 109 | - $success->addCustomCallback(function () use ($input, $offset, $length, $callbacks) {
|
|
| 109 | + $success->addCustomCallback(function() use ($input, $offset, $length, $callbacks) {
|
|
| 110 | 110 | $text = substr($input, $offset, $length); |
| 111 | 111 | |
| 112 | 112 | $this->resolveAssignCallbacks($text); |
@@ -117,7 +117,7 @@ discard block |
||
| 117 | 117 | }); |
| 118 | 118 | |
| 119 | 119 | // TokenTrait |
| 120 | - $success->setTokenCallback(function (&$children) use ($input, $offset, $length) {
|
|
| 120 | + $success->setTokenCallback(function(&$children) use ($input, $offset, $length) {
|
|
| 121 | 121 | return $this->resolveToken($input, $offset, $length, $children, get_class($this)); |
| 122 | 122 | }); |
| 123 | 123 | |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | */ |
| 138 | 138 | protected static function isRuleDefined(&$rules, $names) |
| 139 | 139 | { |
| 140 | - foreach ((array)$names as $key) { |
|
| 140 | + foreach ((array) $names as $key) { |
|
| 141 | 141 | if (!isset($rules[$key])) { |
| 142 | 142 | return false; |
| 143 | 143 | } |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | |
| 149 | 149 | protected static function undefineRule(&$rules, $names) |
| 150 | 150 | { |
| 151 | - foreach ((array)$names as $key) { |
|
| 151 | + foreach ((array) $names as $key) { |
|
| 152 | 152 | unset($rules[$key]); |
| 153 | 153 | } |
| 154 | 154 | } |
@@ -280,6 +280,6 @@ discard block |
||
| 280 | 280 | // ignore |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | - return (string)$this->parser; |
|
| 283 | + return (string) $this->parser; |
|
| 284 | 284 | } |
| 285 | 285 | } |
@@ -4,12 +4,12 @@ |
||
| 4 | 4 | // ABNF specification |
| 5 | 5 | 'abnf' => \vanderlee\comprehend\library\Rfc2234::class, |
| 6 | 6 | 'rfc2234' => \vanderlee\comprehend\library\Rfc2234::class, |
| 7 | - 'rfc4234' => \vanderlee\comprehend\library\Rfc2234::class, // Obsoletes 2234, No syntax changes |
|
| 8 | - 'rfc5234' => \vanderlee\comprehend\library\Rfc2234::class, // Obsoletes 4234, No syntax changes |
|
| 9 | - 'rfc7405' => \vanderlee\comprehend\library\Rfc7405::class, // Updates 5234 |
|
| 7 | + 'rfc4234' => \vanderlee\comprehend\library\Rfc2234::class, // Obsoletes 2234, No syntax changes |
|
| 8 | + 'rfc5234' => \vanderlee\comprehend\library\Rfc2234::class, // Obsoletes 4234, No syntax changes |
|
| 9 | + 'rfc7405' => \vanderlee\comprehend\library\Rfc7405::class, // Updates 5234 |
|
| 10 | 10 | // URI |
| 11 | 11 | 'uri' => \vanderlee\comprehend\library\Rfc3986::class, |
| 12 | - 'rfc3986' => \vanderlee\comprehend\library\Rfc3986::class, // Updates 1738, Obsoletes 2732, 2396, 1808 |
|
| 12 | + 'rfc3986' => \vanderlee\comprehend\library\Rfc3986::class, // Updates 1738, Obsoletes 2732, 2396, 1808 |
|
| 13 | 13 | //'rfc6874' => Rfc3986::class, // Updates 3986 |
| 14 | 14 | //'rfc7320' => Rfc3986::class, // Updates 3986 |
| 15 | 15 | // IPv6 |
@@ -94,7 +94,7 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | if ($match instanceof Success && !empty($this->definition->processors)) { |
| 96 | 96 | foreach ($this->definition->processors as $key => $processor) { |
| 97 | - $match->addResultCallback(function (&$results) use ($key, $processor, $localResults) { |
|
| 97 | + $match->addResultCallback(function(&$results) use ($key, $processor, $localResults) { |
|
| 98 | 98 | $results[$key] = $processor($localResults, $results); |
| 99 | 99 | }); |
| 100 | 100 | } |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | // ignore |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | - return (string)$this->parser; |
|
| 115 | + return (string) $this->parser; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | } |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -spl_autoload_register(function ($class) { |
|
| 3 | +spl_autoload_register(function($class) { |
|
| 4 | 4 | $file = __DIR__ . DIRECTORY_SEPARATOR . $class . '.php'; |
| 5 | 5 | if (!class_exists($class) && is_file($file)) { |
| 6 | 6 | /** @noinspection PhpIncludeInspection */ |
@@ -63,11 +63,11 @@ |
||
| 63 | 63 | switch ($this->preference) { |
| 64 | 64 | default: |
| 65 | 65 | case self::FIRST: |
| 66 | - return (string)$this->parser; |
|
| 66 | + return (string) $this->parser; |
|
| 67 | 67 | case self::LONGEST: |
| 68 | - return 'longest-of' . (string)$this->parser; |
|
| 68 | + return 'longest-of' . (string) $this->parser; |
|
| 69 | 69 | case self::SHORTEST: |
| 70 | - return 'shortest-of' . (string)$this->parser; |
|
| 70 | + return 'shortest-of' . (string) $this->parser; |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | public function __construct($sensitivity, $parser) |
| 35 | 35 | { |
| 36 | 36 | $this->parser = self::getArgument($parser); |
| 37 | - $this->sensitivity = (bool)$sensitivity; |
|
| 37 | + $this->sensitivity = (bool) $sensitivity; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | protected function parse(&$input, $offset, Context $context) |
@@ -49,7 +49,7 @@ |
||
| 49 | 49 | |
| 50 | 50 | public function __toString() |
| 51 | 51 | { |
| 52 | - return (string)$this->parser; |
|
| 52 | + return (string) $this->parser; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | } |