@@ -20,7 +20,7 @@ |
||
20 | 20 | * @param VarSymbolInterface $record |
21 | 21 | * @return int |
22 | 22 | */ |
23 | - public function declare(VarSymbolInterface $record): int; |
|
23 | + public function declare(VarSymbolInterface$record): int; |
|
24 | 24 | |
25 | 25 | /** |
26 | 26 | * @param int $addr |
@@ -28,6 +28,6 @@ |
||
28 | 28 | */ |
29 | 29 | public function __toString(): string |
30 | 30 | { |
31 | - return '[' . $this->of . ']'; |
|
31 | + return '['.$this->of.']'; |
|
32 | 32 | } |
33 | 33 | } |
@@ -50,7 +50,7 @@ |
||
50 | 50 | protected static function getInternalType(string $name, ?TypeInterface $of, \Closure $otherwise): TypeInterface |
51 | 51 | { |
52 | 52 | if (isset(static::$internal[$name])) { |
53 | - $subtypeOfInternal = ! $of || $of->typeOf(static::$internal[$name]); |
|
53 | + $subtypeOfInternal = !$of || $of->typeOf(static::$internal[$name]); |
|
54 | 54 | |
55 | 55 | return $subtypeOfInternal ? static::$internal[$name] : $otherwise(); |
56 | 56 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | { |
23 | 23 | parent::__construct(static::NON_NULL, $parent); |
24 | 24 | |
25 | - \assert(! $this->is($parent), __CLASS__ . ' can not be wrapped by itself'); |
|
25 | + \assert(!$this->is($parent), __CLASS__.' can not be wrapped by itself'); |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | /** |
@@ -30,6 +30,6 @@ discard block |
||
30 | 30 | */ |
31 | 31 | public function __toString(): string |
32 | 32 | { |
33 | - return $this->of . '!'; |
|
33 | + return $this->of.'!'; |
|
34 | 34 | } |
35 | 35 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | |
104 | 104 | $fqn = Name::new($name)->getFullyQualifiedName(); |
105 | 105 | |
106 | - return self::getInternalType($fqn, $of, function () use ($name, $of): TypeInterface { |
|
106 | + return self::getInternalType($fqn, $of, function() use ($name, $of): TypeInterface { |
|
107 | 107 | return new static($name, $of); |
108 | 108 | }); |
109 | 109 | } |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | */ |
115 | 115 | public function of(TypeInterface $of): TypeInterface |
116 | 116 | { |
117 | - \assert(! $this->isInternal(), 'Can not change inheritance logic of internal types'); |
|
117 | + \assert(!$this->isInternal(), 'Can not change inheritance logic of internal types'); |
|
118 | 118 | |
119 | 119 | return static::new($this->type, $of); |
120 | 120 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | { |
150 | 150 | yield $type; |
151 | 151 | |
152 | - if (! $type->getName()->is(static::ROOT_TYPE)) { |
|
152 | + if (!$type->getName()->is(static::ROOT_TYPE)) { |
|
153 | 153 | yield from $this->getInheritanceSequence($type->getParent()); |
154 | 154 | } |
155 | 155 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | public function isInputable(): bool |
161 | 161 | { |
162 | 162 | if ($this->inputable === null) { |
163 | - if ($this->isBuiltin() && ! \in_array($this->fqn(), static::ALLOWS_TO_INPUT, true)) { |
|
163 | + if ($this->isBuiltin() && !\in_array($this->fqn(), static::ALLOWS_TO_INPUT, true)) { |
|
164 | 164 | return $this->inputable = false; |
165 | 165 | } |
166 | 166 | |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | public function isReturnable(): bool |
218 | 218 | { |
219 | 219 | if ($this->returnable === null) { |
220 | - if ($this->isBuiltin() && ! \in_array($this->fqn(), static::ALLOWS_TO_OUTPUT, true)) { |
|
220 | + if ($this->isBuiltin() && !\in_array($this->fqn(), static::ALLOWS_TO_OUTPUT, true)) { |
|
221 | 221 | return $this->returnable = false; |
222 | 222 | } |
223 | 223 | |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | if ($this->hash === null) { |
271 | 271 | $this->hash = $this->fqn() === self::ROOT_TYPE |
272 | 272 | ? \sha1($this->fqn()) |
273 | - : \sha1($this->fqn() . ':' . $this->of->getHash()); |
|
273 | + : \sha1($this->fqn().':'.$this->of->getHash()); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | return $this->hash; |
@@ -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 [ |
@@ -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)'; |
@@ -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 | /** |