@@ -35,7 +35,7 @@ |
||
| 35 | 35 | */ |
| 36 | 36 | public function __construct(TypeNode $type) |
| 37 | 37 | { |
| 38 | - \assert(! $type instanceof self); |
|
| 38 | + \assert(!$type instanceof self); |
|
| 39 | 39 | |
| 40 | 40 | $this->type = $type; |
| 41 | 41 | } |
@@ -43,13 +43,13 @@ |
||
| 43 | 43 | * @var string[] |
| 44 | 44 | */ |
| 45 | 45 | protected const SPECIAL_CHARS = [ |
| 46 | - self::T_BACKSPACE => "\u{0008}", /* '\b' */ |
|
| 47 | - self::T_FORM_FEED => "\u{000C}", /* '\f' */ |
|
| 48 | - self::T_NEW_LINE => "\u{000A}", /* '\n' */ |
|
| 49 | - self::T_CARRIAGE_RETURN => "\u{000D}", /* '\r' */ |
|
| 50 | - self::T_HORIZONTAL_TAB => "\u{0009}", /* '\t' */ |
|
| 51 | - self::T_ESCAPED_QUOTE => '"', /* '\"' */ |
|
| 52 | - self::T_ESCAPED_BACK_SLASH => '\\', /* '\\' */ |
|
| 46 | + self::T_BACKSPACE => "\u{0008}", /* '\b' */ |
|
| 47 | + self::T_FORM_FEED => "\u{000C}", /* '\f' */ |
|
| 48 | + self::T_NEW_LINE => "\u{000A}", /* '\n' */ |
|
| 49 | + self::T_CARRIAGE_RETURN => "\u{000D}", /* '\r' */ |
|
| 50 | + self::T_HORIZONTAL_TAB => "\u{0009}", /* '\t' */ |
|
| 51 | + self::T_ESCAPED_QUOTE => '"', /* '\"' */ |
|
| 52 | + self::T_ESCAPED_BACK_SLASH => '\\', /* '\\' */ |
|
| 53 | 53 | ]; |
| 54 | 54 | |
| 55 | 55 | /** |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | */ |
| 64 | 64 | public static function parse(string $value): self |
| 65 | 65 | { |
| 66 | - if (! \is_numeric($value)) { |
|
| 66 | + if (!\is_numeric($value)) { |
|
| 67 | 67 | $message = 'Int cannot represent non-numeric value: %s'; |
| 68 | 68 | throw new \OverflowException(\sprintf($message, $value)); |
| 69 | 69 | } |
@@ -27,6 +27,6 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function __construct(array $items) |
| 29 | 29 | { |
| 30 | - parent::__construct(fn ($item) => $item instanceof NamedTypeNode, $items); |
|
| 30 | + parent::__construct(fn($item) => $item instanceof NamedTypeNode, $items); |
|
| 31 | 31 | } |
| 32 | 32 | } |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | { |
| 27 | 27 | $this->app->register( |
| 28 | 28 | CompilerInterface::class, |
| 29 | - fn () => |
|
| 29 | + fn() => |
|
| 30 | 30 | new Compiler(Compiler::SPEC_RAILT) |
| 31 | 31 | ); |
| 32 | 32 | } |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | public function build(iterable $ast, Document $dictionary = null): DocumentInterface |
| 156 | 156 | { |
| 157 | 157 | $registry = new Registry(); |
| 158 | - $factory = new Factory($dictionary ??= $this->document); |
|
| 158 | + $factory = new Factory($dictionary ?? = $this->document); |
|
| 159 | 159 | |
| 160 | 160 | /** |
| 161 | 161 | * First tree walk: |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | { |
| 236 | 236 | $source = File::new($source); |
| 237 | 237 | |
| 238 | - return $this->cache[$this->hash($source)] ??= $this->parser->parse($source); |
|
| 238 | + return $this->cache[$this->hash($source)] ?? = $this->parser->parse($source); |
|
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | /** |
@@ -267,7 +267,7 @@ discard block |
||
| 267 | 267 | */ |
| 268 | 268 | public function withType(NamedTypeInterface $type, bool $overwrite = false): self |
| 269 | 269 | { |
| 270 | - if ($overwrite || ! $this->document->hasType($type->getName())) { |
|
| 270 | + if ($overwrite || !$this->document->hasType($type->getName())) { |
|
| 271 | 271 | $this->document->addType($type); |
| 272 | 272 | } |
| 273 | 273 | |
@@ -279,7 +279,7 @@ discard block |
||
| 279 | 279 | */ |
| 280 | 280 | public function withDirective(DirectiveInterface $directive, bool $overwrite = false): self |
| 281 | 281 | { |
| 282 | - if ($overwrite || ! $this->document->hasDirective($directive->getName())) { |
|
| 282 | + if ($overwrite || !$this->document->hasDirective($directive->getName())) { |
|
| 283 | 283 | $this->document->addDirective($directive); |
| 284 | 284 | } |
| 285 | 285 | |
@@ -291,7 +291,7 @@ discard block |
||
| 291 | 291 | */ |
| 292 | 292 | public function withSchema(SchemaInterface $schema, bool $overwrite = false): self |
| 293 | 293 | { |
| 294 | - if ($overwrite || ! $this->document->getSchema()) { |
|
| 294 | + if ($overwrite || !$this->document->getSchema()) { |
|
| 295 | 295 | $this->document->setSchema($schema); |
| 296 | 296 | } |
| 297 | 297 | |
@@ -330,7 +330,7 @@ discard block |
||
| 330 | 330 | */ |
| 331 | 331 | public function cancelAutoload(callable $loader): self |
| 332 | 332 | { |
| 333 | - $this->loaders = \array_filter($this->loaders, static function (callable $haystack) use ($loader): bool { |
|
| 333 | + $this->loaders = \array_filter($this->loaders, static function(callable $haystack) use ($loader): bool { |
|
| 334 | 334 | return $haystack !== $loader; |
| 335 | 335 | }); |
| 336 | 336 | |
@@ -26,14 +26,14 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function enter(NodeInterface $source) |
| 28 | 28 | { |
| 29 | - if (! $source instanceof ScalarTypeExtensionNode) { |
|
| 29 | + if (!$source instanceof ScalarTypeExtensionNode) { |
|
| 30 | 30 | return; |
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | /** @var ScalarType $target */ |
| 34 | 34 | $target = $this->document->getType($source->name->value); |
| 35 | 35 | |
| 36 | - if (! $target instanceof ScalarType) { |
|
| 36 | + if (!$target instanceof ScalarType) { |
|
| 37 | 37 | // TODO should throw an error |
| 38 | 38 | return; |
| 39 | 39 | } |
@@ -27,14 +27,14 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function enter(NodeInterface $source) |
| 29 | 29 | { |
| 30 | - if (! $source instanceof ObjectTypeExtensionNode) { |
|
| 30 | + if (!$source instanceof ObjectTypeExtensionNode) { |
|
| 31 | 31 | return; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** @var ObjectType $target */ |
| 35 | 35 | $target = $this->document->getType($source->name->value); |
| 36 | 36 | |
| 37 | - if (! $target instanceof ObjectType) { |
|
| 37 | + if (!$target instanceof ObjectType) { |
|
| 38 | 38 | // TODO should throw an error |
| 39 | 39 | return; |
| 40 | 40 | } |
@@ -27,14 +27,14 @@ |
||
| 27 | 27 | */ |
| 28 | 28 | public function enter(NodeInterface $source) |
| 29 | 29 | { |
| 30 | - if (! $source instanceof InputObjectTypeExtensionNode) { |
|
| 30 | + if (!$source instanceof InputObjectTypeExtensionNode) { |
|
| 31 | 31 | return; |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | /** @var InputObjectType $target */ |
| 35 | 35 | $target = $this->document->getType($source->name->value); |
| 36 | 36 | |
| 37 | - if (! $target instanceof InputObjectType) { |
|
| 37 | + if (!$target instanceof InputObjectType) { |
|
| 38 | 38 | // TODO should throw an error |
| 39 | 39 | return; |
| 40 | 40 | } |