@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | */ |
8 | 8 | declare(strict_types=1); |
9 | 9 | |
10 | -if (! \function_exists('\\sdl')) { |
|
10 | +if (!\function_exists('\\sdl')) { |
|
11 | 11 | /** |
12 | 12 | * @param string $fileOrSources |
13 | 13 | * @param bool $filename |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | } |
26 | 26 | |
27 | 27 | |
28 | -if (! \function_exists('trait_uses_recursive')) { |
|
28 | +if (!\function_exists('trait_uses_recursive')) { |
|
29 | 29 | /** |
30 | 30 | * Returns all traits used by a trait and its traits. |
31 | 31 | * |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | -if (! \function_exists('class_uses_recursive')) { |
|
48 | +if (!\function_exists('class_uses_recursive')) { |
|
49 | 49 | /** |
50 | 50 | * Returns all traits used by a class, its parent classes and trait of their traits. |
51 | 51 | * |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | } |
70 | 70 | |
71 | 71 | |
72 | -if (! \function_exists('class_basename')) { |
|
72 | +if (!\function_exists('class_basename')) { |
|
73 | 73 | /** |
74 | 74 | * Get the class "basename" of the given object / class. |
75 | 75 | * |
@@ -52,7 +52,7 @@ |
||
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | - * @param RuleInterface|NodeInterface $rule |
|
55 | + * @param null|NodeInterface $rule |
|
56 | 56 | * @return \Generator |
57 | 57 | */ |
58 | 58 | private function analyze(RuleInterface $rule): \Generator |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function isList(): bool |
72 | 72 | { |
73 | - return (bool)($this->modifiers & Hint::IS_LIST); |
|
73 | + return (bool) ($this->modifiers & Hint::IS_LIST); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function isNonNull(): bool |
80 | 80 | { |
81 | - return (bool)($this->modifiers & Hint::IS_NOT_NULL); |
|
81 | + return (bool) ($this->modifiers & Hint::IS_NOT_NULL); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function isListOfNonNulls(): bool |
88 | 88 | { |
89 | - return (bool)($this->modifiers & Hint::IS_LIST_OF_NOT_NULL); |
|
89 | + return (bool) ($this->modifiers & Hint::IS_LIST_OF_NOT_NULL); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -18,7 +18,7 @@ |
||
18 | 18 | trait ArgumentsProvider |
19 | 19 | { |
20 | 20 | /** |
21 | - * @return iterable|ArgumentDefinitionNode[] |
|
21 | + * @return \Generator |
|
22 | 22 | */ |
23 | 23 | public function getArgumentNodes(): iterable |
24 | 24 | { |
@@ -17,7 +17,7 @@ |
||
17 | 17 | trait DirectivesProvider |
18 | 18 | { |
19 | 19 | /** |
20 | - * @return iterable|DirectiveInvocationNode[] |
|
20 | + * @return \Generator |
|
21 | 21 | */ |
22 | 22 | public function getDirectiveNodes(): iterable |
23 | 23 | { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | trait FieldsProvider |
19 | 19 | { |
20 | 20 | /** |
21 | - * @return iterable|FieldDefinitionNode[] |
|
21 | + * @return \Generator |
|
22 | 22 | */ |
23 | 23 | public function getFieldNodes(): iterable |
24 | 24 | { |
@@ -18,7 +18,7 @@ |
||
18 | 18 | trait InterfacesProvider |
19 | 19 | { |
20 | 20 | /** |
21 | - * @return iterable|TypeNameNode[] |
|
21 | + * @return \Generator |
|
22 | 22 | */ |
23 | 23 | public function getInterfaceNodes(): iterable |
24 | 24 | { |
@@ -48,7 +48,7 @@ |
||
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
51 | - * @return iterable|ValueInterface[] |
|
51 | + * @return \Generator |
|
52 | 52 | */ |
53 | 53 | public function getValues(): iterable |
54 | 54 | { |
@@ -27,7 +27,7 @@ |
||
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)); |
@@ -92,7 +92,7 @@ |
||
92 | 92 | } |
93 | 93 | |
94 | 94 | /** |
95 | - * @param ProvidesDefinition|RuleInterface $rule |
|
95 | + * @param RuleInterface $rule |
|
96 | 96 | * @param DefinitionInterface $parent |
97 | 97 | * @return DefinitionInterface |
98 | 98 | * @throws CompilerException |
@@ -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 |
@@ -27,8 +27,8 @@ discard block |
||
27 | 27 | class ImplementationSystem extends System |
28 | 28 | { |
29 | 29 | /** |
30 | - * @param Definition|ProvidesInterfaces|HasInterfaces $parent |
|
31 | - * @param RuleInterface|ProvidesInterfaceNodes $ast |
|
30 | + * @param Definition $parent |
|
31 | + * @param RuleInterface $ast |
|
32 | 32 | */ |
33 | 33 | public function resolve(Definition $parent, RuleInterface $ast): void |
34 | 34 | { |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
53 | - * @param ProvidesInterfaces|HasInterfaces|TypeDefinition $parent |
|
53 | + * @param ProvidesInterfaces $parent |
|
54 | 54 | * @param TypeNameNode $ast |
55 | 55 | * @throws \Railt\Io\Exception\ExternalFileException |
56 | 56 | * @throws \Railt\Reflection\Exception\TypeNotFoundException |
@@ -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 |