@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function __construct(Definition $definition) |
| 30 | 30 | { |
| 31 | - $this->definition = $definition; |
|
| 31 | + $this->definition = $definition; |
|
| 32 | 32 | |
| 33 | 33 | $this->file = $definition->getFileName(); |
| 34 | 34 | $this->line = $definition->getDeclarationLine(); |
@@ -27,8 +27,8 @@ discard block |
||
| 27 | 27 | { |
| 28 | 28 | $this->trace = $trace; |
| 29 | 29 | |
| 30 | - $this->file = (string)($trace['file'] ?? 'php://input'); |
|
| 31 | - $this->line = (int)($trace['line'] ?? 0); |
|
| 30 | + $this->file = (string) ($trace['file'] ?? 'php://input'); |
|
| 31 | + $this->line = (int) ($trace['line'] ?? 0); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** |
@@ -54,16 +54,16 @@ discard block |
||
| 54 | 54 | $result = $trace['function']; |
| 55 | 55 | |
| 56 | 56 | if (\array_key_exists('class', $trace)) { |
| 57 | - $result = $trace['class'] . $trace['type'] . $result; |
|
| 57 | + $result = $trace['class'].$trace['type'].$result; |
|
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | $arguments = []; |
| 61 | 61 | |
| 62 | - foreach ((array)($trace['args'] ?? []) as $argument) { |
|
| 62 | + foreach ((array) ($trace['args'] ?? []) as $argument) { |
|
| 63 | 63 | $arguments[] = $this->valueToString($argument); |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - return $result . '(' . \implode(', ', $arguments) . ')'; |
|
| 66 | + return $result.'('.\implode(', ', $arguments).')'; |
|
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | /** |
@@ -104,10 +104,10 @@ discard block |
||
| 104 | 104 | $body = \implode(', ', $parts); |
| 105 | 105 | |
| 106 | 106 | if (\is_object($iterator)) { |
| 107 | - return $this->objectToString($iterator) . '<' . $body . '>'; |
|
| 107 | + return $this->objectToString($iterator).'<'.$body.'>'; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | - return '[' . $body . ']'; |
|
| 110 | + return '['.$body.']'; |
|
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | /** |
@@ -50,7 +50,7 @@ |
||
| 50 | 50 | Compiler::load(File::fromPathname(self::SCHEMA_SDL_GRAMMAR)) |
| 51 | 51 | ->setClassName('BaseParser') |
| 52 | 52 | ->setNamespace('Railt\\SDL\\Parser') |
| 53 | - ->saveTo(__DIR__ . '/../Parser'); |
|
| 53 | + ->saveTo(__DIR__.'/../Parser'); |
|
| 54 | 54 | |
| 55 | 55 | $out->writeln('<info>OK</info>'); |
| 56 | 56 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | */ |
| 106 | 106 | protected function valueWithType($value): string |
| 107 | 107 | { |
| 108 | - return \mb_strtolower(\gettype($value)) . ' ' . $this->valueToString($value); |
|
| 108 | + return \mb_strtolower(\gettype($value)).' '.$this->valueToString($value); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | /** |
@@ -164,6 +164,6 @@ discard block |
||
| 164 | 164 | return $result; |
| 165 | 165 | } |
| 166 | 166 | |
| 167 | - return (string)$result; |
|
| 167 | + return (string) $result; |
|
| 168 | 168 | } |
| 169 | 169 | } |
@@ -8,7 +8,7 @@ |
||
| 8 | 8 | declare(strict_types=1); |
| 9 | 9 | |
| 10 | 10 | |
| 11 | -\spl_autoload_register(function (string $alias): void { |
|
| 11 | +\spl_autoload_register(function(string $alias): void { |
|
| 12 | 12 | $shouldRewrite = \strpos(\trim($alias, '\\'), 'Railt\\Reflection') === 0; |
| 13 | 13 | |
| 14 | 14 | if ($shouldRewrite) { |
@@ -143,7 +143,7 @@ discard block |
||
| 143 | 143 | { |
| 144 | 144 | $this->load($document); |
| 145 | 145 | |
| 146 | - $build = function (Definition $definition): void { |
|
| 146 | + $build = function(Definition $definition): void { |
|
| 147 | 147 | $this->stack->push($definition); |
| 148 | 148 | |
| 149 | 149 | if ($definition instanceof Compilable) { |
@@ -154,7 +154,7 @@ discard block |
||
| 154 | 154 | $this->typeCoercion->apply($definition); |
| 155 | 155 | } |
| 156 | 156 | |
| 157 | - if (! ($definition instanceof StandardType)) { |
|
| 157 | + if (!($definition instanceof StandardType)) { |
|
| 158 | 158 | $this->typeValidator->group(Definitions::class)->validate($definition); |
| 159 | 159 | } |
| 160 | 160 | |
@@ -218,7 +218,7 @@ discard block |
||
| 218 | 218 | */ |
| 219 | 219 | private function onCompile(): \Closure |
| 220 | 220 | { |
| 221 | - return function (Readable $readable): Document { |
|
| 221 | + return function(Readable $readable): Document { |
|
| 222 | 222 | $ast = $this->parser->parse($readable); |
| 223 | 223 | |
| 224 | 224 | return $this->complete(new DocumentBuilder($ast, $readable, $this)); |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | /** |
| 18 | 18 | * @var string |
| 19 | 19 | */ |
| 20 | - public const GRAMMAR_PATHNAME = __DIR__ . '/../../../resources/grammar/sdl.pp'; |
|
| 20 | + public const GRAMMAR_PATHNAME = __DIR__.'/../../../resources/grammar/sdl.pp'; |
|
| 21 | 21 | |
| 22 | 22 | /** |
| 23 | 23 | * Make tokens public |
@@ -41,6 +41,6 @@ discard block |
||
| 41 | 41 | */ |
| 42 | 42 | public static function match(string $lexeme, string $value): bool |
| 43 | 43 | { |
| 44 | - return (bool)\preg_match(self::pattern($lexeme), $value); |
|
| 44 | + return (bool) \preg_match(self::pattern($lexeme), $value); |
|
| 45 | 45 | } |
| 46 | 46 | } |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | return; |
| 38 | 38 | } |
| 39 | 39 | |
| 40 | - if (! $type->hasDefaultValue()) { |
|
| 40 | + if (!$type->hasDefaultValue()) { |
|
| 41 | 41 | $this->inferenceValue($type); |
| 42 | 42 | return; |
| 43 | 43 | } |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | * field(arg: [Float] = null) → field(arg: [Float] = null) |
| 67 | 67 | * </code> |
| 68 | 68 | */ |
| 69 | - $isListDefinedByNonList = ($value !== null && ! \is_array($value)); |
|
| 69 | + $isListDefinedByNonList = ($value !== null && !\is_array($value)); |
|
| 70 | 70 | |
| 71 | 71 | /** |
| 72 | 72 | * The allowable conversion method for NULL: |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | * field(argument: Type = NULL): Type |
| 122 | 122 | * </code> |
| 123 | 123 | */ |
| 124 | - if (! $argument->isNonNull()) { |
|
| 124 | + if (!$argument->isNonNull()) { |
|
| 125 | 125 | $this->set($argument, null); |
| 126 | 126 | return; |
| 127 | 127 | } |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | */ |
| 134 | 134 | private function set(BaseArgument $argument, $value): void |
| 135 | 135 | { |
| 136 | - $invocation = function ($value): void { |
|
| 136 | + $invocation = function($value): void { |
|
| 137 | 137 | /** @var BaseArgument $this */ |
| 138 | 138 | $this->defaultValue = $value; |
| 139 | 139 | $this->hasDefaultValue = true; |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | private function inferenceDefaultArguments(HasArguments $container, HasPassedArguments $usage): void |
| 50 | 50 | { |
| 51 | 51 | foreach ($container->getArguments() as $argument) { |
| 52 | - if ($argument->hasDefaultValue() && ! $usage->hasPassedArgument($argument->getName())) { |
|
| 52 | + if ($argument->hasDefaultValue() && !$usage->hasPassedArgument($argument->getName())) { |
|
| 53 | 53 | $this->set($usage, $argument->getName(), $argument->getDefaultValue()); |
| 54 | 54 | } |
| 55 | 55 | } |
@@ -62,7 +62,7 @@ discard block |
||
| 62 | 62 | */ |
| 63 | 63 | private function set(HasPassedArguments $usage, string $key, $value): void |
| 64 | 64 | { |
| 65 | - $invocation = function (string $key, $value): void { |
|
| 65 | + $invocation = function(string $key, $value): void { |
|
| 66 | 66 | /** @var BaseInputInvocation $this */ |
| 67 | 67 | $this->arguments[$key] = $value; |
| 68 | 68 | }; |