@@ -48,7 +48,7 @@ |
||
48 | 48 | */ |
49 | 49 | protected function verified(string $name): string |
50 | 50 | { |
51 | - if (! \preg_match('/^[_a-zA-Z][_a-zA-Z0-9]*$/', $name)) { |
|
51 | + if (!\preg_match('/^[_a-zA-Z][_a-zA-Z0-9]*$/', $name)) { |
|
52 | 52 | $error = \sprintf('Names must match /^[_a-zA-Z][_a-zA-Z0-9]*$/ but "%s" does not.', $name); |
53 | 53 | throw new SemanticException($error); |
54 | 54 | } |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function offsetExists($offset): bool |
151 | 151 | { |
152 | - return $this->has((string)$offset); |
|
152 | + return $this->has((string) $offset); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function offsetGet($offset) |
160 | 160 | { |
161 | - return $this->get((string)$offset); |
|
161 | + return $this->get((string) $offset); |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function offsetSet($offset, $value): void |
169 | 169 | { |
170 | - $this->set((string)$offset, $value); |
|
170 | + $this->set((string) $offset, $value); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -175,6 +175,6 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function offsetUnset($offset): void |
177 | 177 | { |
178 | - $this->delete((string)$offset); |
|
178 | + $this->delete((string) $offset); |
|
179 | 179 | } |
180 | 180 | } |
@@ -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 | } |
@@ -57,19 +57,19 @@ |
||
57 | 57 | { |
58 | 58 | switch (true) { |
59 | 59 | case $name === null || !$name: |
60 | - return static::empty((bool)$global); |
|
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)'; |
@@ -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; |
@@ -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 | } |