@@ -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 | } |
@@ -103,21 +103,21 @@ |
||
| 103 | 103 | ['::', repeat(5, 5, [$this->h16, ':']), $this->ls32], |
| 104 | 104 | [opt($this->h16), '::', repeat(4, 4, [$this->h16, ':']), $this->ls32], |
| 105 | 105 | [ |
| 106 | - opt([repeat(0, 1, [$this->h16, ':',]), $this->h16]), |
|
| 106 | + opt([repeat(0, 1, [$this->h16, ':', ]), $this->h16]), |
|
| 107 | 107 | '::', |
| 108 | 108 | repeat(3, 3, [$this->h16, ':']), |
| 109 | 109 | $this->ls32 |
| 110 | 110 | ], |
| 111 | 111 | [ |
| 112 | - opt([repeat(0, 2, [$this->h16, ':',]), $this->h16]), |
|
| 112 | + opt([repeat(0, 2, [$this->h16, ':', ]), $this->h16]), |
|
| 113 | 113 | '::', |
| 114 | 114 | repeat(2, 2, [$this->h16, ':']), |
| 115 | 115 | $this->ls32 |
| 116 | 116 | ], |
| 117 | - [opt([repeat(0, 3, [$this->h16, ':',]), $this->h16]), '::', $this->h16, ':', $this->ls32], |
|
| 118 | - [opt([repeat(0, 4, [$this->h16, ':',]), $this->h16]), '::', $this->ls32], |
|
| 119 | - [opt([repeat(0, 5, [$this->h16, ':',]), $this->h16]), '::', $this->h16], |
|
| 120 | - [opt([repeat(0, 6, [$this->h16, ':',]), $this->h16]), '::'] |
|
| 117 | + [opt([repeat(0, 3, [$this->h16, ':', ]), $this->h16]), '::', $this->h16, ':', $this->ls32], |
|
| 118 | + [opt([repeat(0, 4, [$this->h16, ':', ]), $this->h16]), '::', $this->ls32], |
|
| 119 | + [opt([repeat(0, 5, [$this->h16, ':', ]), $this->h16]), '::', $this->h16], |
|
| 120 | + [opt([repeat(0, 6, [$this->h16, ':', ]), $this->h16]), '::'] |
|
| 121 | 121 | ), |
| 122 | 122 | 'dec_octet' => c( |
| 123 | 123 | ['25', range('0', '5')], // 250-255
|
@@ -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 | |
@@ -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 | } |
@@ -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) |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | */ |
| 33 | 33 | public function setResult($key = null, $value = null) |
| 34 | 34 | { |
| 35 | - $this->resultCallbacks[] = function (&$results, $text) use (&$key, &$value) { |
|
| 35 | + $this->resultCallbacks[] = function(&$results, $text) use (&$key, &$value) { |
|
| 36 | 36 | if (is_callable($value)) { |
| 37 | 37 | $text = $value($text); |
| 38 | 38 | } elseif ($value !== null) { |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | */ |
| 56 | 56 | public function concatResult($key = null, $value = null) |
| 57 | 57 | { |
| 58 | - $this->resultCallbacks[] = function (&$results, $text) use (&$key, &$value) { |
|
| 58 | + $this->resultCallbacks[] = function(&$results, $text) use (&$key, &$value) { |
|
| 59 | 59 | if (is_callable($value)) { |
| 60 | 60 | $text = $value($text); |
| 61 | 61 | } elseif ($value !== null) { |
@@ -63,7 +63,7 @@ discard block |
||
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | if (!isset($results[$key])) { |
| 66 | - $results[$key] = (string)$text; |
|
| 66 | + $results[$key] = (string) $text; |
|
| 67 | 67 | } elseif (is_array($results[$key])) { |
| 68 | 68 | $results[$key][] = array_pop($results[$key]) . $text; |
| 69 | 69 | } else { |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | */ |
| 84 | 84 | public function pushResult($key = null, $value = null) |
| 85 | 85 | { |
| 86 | - $this->resultCallbacks[] = function (&$results, $text) use (&$key, &$value) { |
|
| 86 | + $this->resultCallbacks[] = function(&$results, $text) use (&$key, &$value) { |
|
| 87 | 87 | if (is_callable($value)) { |
| 88 | 88 | $text = $value($text); |
| 89 | 89 | } elseif ($value !== null) { |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | public function assignTo(&$variable) |
| 38 | 38 | { |
| 39 | - $this->assignCallbacks[] = function ($text) use (&$variable) { |
|
| 39 | + $this->assignCallbacks[] = function($text) use (&$variable) { |
|
| 40 | 40 | $variable = $text; |
| 41 | 41 | }; |
| 42 | 42 | |
@@ -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 | |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | |
| 51 | 51 | public function __toString() |
| 52 | 52 | { |
| 53 | - return (string)$this->pattern; |
|
| 53 | + return (string) $this->pattern; |
|
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | } |