@@ -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 | /** |
@@ -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 | } |
@@ -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 | }; |
@@ -33,7 +33,7 @@ |
||
33 | 33 | */ |
34 | 34 | public function apply(TypeDefinition $directive): void |
35 | 35 | { |
36 | - $applier = function () use ($directive): void { |
|
36 | + $applier = function() use ($directive): void { |
|
37 | 37 | $this->deprecationReason = $directive->getPassedArgument(Deprecation::REASON_ARGUMENT); |
38 | 38 | }; |
39 | 39 |
@@ -51,7 +51,7 @@ |
||
51 | 51 | /** @var DirectiveDefinition $definition */ |
52 | 52 | $definition = $directive->getTypeDefinition(); |
53 | 53 | |
54 | - if (! $definition->isAllowedFor($directive->getParent())) { |
|
54 | + if (!$definition->isAllowedFor($directive->getParent())) { |
|
55 | 55 | $error = \vsprintf('Trying to define directive %s on %s, but only %s locations allowed.', [ |
56 | 56 | $directive, |
57 | 57 | $directive->getParent(), |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | |
72 | 72 | $this->getCallStack()->push($type); |
73 | 73 | |
74 | - if (! ($type instanceof Inputable)) { |
|
74 | + if (!($type instanceof Inputable)) { |
|
75 | 75 | $error = \sprintf('%s must be type of Scalar, Enum or Input', $type); |
76 | 76 | throw new TypeConflictException($error, $this->getCallStack()); |
77 | 77 | } |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | private function validateSingleArgument(ArgumentDefinition $arg, Inputable $type, $value): void |
95 | 95 | { |
96 | - if (! $type->isCompatible($value)) { |
|
96 | + if (!$type->isCompatible($value)) { |
|
97 | 97 | $error = \vsprintf('The argument %s of %s contain non compatible value %s', [ |
98 | 98 | $arg->getName(), |
99 | 99 | $type, |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | */ |
113 | 113 | private function validateListArguments(ArgumentDefinition $arg, Inputable $type, $value): void |
114 | 114 | { |
115 | - if (! \is_iterable($value)) { |
|
115 | + if (!\is_iterable($value)) { |
|
116 | 116 | $error = \vsprintf('The argument %s of %s should contain list value, but %s given', [ |
117 | 117 | $arg->getName(), |
118 | 118 | $type, |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | private function validateMissingArgument(HasPassedArguments $invocation, ArgumentDefinition $argument): void |
137 | 137 | { |
138 | - if (! $invocation->hasPassedArgument($argument->getName())) { |
|
138 | + if (!$invocation->hasPassedArgument($argument->getName())) { |
|
139 | 139 | $error = \sprintf('Required argument "%s" of %s not specified', $argument, $argument->getParent()); |
140 | 140 | |
141 | 141 | throw new TypeConflictException($error, $this->getCallStack()); |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | private function validateArgumentExisting(HasArguments $container, string $argument): void |
152 | 152 | { |
153 | - if (! $container->hasArgument($argument)) { |
|
153 | + if (!$container->hasArgument($argument)) { |
|
154 | 154 | $error = \sprintf('In the %s there is no specified argument "%s"', $container, $argument); |
155 | 155 | |
156 | 156 | throw new TypeConflictException($error, $this->getCallStack()); |