Completed
Push — master ( 3aac06...366db0 )
by Adrien
01:53
created
src/Factory/InputFieldsConfigurationFactory.php 2 patches
Unused Use Statements   -1 removed lines patch added patch discarded remove patch
@@ -6,7 +6,6 @@
 block discarded – undo
6 6
 
7 7
 use GraphQL\Doctrine\Annotation\Input;
8 8
 use GraphQL\Doctrine\DocBlockReader;
9
-use GraphQL\Doctrine\Types;
10 9
 use GraphQL\Type\Definition\Type;
11 10
 use ReflectionMethod;
12 11
 
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace GraphQL\Doctrine\Factory;
6 6
 
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
      * @param ReflectionMethod $method
26 26
      * @return array
27 27
      */
28
-    protected function methodToConfiguration(ReflectionMethod $method): ?array
28
+    protected function methodToConfiguration(ReflectionMethod $method): ? array
29 29
     {
30 30
         // Silently ignore setter with anything than exactly 1 parameter
31 31
         $params = $method->getParameters();
Please login to merge, or discard this patch.
src/Factory/InputTypeFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace GraphQL\Doctrine\Factory;
6 6
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $typeName = Utils::getInputTypeName($className);
24 24
         $description = $this->getDescription($className);
25 25
 
26
-        $fieldGetter = function () use ($className): array {
26
+        $fieldGetter = function() use ($className): array {
27 27
             $factory = new InputFieldsConfigurationFactory($this->types, $this->entityManager);
28 28
             $configuration = $factory->create($className);
29 29
 
Please login to merge, or discard this patch.
src/Factory/ObjectTypeFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace GraphQL\Doctrine\Factory;
6 6
 
@@ -23,7 +23,7 @@  discard block
 block discarded – undo
23 23
         $typeName = Utils::getTypeName($className);
24 24
         $description = $this->getDescription($className);
25 25
 
26
-        $fieldGetter = function () use ($className): array {
26
+        $fieldGetter = function() use ($className): array {
27 27
             $factory = new OutputFieldsConfigurationFactory($this->types, $this->entityManager);
28 28
             $configuration = $factory->create($className);
29 29
 
Please login to merge, or discard this patch.
src/Factory/AbstractTypeFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace GraphQL\Doctrine\Factory;
6 6
 
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
      * @param string $className
42 42
      * @return string|null
43 43
      */
44
-    protected function getDescription(string $className): ?string
44
+    protected function getDescription(string $className): ? string
45 45
     {
46 46
         $class = new \ReflectionClass($className);
47 47
 
Please login to merge, or discard this patch.
src/Factory/AbstractFieldsConfigurationFactory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace GraphQL\Doctrine\Factory;
6 6
 
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
      * @param ReflectionMethod $method
64 64
      * @return array
65 65
      */
66
-    abstract protected function methodToConfiguration(ReflectionMethod $method): ?array;
66
+    abstract protected function methodToConfiguration(ReflectionMethod $method): ? array;
67 67
 
68 68
     /**
69 69
      * Create a configuration for all fields of Doctrine entity
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
      * @param bool $isEntityId
143 143
      * @return Type|null
144 144
      */
145
-    protected function getTypeFromPhpDeclaration(ReflectionMethod $method, ?string $typeDeclaration, bool $isEntityId = false): ?Type
145
+    protected function getTypeFromPhpDeclaration(ReflectionMethod $method, ? string $typeDeclaration, bool $isEntityId = false) : ? Type
146 146
     {
147 147
         if (!$typeDeclaration) {
148 148
             return null;
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      * @throws Exception
192 192
      * @return Type|null
193 193
      */
194
-    protected function getTypeFromReturnTypeHint(ReflectionMethod $method, string $fieldName): ?Type
194
+    protected function getTypeFromReturnTypeHint(ReflectionMethod $method, string $fieldName): ? Type
195 195
     {
196 196
         $returnType = $method->getReturnType();
197 197
         if (!$returnType) {
@@ -262,7 +262,7 @@  discard block
 block discarded – undo
262 262
      * @param string|null $type
263 263
      * @throws Exception
264 264
      */
265
-    protected function throwIfArray(ReflectionParameter $param, ?string $type)
265
+    protected function throwIfArray(ReflectionParameter $param, ? string $type)
266 266
     {
267 267
         if ($type === 'array') {
268 268
             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.');
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
      * @param string $fieldName
285 285
      * @return string|null
286 286
      */
287
-    private function getTargetEntity(string $fieldName): ?string
287
+    private function getTargetEntity(string $fieldName): ? string
288 288
     {
289 289
         return $this->metadata->associationMappings[$fieldName]['targetEntity'] ?? null;
290 290
     }
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
      * @param Type $type
311 311
      * @return Type
312 312
      */
313
-    protected function nonNullIfHasDefault(ReflectionParameter $param, ?Type $type): ?Type
313
+    protected function nonNullIfHasDefault(ReflectionParameter $param, ? Type $type) : ? Type
314 314
     {
315 315
         if ($type instanceof NonNull && $param->isDefaultValueAvailable()) {
316 316
             return $type->getWrappedType();
@@ -325,7 +325,7 @@  discard block
 block discarded – undo
325 325
      * @param Type $type
326 326
      * @throws Exception
327 327
      */
328
-    protected function throwIfNotInputType(ReflectionParameter $param, ?Type $type, string $annotation)
328
+    protected function throwIfNotInputType(ReflectionParameter $param, ? Type $type, string $annotation)
329 329
     {
330 330
         if (!$type) {
331 331
             throw new Exception('Could not find type for parameter `$' . $param->name . '` for method ' . $this->getMethodFullName($param->getDeclaringFunction()) . '. Either type hint the parameter, or specify the type with `@API\\' . $annotation . '` annotation.');
Please login to merge, or discard this patch.
src/Factory/OutputFieldsConfigurationFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace GraphQL\Doctrine\Factory;
6 6
 
@@ -28,7 +28,7 @@  discard block
 block discarded – undo
28 28
      * @throws Exception
29 29
      * @return array
30 30
      */
31
-    protected function methodToConfiguration(ReflectionMethod $method): ?array
31
+    protected function methodToConfiguration(ReflectionMethod $method): ? array
32 32
     {
33 33
         // First get user specified values
34 34
         $field = $this->getFieldFromAnnotation($method);
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
159 159
      * @param \GraphQL\Doctrine\DocBlockReader $docBlock
160 160
      * @return Type|null
161 161
      */
162
-    private function getTypeFromDocBock(ReflectionMethod $method, DocBlockReader $docBlock): ?Type
162
+    private function getTypeFromDocBock(ReflectionMethod $method, DocBlockReader $docBlock): ? Type
163 163
     {
164 164
         $typeDeclaration = $docBlock->getReturnType();
165 165
         $blacklist = [
Please login to merge, or discard this patch.
src/DocBlockReader.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,6 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 
3
-declare(strict_types=1);
3
+declare(strict_types = 1);
4 4
 
5 5
 namespace GraphQL\Doctrine;
6 6
 
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
      * @param ReflectionMethod $method
28 28
      * @return string|null
29 29
      */
30
-    public function getMethodDescription(): ?string
30
+    public function getMethodDescription(): ? string
31 31
     {
32 32
         // Remove the comment markers
33 33
         $description = preg_replace('~\*/$~', '', $this->comment);
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
      * Get the return type
79 79
      * @return string|null
80 80
      */
81
-    public function getReturnType(): ?string
81
+    public function getReturnType(): ? string
82 82
     {
83 83
         if (preg_match('~@return\h+(\H+)(\h|\n)~', $this->comment, $m)) {
84 84
             return trim($m[1]);
Please login to merge, or discard this patch.