@@ -10,7 +10,6 @@ |
||
10 | 10 | namespace Railt\SDL\Ast\Support; |
11 | 11 | |
12 | 12 | use Railt\SDL\Ast\Common\TypeNameNode; |
13 | -use Railt\SDL\Ast\ProvidesInterfaceNodes; |
|
14 | 13 | |
15 | 14 | /** |
16 | 15 | * Trait InterfacesProvider |
@@ -15,7 +15,6 @@ |
||
15 | 15 | use Railt\Io\File; |
16 | 16 | use Railt\Io\Readable; |
17 | 17 | use Railt\Parser\Ast\RuleInterface; |
18 | -use Railt\Parser\Exception\UnexpectedTokenException; |
|
19 | 18 | use Railt\Parser\Exception\UnrecognizedTokenException; |
20 | 19 | use Railt\Reflection\Contracts\Document as DocumentInterface; |
21 | 20 | use Railt\Reflection\Contracts\Reflection as ReflectionInterface; |
@@ -108,7 +108,7 @@ |
||
108 | 108 | public function compile(Readable $file): DocumentInterface |
109 | 109 | { |
110 | 110 | try { |
111 | - return $this->memoize($file, function (Readable $file): DocumentInterface { |
|
111 | + return $this->memoize($file, function(Readable $file): DocumentInterface { |
|
112 | 112 | return $this->builder->run($this->reflection, $file, $this->parse($file)); |
113 | 113 | }); |
114 | 114 | } catch (CompilerException $e) { |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use Railt\Reflection\Definition\Behaviour\HasArguments; |
15 | 15 | use Railt\SDL\Ast\ProvidesArgumentNodes; |
16 | 16 | use Railt\SDL\Compiler\System\System; |
17 | -use Railt\SDL\Exception\TypeConflictException; |
|
18 | 17 | |
19 | 18 | /** |
20 | 19 | * Class ArgumentSystem |
@@ -29,11 +29,11 @@ |
||
29 | 29 | { |
30 | 30 | if ($ast instanceof ProvidesArgumentNodes) { |
31 | 31 | foreach ($ast->getArgumentNodes() as $child) { |
32 | - $this->deferred(function () use ($definition, $child) { |
|
32 | + $this->deferred(function() use ($definition, $child) { |
|
33 | 33 | /** @var Definition\Dependent\ArgumentDefinition $argument */ |
34 | 34 | $argument = $this->process->build($child, $definition); |
35 | 35 | |
36 | - $this->linker(function () use ($definition, $argument) { |
|
36 | + $this->linker(function() use ($definition, $argument) { |
|
37 | 37 | if ($definition->hasArgument($argument->getName())) { |
38 | 38 | throw $this->redeclareException($argument); |
39 | 39 | } |
@@ -14,7 +14,6 @@ |
||
14 | 14 | use Railt\Reflection\Definition\Behaviour\HasFields; |
15 | 15 | use Railt\SDL\Ast\ProvidesFieldNodes; |
16 | 16 | use Railt\SDL\Compiler\System\System; |
17 | -use Railt\SDL\Exception\TypeConflictException; |
|
18 | 17 | |
19 | 18 | /** |
20 | 19 | * Class FieldSystem |
@@ -29,11 +29,11 @@ |
||
29 | 29 | { |
30 | 30 | if ($ast instanceof ProvidesFieldNodes) { |
31 | 31 | foreach ($ast->getFieldNodes() as $child) { |
32 | - $this->deferred(function () use ($definition, $child) { |
|
32 | + $this->deferred(function() use ($definition, $child) { |
|
33 | 33 | /** @var Definition\Dependent\FieldDefinition $field */ |
34 | 34 | $field = $this->process->build($child, $definition); |
35 | 35 | |
36 | - $this->linker(function () use ($definition, $field) { |
|
36 | + $this->linker(function() use ($definition, $field) { |
|
37 | 37 | if ($definition->hasField($field->getName())) { |
38 | 38 | throw $this->redeclareException($field); |
39 | 39 | } |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | { |
33 | 33 | if ($definition instanceof ProvidesDirectives && $ast instanceof ProvidesDirectiveNodes) { |
34 | 34 | foreach ($ast->getDirectiveNodes() as $child) { |
35 | - $this->deferred(function () use ($definition, $child) { |
|
35 | + $this->deferred(function() use ($definition, $child) { |
|
36 | 36 | /** @var DirectiveInvocation $directive */ |
37 | 37 | $directive = $this->process->build($child, $definition); |
38 | 38 | |
39 | - $this->linker(function () use ($definition, $directive) { |
|
39 | + $this->linker(function() use ($definition, $directive) { |
|
40 | 40 | $this->validateDefinition($directive); |
41 | 41 | |
42 | 42 | $definition->withDirective($directive); |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | { |
55 | 55 | $definition = $directive->getDefinition(); |
56 | 56 | |
57 | - if (! $definition instanceof DirectiveDefinition) { |
|
57 | + if (!$definition instanceof DirectiveDefinition) { |
|
58 | 58 | $error = \sprintf('Can not use %s as directive', $definition); |
59 | 59 | throw (new TypeConflictException($error))->in($directive); |
60 | 60 | } |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | { |
31 | 31 | if ($document instanceof Document) { |
32 | 32 | foreach ($ast as $child) { |
33 | - $this->deferred(function () use ($document, $child) { |
|
33 | + $this->deferred(function() use ($document, $child) { |
|
34 | 34 | $definition = $this->process->build($child, $document); |
35 | 35 | |
36 | 36 | if ($definition instanceof TypeDefinition) { |
37 | - $this->deferred(function () use ($definition, $document) { |
|
37 | + $this->deferred(function() use ($definition, $document) { |
|
38 | 38 | if ($document->getDictionary()->has($definition->getName())) { |
39 | 39 | throw $this->redeclareException($definition); |
40 | 40 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | |
46 | 46 | |
47 | 47 | if ($definition instanceof DirectiveInvocation) { |
48 | - $this->complete(function () use ($definition, $document) { |
|
48 | + $this->complete(function() use ($definition, $document) { |
|
49 | 49 | $document->withDirective($definition); |
50 | 50 | }); |
51 | 51 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | |
56 | 56 | $definition->withModifiers($hint->getModifiers()); |
57 | 57 | |
58 | - $this->linker(function () use ($hint, $definition) { |
|
58 | + $this->linker(function() use ($hint, $definition) { |
|
59 | 59 | /** @var TypeDefinition $resolved */ |
60 | 60 | $resolved = $this->get($hint->getFullName(), $definition); |
61 | 61 | |
@@ -76,10 +76,10 @@ discard block |
||
76 | 76 | $error = null; |
77 | 77 | |
78 | 78 | switch ($behaviour) { |
79 | - case self::IS_RENDERABLE && ! $hint->isRenderable(): |
|
79 | + case self::IS_RENDERABLE && !$hint->isRenderable(): |
|
80 | 80 | $error = '%s "%s" can contain only renderable type (unions, objects, etc), but %s given'; |
81 | 81 | break; |
82 | - case self::IS_INPUTABLE && ! $hint->isInputable(): |
|
82 | + case self::IS_INPUTABLE && !$hint->isInputable(): |
|
83 | 83 | $error = '%s "%s" can contain only inputable type (inputs, scalars, etc), but %s given'; |
84 | 84 | break; |
85 | 85 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | }); |
41 | 41 | |
42 | 42 | if ($parent instanceof ObjectDefinition) { |
43 | - $this->inference(function () use ($parent) { |
|
43 | + $this->inference(function() use ($parent) { |
|
44 | 44 | foreach ($parent->getInterfaces() as $interface) { |
45 | 45 | $this->verifyFieldsInheritance($parent, $interface); |
46 | 46 | } |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | private function verifyIsInterface(Definition $parent, TypeDefinition $definition): void |
90 | 90 | { |
91 | - if (! $definition instanceof InterfaceDefinition) { |
|
91 | + if (!$definition instanceof InterfaceDefinition) { |
|
92 | 92 | $error = '%s can implement only interfaces, but %s given'; |
93 | 93 | throw new TypeConflictException(\sprintf($error, $parent, $definition)); |
94 | 94 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | private function verifySelfReferenceImplementation(ProvidesInterfaces $parent, TypeDefinition $interface): void |
117 | 117 | { |
118 | 118 | if ($parent->isImplements($parent)) { |
119 | - $error = 'Can not implement the interface %s by %s, ' . |
|
119 | + $error = 'Can not implement the interface %s by %s, '. |
|
120 | 120 | 'because it contains a reference to the already implemented type %s'; |
121 | 121 | $error = \sprintf($error, $interface, $parent, $parent); |
122 | 122 |
@@ -99,7 +99,7 @@ |
||
99 | 99 | */ |
100 | 100 | private function buildDefinition(RuleInterface $rule, DefinitionInterface $parent): DefinitionInterface |
101 | 101 | { |
102 | - if (! $rule instanceof ProvidesDefinition) { |
|
102 | + if (!$rule instanceof ProvidesDefinition) { |
|
103 | 103 | $error = \vsprintf('%s AST should implement %s interface', [ |
104 | 104 | $rule->getName(), ProvidesDefinition::class]); |
105 | 105 |