@@ -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 | { |
@@ -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 |
@@ -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)); |
@@ -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) { |
@@ -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 |