@@ -37,7 +37,7 @@ |
||
37 | 37 | self::FLOAT => $float = self::createInternalType(self::FLOAT, $string), |
38 | 38 | self::INT => $int = self::createInternalType(self::INT, $float), |
39 | 39 | self::BOOLEAN => $bool = self::createInternalType(self::BOOLEAN, $string), |
40 | - self::NULL => $null = self::createInternalType(self::NULL, Type::scalar()), |
|
40 | + self::null => $null = self::createInternalType(self::null, Type::scalar()), |
|
41 | 41 | self::ID => $id = self::createInternalType(self::ID, $string), |
42 | 42 | self::DATE_TIME => $date = self::createInternalType(self::DATE_TIME, $string), |
43 | 43 | ]; |
@@ -37,6 +37,6 @@ |
||
37 | 37 | { |
38 | 38 | $prefix = $this->name->isGlobal() ? TypeNameInterface::NAMESPACE_SEPARATOR : ''; |
39 | 39 | |
40 | - return $prefix . $this->name->getFullyQualifiedName(); |
|
40 | + return $prefix.$this->name->getFullyQualifiedName(); |
|
41 | 41 | } |
42 | 42 | } |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | * @param VarSymbolInterface $record |
34 | 34 | * @return int |
35 | 35 | */ |
36 | - public function declare(VarSymbolInterface $record): int |
|
36 | + public function declare(VarSymbolInterface$record): int |
|
37 | 37 | { |
38 | 38 | $id = $this->id++; |
39 | 39 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function fetch(int $addr): VarSymbolInterface |
51 | 51 | { |
52 | - if (! isset($this->variables[$addr])) { |
|
52 | + if (!isset($this->variables[$addr])) { |
|
53 | 53 | $error = \sprintf('Mismatched variable address 0x%08x', $addr); |
54 | 54 | throw new NotFoundException($error); |
55 | 55 | } |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | { |
75 | 75 | $variables = []; |
76 | 76 | foreach ($this->variables as $id => $var) { |
77 | - $variables[$id] = (string)$var; |
|
77 | + $variables[$id] = (string) $var; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | return [ |
@@ -44,8 +44,8 @@ |
||
44 | 44 | public function generate(Readable $file, iterable $records): Document |
45 | 45 | { |
46 | 46 | foreach ($records as $record) { |
47 | - echo __FILE__ . ':' . __LINE__ . "\n"; |
|
48 | - echo \get_class($record) . ' => ' . \json_encode($record, \JSON_PRETTY_PRINT); |
|
47 | + echo __FILE__.':'.__LINE__."\n"; |
|
48 | + echo \get_class($record).' => '.\json_encode($record, \JSON_PRETTY_PRINT); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | //die; |
@@ -38,7 +38,7 @@ |
||
38 | 38 | /** |
39 | 39 | * @param ContextInterface $ctx |
40 | 40 | * @param RuleInterface $rule |
41 | - * @return \Generator|mixed|void |
|
41 | + * @return \Generator |
|
42 | 42 | */ |
43 | 43 | public function reduce(ContextInterface $ctx, RuleInterface $rule) |
44 | 44 | { |
@@ -14,7 +14,7 @@ discard block |
||
14 | 14 | use Railt\Reflection\Contracts\Document; |
15 | 15 | use Railt\SDL\Exception\CompilerException; |
16 | 16 | |
17 | -if (! \function_exists('sdl')) { |
|
17 | +if (!\function_exists('sdl')) { |
|
18 | 18 | /** |
19 | 19 | * @param string $fileOrSources |
20 | 20 | * @param bool $filename |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | } |
31 | 31 | } |
32 | 32 | |
33 | -if (! \function_exists('object_to_string')) { |
|
33 | +if (!\function_exists('object_to_string')) { |
|
34 | 34 | /** |
35 | 35 | * @param object $object |
36 | 36 | * @return string |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | : \spl_object_hash($object); |
45 | 45 | |
46 | 46 | if (is_renderable($object)) { |
47 | - return \sprintf('%s(%s)#%s', \get_class($object), (string)$object, $hash); |
|
47 | + return \sprintf('%s(%s)#%s', \get_class($object), (string) $object, $hash); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | return \sprintf('%s#%s', \get_class($object), $hash); |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | |
55 | -if (! \function_exists('is_renderable')) { |
|
55 | +if (!\function_exists('is_renderable')) { |
|
56 | 56 | /** |
57 | 57 | * @param mixed $value |
58 | 58 | * @return bool |
@@ -56,20 +56,20 @@ |
||
56 | 56 | public static function new($name, bool $global = null): TypeNameInterface |
57 | 57 | { |
58 | 58 | switch (true) { |
59 | - case $name === null || ! $name: |
|
60 | - return static::empty((bool)$global); |
|
59 | + case $name === null || !$name: |
|
60 | + return static::empty((bool) $global); |
|
61 | 61 | |
62 | 62 | case $name instanceof TypeNameInterface: |
63 | 63 | return $name; |
64 | 64 | |
65 | 65 | case \is_array($name): |
66 | - return static::fromArray($name, (bool)$global); |
|
66 | + return static::fromArray($name, (bool) $global); |
|
67 | 67 | |
68 | 68 | case \is_iterable($name): |
69 | - return static::fromArray(\iterator_to_array($name, false), (bool)$global); |
|
69 | + return static::fromArray(\iterator_to_array($name, false), (bool) $global); |
|
70 | 70 | |
71 | 71 | case \is_scalar($name): |
72 | - return static::fromString((string)$name, $global); |
|
72 | + return static::fromString((string) $name, $global); |
|
73 | 73 | |
74 | 74 | default: |
75 | 75 | $error = 'Unsupported argument type of %s(self|array|iterable|scalar $name = %s)'; |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | /** |
33 | 33 | * @var string |
34 | 34 | */ |
35 | - public const INTERFACE = 'Interface'; |
|
35 | + public const interface = 'Interface'; |
|
36 | 36 | |
37 | 37 | /** |
38 | 38 | * @var string |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | /** |
88 | 88 | * @var string |
89 | 89 | */ |
90 | - public const LIST = 'List'; |
|
90 | + public const list = 'List'; |
|
91 | 91 | |
92 | 92 | /** |
93 | 93 | * @var string |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | /** |
133 | 133 | * @var string |
134 | 134 | */ |
135 | - public const NULL = 'Null'; |
|
135 | + public const null = 'Null'; |
|
136 | 136 | |
137 | 137 | /** |
138 | 138 | * @var string[] |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | self::SCALAR, |
142 | 142 | self::OBJECT, |
143 | 143 | self::DIRECTIVE, |
144 | - self::INTERFACE, |
|
144 | + self::interface, |
|
145 | 145 | self::UNION, |
146 | 146 | self::ENUM, |
147 | 147 | self::INPUT_OBJECT, |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public const WRAPPING_TYPES = [ |
167 | 167 | self::NON_NULL, |
168 | - self::LIST, |
|
168 | + self::list, |
|
169 | 169 | ]; |
170 | 170 | |
171 | 171 | /** |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | self::INPUT_OBJECT, |
179 | 179 | self::INPUT_FIELD, |
180 | 180 | self::NON_NULL, |
181 | - self::LIST, |
|
181 | + self::list, |
|
182 | 182 | self::ANY, |
183 | 183 | ]; |
184 | 184 | |
@@ -188,11 +188,11 @@ discard block |
||
188 | 188 | public const ALLOWS_TO_OUTPUT = [ |
189 | 189 | self::SCALAR, |
190 | 190 | self::OBJECT, |
191 | - self::INTERFACE, |
|
191 | + self::interface, |
|
192 | 192 | self::UNION, |
193 | 193 | self::ENUM, |
194 | 194 | self::NON_NULL, |
195 | - self::LIST, |
|
195 | + self::list, |
|
196 | 196 | self::ANY, |
197 | 197 | ]; |
198 | 198 | |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | self::FLOAT, |
207 | 207 | self::ID, |
208 | 208 | self::DATE_TIME, |
209 | - self::NULL, |
|
209 | + self::null, |
|
210 | 210 | ]; |
211 | 211 | |
212 | 212 | /** |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | */ |
34 | 34 | protected function format(TypeNameInterface $name, iterable $arguments): string |
35 | 35 | { |
36 | - return $this->formatName($name) . $this->formatArguments($arguments); |
|
36 | + return $this->formatName($name).$this->formatArguments($arguments); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | /** |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | } |
50 | 50 | |
51 | 51 | if (\count($result)) { |
52 | - return 'Of' . \implode('And', $result); |
|
52 | + return 'Of'.\implode('And', $result); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | return ''; |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | $value = $argument->getValue(); |
65 | 65 | $suffix = $value instanceof TypeInvocation ? $this->formatType($value) : $this->formatArgument($value); |
66 | 66 | |
67 | - return \ucfirst($argument->getName()) . $suffix; |
|
67 | + return \ucfirst($argument->getName()).$suffix; |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | */ |
74 | 74 | protected function formatType(TypeInvocation $type): string |
75 | 75 | { |
76 | - return $this->formatName($type->getTypeName()) . $this->formatArguments($type->getArguments()); |
|
76 | + return $this->formatName($type->getTypeName()).$this->formatArguments($type->getArguments()); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | /** |