@@ -105,7 +105,7 @@ |
||
| 105 | 105 | $path = \trim($token->value(1), " \t\n\r\0\x0B\"'"); |
| 106 | 106 | |
| 107 | 107 | foreach (self::FILE_EXTENSIONS as $extension) { |
| 108 | - $file = \dirname($from->getPathname()) . '/' . $path . $extension; |
|
| 108 | + $file = \dirname($from->getPathname()).'/'.$path.$extension; |
|
| 109 | 109 | |
| 110 | 110 | if (\is_file($file)) { |
| 111 | 111 | return File::fromPathname($file); |
@@ -82,7 +82,7 @@ |
||
| 82 | 82 | */ |
| 83 | 83 | private function set(string $group, string $name, string $value): void |
| 84 | 84 | { |
| 85 | - if (! \array_key_exists($group, $this->configs)) { |
|
| 85 | + if (!\array_key_exists($group, $this->configs)) { |
|
| 86 | 86 | $this->configs[$group] = []; |
| 87 | 87 | } |
| 88 | 88 | |
@@ -31,7 +31,7 @@ |
||
| 31 | 31 | */ |
| 32 | 32 | public function __construct(string $prefix, array $allowed) |
| 33 | 33 | { |
| 34 | - $this->prefix = \trim($prefix, '.') . '.'; |
|
| 34 | + $this->prefix = \trim($prefix, '.').'.'; |
|
| 35 | 35 | $this->allowed = $allowed; |
| 36 | 36 | } |
| 37 | 37 | |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | /** |
| 95 | - * @return mixed|null |
|
| 95 | + * @return \Railt\Lexer\TokenInterface |
|
| 96 | 96 | */ |
| 97 | 97 | public function current() |
| 98 | 98 | { |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | $this->tokens[$name] = $value; |
| 44 | 44 | |
| 45 | 45 | if ($group !== null) { |
| 46 | - $this->groups[$name] = (int)$group; |
|
| 46 | + $this->groups[$name] = (int) $group; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | if ($token->name() === 'T_SKIP') { |
@@ -55,11 +55,11 @@ discard block |
||
| 55 | 55 | return; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | - if (! \array_key_exists($this->current, $this->rules)) { |
|
| 58 | + if (!\array_key_exists($this->current, $this->rules)) { |
|
| 59 | 59 | $this->rules[$this->current] = []; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | - if (! \array_key_exists($this->current, $this->files)) { |
|
| 62 | + if (!\array_key_exists($this->current, $this->files)) { |
|
| 63 | 63 | $this->files[$this->current] = $readable; |
| 64 | 64 | } |
| 65 | 65 | |
@@ -115,13 +115,13 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | private function resolveDelegate(string $delegate, Readable $readable, TokenInterface $token): void |
| 117 | 117 | { |
| 118 | - if (! \class_exists($delegate)) { |
|
| 118 | + if (!\class_exists($delegate)) { |
|
| 119 | 119 | $error = 'Could not found delegate class "%s"'; |
| 120 | 120 | throw (new GrammarException(\sprintf($error, $delegate))) |
| 121 | 121 | ->throwsIn($readable, $token->offset()); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - if (! \is_subclass_of($delegate, Delegate::class)) { |
|
| 124 | + if (!\is_subclass_of($delegate, Delegate::class)) { |
|
| 125 | 125 | $error = 'Delegate should be an instance of %s, but %s given'; |
| 126 | 126 | throw (new GrammarException(\sprintf($error, Delegate::class, $delegate))) |
| 127 | 127 | ->throwsIn($readable, $token->offset()); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | $this->stack->push($current = $this->root($rule)); |
| 92 | 92 | |
| 93 | 93 | while ($iterator->valid()) { |
| 94 | - $this->text .= $iterator->current()->value() . ' '; |
|
| 94 | + $this->text .= $iterator->current()->value().' '; |
|
| 95 | 95 | |
| 96 | 96 | $this->reduce($iterator->current(), $iterator); |
| 97 | 97 | $iterator->next(); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | */ |
| 189 | 189 | private function reduceToken(TokenInterface $token, bool $keep): int |
| 190 | 190 | { |
| 191 | - $key = $token->value(1) . ':' . $token->name(); |
|
| 191 | + $key = $token->value(1).':'.$token->name(); |
|
| 192 | 192 | |
| 193 | 193 | $builder = new TokenBuilder($this->getId($key), $token->value(1), $keep); |
| 194 | 194 | |