@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine\Annotation; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine\Annotation; |
6 | 6 |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine\Annotation; |
6 | 6 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine; |
6 | 6 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $typeName = $this->getTypeName($class); |
47 | 47 | $description = $this->getDescription($class); |
48 | 48 | |
49 | - $fieldGetter = function () use ($className): array { |
|
49 | + $fieldGetter = function() use ($className): array { |
|
50 | 50 | $factory = new FieldsConfigurationFactory($this->types, $this->entityManager); |
51 | 51 | $configuration = $factory->create($className); |
52 | 52 | |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | * @param ReflectionClass $class |
86 | 86 | * @return string|null |
87 | 87 | */ |
88 | - private function getDescription(ReflectionClass $class): ?string |
|
88 | + private function getDescription(ReflectionClass $class): ? string |
|
89 | 89 | { |
90 | 90 | $comment = $class->getDocComment(); |
91 | 91 |
@@ -25,7 +25,6 @@ |
||
25 | 25 | |
26 | 26 | /** |
27 | 27 | * Get the description of a method from the doc block |
28 | - * @param ReflectionMethod $method |
|
29 | 28 | * @return string|null |
30 | 29 | */ |
31 | 30 | public function getMethodDescription(): ?string |
@@ -4,7 +4,6 @@ |
||
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine; |
6 | 6 | |
7 | -use Doctrine\Common\Annotations\Reader; |
|
8 | 7 | use ReflectionMethod; |
9 | 8 | use ReflectionParameter; |
10 | 9 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine; |
6 | 6 | |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * @param ReflectionMethod $method |
29 | 29 | * @return string|null |
30 | 30 | */ |
31 | - public function getMethodDescription(): ?string |
|
31 | + public function getMethodDescription(): ? string |
|
32 | 32 | { |
33 | 33 | // Remove the comment markers |
34 | 34 | $description = preg_replace('~^\s*(/\*\*|\* ?|\*/)~m', '', $this->comment); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param ReflectionParameter $param |
48 | 48 | * @return string|null |
49 | 49 | */ |
50 | - public function getParameterDescription(ReflectionParameter $param): ?string |
|
50 | + public function getParameterDescription(ReflectionParameter $param): ? string |
|
51 | 51 | { |
52 | 52 | $name = preg_quote($param->getName()); |
53 | 53 | |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | * @param ReflectionParameter $param |
64 | 64 | * @return string|null |
65 | 65 | */ |
66 | - public function getParameterType(ReflectionParameter $param): ?string |
|
66 | + public function getParameterType(ReflectionParameter $param): ? string |
|
67 | 67 | { |
68 | 68 | $name = preg_quote($param->getName()); |
69 | 69 | |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | return null; |
75 | 75 | } |
76 | 76 | |
77 | - public function getReturnType(): ?string |
|
77 | + public function getReturnType(): ? string |
|
78 | 78 | { |
79 | 79 | if (preg_match('~@return\h+(\H+)(\h|\n)~', $this->comment, $m)) { |
80 | 80 | return trim($m[1]); |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine; |
6 | 6 | |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | * @param string|null $typeDeclaration |
147 | 147 | * @return Type|null |
148 | 148 | */ |
149 | - private function phpDeclarationToInstance(ReflectionMethod $method, ?string $typeDeclaration): ?Type |
|
149 | + private function phpDeclarationToInstance(ReflectionMethod $method, ? string $typeDeclaration) : ? Type |
|
150 | 150 | { |
151 | 151 | if (!$typeDeclaration) { |
152 | 152 | return null; |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * @throws Exception |
242 | 242 | * @return Type|null |
243 | 243 | */ |
244 | - private function getTypeFromTypeHint(ReflectionMethod $method, string $fieldName): ?Type |
|
244 | + private function getTypeFromTypeHint(ReflectionMethod $method, string $fieldName): ? Type |
|
245 | 245 | { |
246 | 246 | $returnType = $method->getReturnType(); |
247 | 247 | if (!$returnType) { |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | * @param \GraphQL\Doctrine\DocBlockReader $docBlock |
378 | 378 | * @return Type|null |
379 | 379 | */ |
380 | - private function getTypeFromDocBock(ReflectionMethod $method, DocBlockReader $docBlock): ?Type |
|
380 | + private function getTypeFromDocBock(ReflectionMethod $method, DocBlockReader $docBlock): ? Type |
|
381 | 381 | { |
382 | 382 | $typeDeclaration = $docBlock->getReturnType(); |
383 | 383 | $blacklist = [ |
@@ -398,7 +398,7 @@ discard block |
||
398 | 398 | * @param string|null $type |
399 | 399 | * @throws Exception |
400 | 400 | */ |
401 | - private function throwIfArray(ReflectionParameter $param, ?string $type) |
|
401 | + private function throwIfArray(ReflectionParameter $param, ? string $type) |
|
402 | 402 | { |
403 | 403 | if ($type === 'array') { |
404 | 404 | throw new Exception('The parameter `$' . $param->getName() . '` on method ' . $this->getMethodFullName($param->getDeclaringFunction()) . ' is type hinted as `array` and is not overriden via `@API\Argument` annotation. Either change the type hint or specify the type with `@API\Argument` annotation.'); |
@@ -66,7 +66,7 @@ |
||
66 | 66 | * Return the getter/isser method if any valid one exists |
67 | 67 | * @param mixed $source |
68 | 68 | * @param string $name |
69 | - * @return string |
|
69 | + * @return ReflectionMethod|null |
|
70 | 70 | */ |
71 | 71 | private function getGetter($source, string $name): ?ReflectionMethod |
72 | 72 | { |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -declare(strict_types=1); |
|
3 | +declare(strict_types = 1); |
|
4 | 4 | |
5 | 5 | namespace GraphQL\Doctrine; |
6 | 6 | |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | * @param string $fieldName |
38 | 38 | * @return mixed |
39 | 39 | */ |
40 | - private function resolveObject($source, ?array $args, string $fieldName) |
|
40 | + private function resolveObject($source, ? array $args, string $fieldName) |
|
41 | 41 | { |
42 | 42 | $getter = $this->getGetter($source, $fieldName); |
43 | 43 | if ($getter) { |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | * @param string $name |
69 | 69 | * @return string |
70 | 70 | */ |
71 | - private function getGetter($source, string $name): ?ReflectionMethod |
|
71 | + private function getGetter($source, string $name): ? ReflectionMethod |
|
72 | 72 | { |
73 | 73 | if (!preg_match('~^(is|has)[A-Z]~', $name)) { |
74 | 74 | $name = 'get' . ucfirst($name); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @param array $args |
92 | 92 | * @return array |
93 | 93 | */ |
94 | - private function orderArguments(ReflectionMethod $method, ?array $args): array |
|
94 | + private function orderArguments(ReflectionMethod $method, ? array $args) : array |
|
95 | 95 | { |
96 | 96 | $result = []; |
97 | 97 | foreach ($method->getParameters() as $param) { |