Completed
Push — master ( 8afd90...4bf010 )
by Kirill
03:48
created
src/Compiler/Ast/Dependent/ArgumentDefinitionNode.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
     }
44 44
 
45 45
     /**
46
-     * @return null|ValueInterface|NodeInterface
46
+     * @return null|NodeInterface
47 47
      */
48 48
     public function getDefaultValue(): ?ValueInterface
49 49
     {
Please login to merge, or discard this patch.
src/Compiler/Ast/Dependent/EnumValueDefinitionNode.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@
 block discarded – undo
41 41
     }
42 42
 
43 43
     /**
44
-     * @return null|ValueInterface|NodeInterface
44
+     * @return null|NodeInterface
45 45
      */
46 46
     public function getValue(): ?ValueInterface
47 47
     {
Please login to merge, or discard this patch.
src/Compiler/Ast/Dependent/InputFieldDefinitionNode.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -45,7 +45,7 @@
 block discarded – undo
45 45
     }
46 46
 
47 47
     /**
48
-     * @return null|ValueInterface|NodeInterface
48
+     * @return null|NodeInterface
49 49
      */
50 50
     public function getDefaultValue(): ?ValueInterface
51 51
     {
Please login to merge, or discard this patch.
src/Compiler/Ast/Value/InputValueNode.php 2 patches
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -48,7 +48,7 @@
 block discarded – undo
48 48
     }
49 49
 
50 50
     /**
51
-     * @return iterable|ValueInterface[]
51
+     * @return \Generator
52 52
      */
53 53
     public function getValues(): iterable
54 54
     {
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
         $result = [];
28 28
 
29 29
         foreach ($this->getValues() as $key => $value) {
30
-            $result[] = $key->getValue() . ': ' . $value->toString();
30
+            $result[] = $key->getValue().': '.$value->toString();
31 31
         }
32 32
 
33 33
         return \sprintf('{%s}', \implode(', ', $result));
Please login to merge, or discard this patch.
src/Compiler/Builder/Common/ValueBuilder.php 2 patches
Doc Comments   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
     private $type;
42 42
 
43 43
     /**
44
-     * @param TypeHint|Definition $type
44
+     * @param TypeHint $type
45 45
      */
46 46
     public function __construct(TypeHint $type)
47 47
     {
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
     }
80 80
 
81 81
     /**
82
-     * @param TypeHint|TypeDefinition $type
82
+     * @param TypeHint $type
83 83
      * @param ValueInterface|ListValueNode $value
84 84
      * @return \Traversable
85 85
      * @throws \Railt\Io\Exception\ExternalFileException
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
     }
128 128
 
129 129
     /**
130
-     * @param TypeHint|TypeDefinition $type
131
-     * @param ValueInterface|RuleInterface $value
130
+     * @param TypeHint $type
131
+     * @param ValueInterface $value
132 132
      * @return mixed
133 133
      * @throws \Railt\Io\Exception\ExternalFileException
134 134
      */
@@ -152,8 +152,8 @@  discard block
 block discarded – undo
152 152
     }
153 153
 
154 154
     /**
155
-     * @param TypeHint|TypeDefinition $type
156
-     * @param ValueInterface|RuleInterface|InputValueNode $value
155
+     * @param TypeHint $type
156
+     * @param ValueInterface $value
157 157
      * @return InputInvocation
158 158
      * @throws \Railt\Io\Exception\ExternalFileException
159 159
      */
@@ -197,8 +197,8 @@  discard block
 block discarded – undo
197 197
     }
198 198
 
199 199
     /**
200
-     * @param TypeHint|TypeDefinition|ConstantValueNode $type
201
-     * @param ValueInterface|RuleInterface $value
200
+     * @param TypeHint $type
201
+     * @param ValueInterface $value
202 202
      * @return mixed
203 203
      * @throws \Railt\Io\Exception\ExternalFileException
204 204
      */
@@ -231,8 +231,8 @@  discard block
 block discarded – undo
231 231
     }
232 232
 
233 233
     /**
234
-     * @param TypeHint|TypeDefinition $type
235
-     * @param ValueInterface|RuleInterface $value
234
+     * @param TypeHint $type
235
+     * @param ValueInterface $value
236 236
      * @return bool|float|int|mixed|null|string
237 237
      * @throws \Railt\Io\Exception\ExternalFileException
238 238
      * @throws \Railt\Reflection\Exception\TypeNotFoundException
@@ -251,7 +251,7 @@  discard block
 block discarded – undo
251 251
     }
252 252
 
253 253
     /**
254
-     * @param TypeHint|TypeDefinition $type
254
+     * @param TypeHint $type
255 255
      * @param ValueInterface $value
256 256
      * @return mixed
257 257
      * @throws \Railt\Io\Exception\ExternalFileException
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -102,7 +102,7 @@  discard block
 block discarded – undo
102 102
         /**
103 103
          * @validation <name: [Type] = Value>
104 104
          */
105
-        if (! ($value instanceof ListValueNode)) {
105
+        if (!($value instanceof ListValueNode)) {
106 106
             $error = 'Value of %s should be a List, but %s given';
107 107
             throw (new TypeConflictException(\sprintf($error, $type, $value->toString())))->throwsIn($type->getFile(),
108 108
                 $value->getOffset());
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
         /**
163 163
          * @validation <name: InputType = Value>
164 164
          */
165
-        if (! ($value instanceof InputValueNode)) {
165
+        if (!($value instanceof InputValueNode)) {
166 166
             $error = 'Value of %s should be a %s, but %s given';
167 167
             throw (new TypeConflictException(\sprintf($error, $type, $type->getDefinition(),
168 168
                 $value->toString())))->throwsIn($type->getFile(), $value->getOffset());
@@ -184,7 +184,7 @@  discard block
 block discarded – undo
184 184
             /**
185 185
              * @validation <name: InputType = {nonExistentField: Value}>
186 186
              */
187
-            if (! $definition->hasField($name)) {
187
+            if (!$definition->hasField($name)) {
188 188
                 $error = 'Input field "%s" does not provided by %s, but %s given';
189 189
                 throw (new TypeConflictException(\sprintf($error, $name, $type->getDefinition(),
190 190
                     $value->toString())))->throwsIn($type->getFile(), $value->getOffset());
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
         /**
208 208
          * @validation <name: Enum = "NotEnumValue">
209 209
          */
210
-        if (! ($value instanceof ConstantValueNode)) {
210
+        if (!($value instanceof ConstantValueNode)) {
211 211
             $error = 'Value of %s can be one of %s value, but %s given';
212 212
             throw (new TypeConflictException(\sprintf($error, $type, $type->getDefinition(),
213 213
                 $value->toString())))->throwsIn($type->getFile(), $value->getOffset());
@@ -221,7 +221,7 @@  discard block
 block discarded – undo
221 221
         /**
222 222
          * @validation <name: Enum = NonExistentValue>
223 223
          */
224
-        if (! $definition->hasValue($name)) {
224
+        if (!$definition->hasValue($name)) {
225 225
             $error = 'Enum %s does not provide value %s';
226 226
             throw (new TypeConflictException(\sprintf($error, $type->getDefinition(), $value->toString())))
227 227
                 ->throwsIn($type->getFile(), $value->getOffset());
Please login to merge, or discard this patch.
src/Compiler/Builder/Common/ValueTypeResolver.php 3 patches
Doc Comments   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
 
100 100
     /**
101 101
      * @param mixed $value
102
-     * @return iterable|TypeDefinition[]
102
+     * @return \Generator
103 103
      * @throws \Railt\Reflection\Exception\TypeNotFoundException
104 104
      */
105 105
     public function resolveType($value): iterable
@@ -139,7 +139,7 @@  discard block
 block discarded – undo
139 139
     /**
140 140
      * @param TypeDefinition $type
141 141
      * @param \Closure $filter
142
-     * @return \Generator|TypeDefinition[]
142
+     * @return \Generator
143 143
      */
144 144
     private function getFilteredChildrenInheritance(TypeDefinition $type, \Closure $filter): \Traversable
145 145
     {
Please login to merge, or discard this patch.
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -9,7 +9,6 @@
 block discarded – undo
9 9
 
10 10
 namespace Railt\SDL\Compiler\Builder\Common;
11 11
 
12
-use Railt\Reflection\Contracts\Definition\Behaviour\ProvidesTypeIndication;
13 12
 use Railt\Reflection\Contracts\Definition\ScalarDefinition;
14 13
 use Railt\Reflection\Contracts\Definition\TypeDefinition;
15 14
 use Railt\Reflection\Contracts\Dictionary;
Please login to merge, or discard this patch.
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     private function getFilter(): \Closure
124 124
     {
125
-        return function (TypeDefinition $resolved): bool {
125
+        return function(TypeDefinition $resolved): bool {
126 126
             return $this->shouldBreak($resolved);
127 127
         };
128 128
     }
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
      */
134 134
     private function shouldBreak(TypeDefinition $resolved): bool
135 135
     {
136
-        return ! isset($this->breakpoints[$resolved->getName()]);
136
+        return !isset($this->breakpoints[$resolved->getName()]);
137 137
     }
138 138
 
139 139
     /**
@@ -146,7 +146,7 @@  discard block
 block discarded – undo
146 146
         yield $type;
147 147
 
148 148
         foreach ($type->getChildrenInheritance() as $child) {
149
-            if (! $filter($child)) {
149
+            if (!$filter($child)) {
150 150
                 continue;
151 151
             }
152 152
 
Please login to merge, or discard this patch.
src/Compiler/Builder/Invocation/DirectiveBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
             /** @var DirectiveDefinition $definition */
38 38
             $definition = $directive->getDefinition();
39 39
 
40
-            if (! ($definition instanceof Definition\DirectiveDefinition)) {
40
+            if (!($definition instanceof Definition\DirectiveDefinition)) {
41 41
                 $error = '%s should be a Directive, but %s given';
42 42
                 throw (new TypeConflictException(\sprintf($error, $directive, $definition)))
43 43
                     ->throwsIn($directive->getFile(), $rule->getOffset());
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
             foreach ($rule->getDirectiveArguments() as $ast) {
48 48
                 $name = $ast->getArgumentName();
49 49
 
50
-                if (! $definition->hasArgument($name)) {
50
+                if (!$definition->hasArgument($name)) {
51 51
                     $error = 'Directive %s does not provide argument %s';
52 52
                     throw (new TypeConflictException(\sprintf($error, $definition, $name)))
53 53
                         ->throwsIn($directive->getFile(), $ast->getOffset());
Please login to merge, or discard this patch.
src/Compiler/Builder/Definition/ScalarBuilder.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -32,11 +32,11 @@  discard block
 block discarded – undo
32 32
         $scalar->withOffset($rule->getOffset());
33 33
         $scalar->withDescription($rule->getDescription());
34 34
 
35
-        $this->when->resolving(function () use ($rule, $scalar) {
35
+        $this->when->resolving(function() use ($rule, $scalar) {
36 36
             if ($ast = $rule->getExtends()) {
37 37
                 $parent = $this->load($ast->getTypeName(), $scalar);
38 38
 
39
-                if (! ($parent instanceof Definition\ScalarDefinition)) {
39
+                if (!($parent instanceof Definition\ScalarDefinition)) {
40 40
                     $error = '%s can extends only Scalar type, but %s given';
41 41
                     throw (new TypeConflictException(\sprintf($error, $scalar, $parent)))
42 42
                         ->throwsIn($scalar->getFile(), $rule->getOffset());
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             }
47 47
         });
48 48
 
49
-        $this->when->runtime(function () use ($rule, $scalar) {
49
+        $this->when->runtime(function() use ($rule, $scalar) {
50 50
             foreach ($rule->getDirectives() as $ast) {
51 51
                 $scalar->withDirective($this->dependent($ast, $scalar));
52 52
             }
Please login to merge, or discard this patch.
src/Compiler/Builder/Definition/InterfaceBuilder.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -37,13 +37,13 @@
 block discarded – undo
37 37
             $interface->withField($this->dependent($ast, $interface));
38 38
         }
39 39
 
40
-        $this->when->runtime(function () use ($rule, $interface) {
40
+        $this->when->runtime(function() use ($rule, $interface) {
41 41
             foreach ($rule->getDirectives() as $ast) {
42 42
                 $interface->withDirective($this->dependent($ast, $interface));
43 43
             }
44 44
         });
45 45
 
46
-        $this->when->resolving(function () use ($rule, $interface) {
46
+        $this->when->resolving(function() use ($rule, $interface) {
47 47
             foreach ($rule->getImplementations() as $child) {
48 48
                 $interface->withInterface($child->getTypeName());
49 49
             }
Please login to merge, or discard this patch.