Passed
Pull Request — main (#133)
by Tom
03:04
created
src/Resolve/ResolveCollectionFactory.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     public function get(Entity $entity): Closure
59 59
     {
60
-        return function ($source, array $args, $context, ResolveInfo $info) {
60
+        return function($source, array $args, $context, ResolveInfo $info) {
61 61
             $fieldResolver = $this->fieldResolver;
62 62
             $collection    = $fieldResolver($source, $args, $context, $info);
63 63
 
@@ -118,7 +118,7 @@  discard block
 block discarded – undo
118 118
             }
119 119
         }
120 120
 
121
-        if (! empty($orderBy)) {
121
+        if (!empty($orderBy)) {
122 122
             $criteria->orderBy($orderBy);
123 123
         }
124 124
 
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
         array $pagination,
135 135
         PersistentCollection $collection,
136 136
         Criteria $criteria,
137
-        string|null $filterCriteriaEventName,
137
+        string | null $filterCriteriaEventName,
138 138
         mixed ...$resolve,
139 139
     ): array {
140 140
         $paginationFields = [
@@ -224,7 +224,7 @@  discard block
 block discarded – undo
224 224
                 'cursor' => $cursors['last'],
225 225
             ];
226 226
 
227
-            if (! $cursors['first']) {
227
+            if (!$cursors['first']) {
228 228
                 $cursors['first'] = $cursors['last'];
229 229
             }
230 230
 
@@ -267,7 +267,7 @@  discard block
 block discarded – undo
267 267
             $offset = 0;
268 268
         }
269 269
 
270
-        if ($paginationFields['last'] && ! $paginationFields['before']) {
270
+        if ($paginationFields['last'] && !$paginationFields['before']) {
271 271
             $offset = $itemCount - $paginationFields['last'];
272 272
         }
273 273
 
Please login to merge, or discard this patch.
src/Resolve/ResolveEntityFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -31,7 +31,7 @@  discard block
 block discarded – undo
31 31
 
32 32
     public function get(Entity $entity, string $eventName): Closure
33 33
     {
34
-        return function ($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) {
34
+        return function($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) {
35 35
             $entityClass = $entity->getEntityClass();
36 36
 
37 37
             $queryBuilderFilter = (new Applicator($this->entityManager, $entityClass))
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
         $itemCount = $paginator->count();
187 187
 
188 188
         // Rebuild paginator if needed
189
-        if ($paginationFields['last'] && ! $paginationFields['before']) {
189
+        if ($paginationFields['last'] && !$paginationFields['before']) {
190 190
             $offsetAndLimit['offset'] = $itemCount - $paginationFields['last'];
191 191
             $queryBuilder->setFirstResult($offsetAndLimit['offset']);
192 192
             $paginator = new Paginator($queryBuilder->getQuery());
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
                 'cursor' => $cursors['last'],
201 201
             ];
202 202
 
203
-            if (! $cursors['first']) {
203
+            if (!$cursors['first']) {
204 204
                 $cursors['first'] = $cursors['last'];
205 205
             }
206 206
 
Please login to merge, or discard this patch.
src/Attribute/Entity.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
     private bool $byValue;
19 19
 
20 20
     /** @var string|null Documentation for the entity within GraphQL */
21
-    private string|null $description = null;
21
+    private string | null $description = null;
22 22
 
23 23
     /**
24 24
      * @var mixed[] An array of filters as
@@ -37,10 +37,10 @@  discard block
 block discarded – undo
37 37
     public function __construct(
38 38
         string $group = 'default',
39 39
         bool $byValue = true,
40
-        string|null $description = null,
41
-        private string|null $typeName = null,
40
+        string | null $description = null,
41
+        private string | null $typeName = null,
42 42
         array $filters = [],
43
-        private string|null $namingStrategy = null,
43
+        private string | null $namingStrategy = null,
44 44
         private array $excludeCriteria = [],
45 45
         private array $includeCriteria = [],
46 46
     ) {
@@ -50,7 +50,7 @@  discard block
 block discarded – undo
50 50
         $this->filters     = $filters;
51 51
     }
52 52
 
53
-    public function getGroup(): string|null
53
+    public function getGroup(): string | null
54 54
     {
55 55
         return $this->group;
56 56
     }
@@ -60,12 +60,12 @@  discard block
 block discarded – undo
60 60
         return $this->byValue;
61 61
     }
62 62
 
63
-    public function getDescription(): string|null
63
+    public function getDescription(): string | null
64 64
     {
65 65
         return $this->description;
66 66
     }
67 67
 
68
-    public function getTypeName(): string|null
68
+    public function getTypeName(): string | null
69 69
     {
70 70
         return $this->typeName;
71 71
     }
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
         return $this->filters;
77 77
     }
78 78
 
79
-    public function getNamingStrategy(): string|null
79
+    public function getNamingStrategy(): string | null
80 80
     {
81 81
         return $this->namingStrategy;
82 82
     }
Please login to merge, or discard this patch.
src/Attribute/Association.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,11 +17,11 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function __construct(
19 19
         protected string $group = 'default',
20
-        protected string|null $strategy = null,
21
-        protected string|null $description = null,
20
+        protected string | null $strategy = null,
21
+        protected string | null $description = null,
22 22
         protected array $excludeCriteria = [],
23 23
         protected array $includeCriteria = [],
24
-        protected string|null $filterCriteriaEventName = null,
24
+        protected string | null $filterCriteriaEventName = null,
25 25
     ) {
26 26
     }
27 27
 
@@ -30,17 +30,17 @@  discard block
 block discarded – undo
30 30
         return $this->group;
31 31
     }
32 32
 
33
-    public function getStrategy(): string|null
33
+    public function getStrategy(): string | null
34 34
     {
35 35
         return $this->strategy;
36 36
     }
37 37
 
38
-    public function getDescription(): string|null
38
+    public function getDescription(): string | null
39 39
     {
40 40
         return $this->description;
41 41
     }
42 42
 
43
-    public function getFilterCriteriaEventName(): string|null
43
+    public function getFilterCriteriaEventName(): string | null
44 44
     {
45 45
         return $this->filterCriteriaEventName;
46 46
     }
Please login to merge, or discard this patch.
src/Attribute/Field.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,9 +17,9 @@  discard block
 block discarded – undo
17 17
      */
18 18
     public function __construct(
19 19
         protected string $group = 'default',
20
-        protected string|null $strategy = null,
21
-        protected string|null $description = null,
22
-        protected string|null $type = null,
20
+        protected string | null $strategy = null,
21
+        protected string | null $description = null,
22
+        protected string | null $type = null,
23 23
         private array $excludeCriteria = [],
24 24
         private array $includeCriteria = [],
25 25
     ) {
@@ -30,17 +30,17 @@  discard block
 block discarded – undo
30 30
         return $this->group;
31 31
     }
32 32
 
33
-    public function getStrategy(): string|null
33
+    public function getStrategy(): string | null
34 34
     {
35 35
         return $this->strategy;
36 36
     }
37 37
 
38
-    public function getDescription(): string|null
38
+    public function getDescription(): string | null
39 39
     {
40 40
         return $this->description;
41 41
     }
42 42
 
43
-    public function getType(): string|null
43
+    public function getType(): string | null
44 44
     {
45 45
         return $this->type;
46 46
     }
Please login to merge, or discard this patch.
src/Config.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
      *                  Be warned, using the same groupSuffix with two different
21 21
      *                  groups can cause collisions.
22 22
      */
23
-    protected string|null $groupSuffix = null;
23
+    protected string | null $groupSuffix = null;
24 24
 
25 25
     /**
26 26
      * @var bool When set to true hydrator results will be cached for the
@@ -48,14 +48,14 @@  discard block
 block discarded – undo
48 48
      *                all hydrators will extract by reference.  This overrides
49 49
      *                per-entity attribute configuration.
50 50
      */
51
-    protected bool|null $globalByValue = null;
51
+    protected bool | null $globalByValue = null;
52 52
 
53 53
     /**
54 54
      * @var string|null When set, the entityPrefix will be removed from each
55 55
      *                  type name.  This simplifies type names and makes reading
56 56
      *                  the GraphQL documentation easier.
57 57
      */
58
-    protected string|null $entityPrefix = null;
58
+    protected string | null $entityPrefix = null;
59 59
 
60 60
     /** @param mixed[] $config */
61 61
     public function __construct(array $config = [])
@@ -82,14 +82,14 @@  discard block
 block discarded – undo
82 82
         return $this->group;
83 83
     }
84 84
 
85
-    protected function setGroupSuffix(string|null $groupSuffix): self
85
+    protected function setGroupSuffix(string | null $groupSuffix): self
86 86
     {
87 87
         $this->groupSuffix = $groupSuffix;
88 88
 
89 89
         return $this;
90 90
     }
91 91
 
92
-    public function getGroupSuffix(): string|null
92
+    public function getGroupSuffix(): string | null
93 93
     {
94 94
         return $this->groupSuffix;
95 95
     }
@@ -144,26 +144,26 @@  discard block
 block discarded – undo
144 144
         return $this->globalIgnore;
145 145
     }
146 146
 
147
-    protected function setGlobalByValue(bool|null $globalByValue): self
147
+    protected function setGlobalByValue(bool | null $globalByValue): self
148 148
     {
149 149
         $this->globalByValue = $globalByValue;
150 150
 
151 151
         return $this;
152 152
     }
153 153
 
154
-    public function getGlobalByValue(): bool|null
154
+    public function getGlobalByValue(): bool | null
155 155
     {
156 156
         return $this->globalByValue;
157 157
     }
158 158
 
159
-    protected function setEntityPrefix(string|null $entityPrefix): self
159
+    protected function setEntityPrefix(string | null $entityPrefix): self
160 160
     {
161 161
         $this->entityPrefix = $entityPrefix;
162 162
 
163 163
         return $this;
164 164
     }
165 165
 
166
-    public function getEntityPrefix(): string|null
166
+    public function getEntityPrefix(): string | null
167 167
     {
168 168
         return $this->entityPrefix;
169 169
     }
Please login to merge, or discard this patch.
src/Resolve/FieldResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@
 block discarded – undo
43 43
          * For disabled hydrator cache, store only last hydrator result and reuse for consecutive calls
44 44
          * then drop the cache if it doesn't hit.
45 45
          */
46
-        if (! $this->config->getUseHydratorCache()) {
46
+        if (!$this->config->getUseHydratorCache()) {
47 47
             if (isset($this->extractValues[$splObjectHash])) {
48 48
                 return $this->extractValues[$splObjectHash][$info->fieldName] ?? null;
49 49
             }
Please login to merge, or discard this patch.
src/Input/InputFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
         $fields       = [];
42 42
         $targetEntity = $this->typeManager->build(Entity::class, $id);
43 43
 
44
-        if (! count($requiredFields) && ! count($optionalFields)) {
44
+        if (!count($requiredFields) && !count($optionalFields)) {
45 45
             $this->addAllFieldsAsRequired($targetEntity, $fields);
46 46
         } else {
47 47
             $this->addRequiredFields($targetEntity, $requiredFields, $fields);
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
         array &$fields,
66 66
     ): void {
67 67
         foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) {
68
-            if (! in_array($fieldName, $optionalFields) && $optionalFields !== ['*']) {
68
+            if (!in_array($fieldName, $optionalFields) && $optionalFields !== ['*']) {
69 69
                 continue;
70 70
             }
71 71
 
@@ -96,7 +96,7 @@  discard block
 block discarded – undo
96 96
         array &$fields,
97 97
     ): void {
98 98
         foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) {
99
-            if (! in_array($fieldName, $requiredFields) && $requiredFields !== ['*']) {
99
+            if (!in_array($fieldName, $requiredFields) && $requiredFields !== ['*']) {
100 100
                 continue;
101 101
             }
102 102
 
Please login to merge, or discard this patch.
src/Services.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public function __construct(
24 24
         EntityManager $entityManager,
25
-        Config|null $config = null,
25
+        Config | null $config = null,
26 26
         array $metadata = [],
27 27
     ) {
28 28
         $this
@@ -30,8 +30,8 @@  discard block
 block discarded – undo
30 30
             ->set(EntityManager::class, $entityManager)
31 31
             ->set(
32 32
                 Config::class,
33
-                static function () use ($config) {
34
-                    if (! $config) {
33
+                static function() use ($config) {
34
+                    if (!$config) {
35 35
                         $config = new Config();
36 36
                     }
37 37
 
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
             )
49 49
             ->set(
50 50
                 'metadata',
51
-                static function (AbstractContainer $container) use ($metadata) {
51
+                static function(AbstractContainer $container) use ($metadata) {
52 52
                     return (new Metadata\MetadataFactory(
53 53
                         $metadata,
54 54
                         $container->get(EntityManager::class),
@@ -59,7 +59,7 @@  discard block
 block discarded – undo
59 59
             )
60 60
             ->set(
61 61
                 Metadata\GlobalEnable::class,
62
-                static function (AbstractContainer $container) {
62
+                static function(AbstractContainer $container) {
63 63
                     return new Metadata\GlobalEnable(
64 64
                         $container->get(EntityManager::class),
65 65
                         $container->get(Config::class),
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
             )
69 69
             ->set(
70 70
                 Resolve\FieldResolver::class,
71
-                static function (AbstractContainer $container) {
71
+                static function(AbstractContainer $container) {
72 72
                     return new Resolve\FieldResolver(
73 73
                         $container->get(Config::class),
74 74
                         $container->get(Type\TypeManager::class),
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
             )
78 78
             ->set(
79 79
                 Resolve\ResolveCollectionFactory::class,
80
-                static function (AbstractContainer $container) {
80
+                static function(AbstractContainer $container) {
81 81
                     return new Resolve\ResolveCollectionFactory(
82 82
                         $container->get(EntityManager::class),
83 83
                         $container->get(Config::class),
@@ -90,7 +90,7 @@  discard block
 block discarded – undo
90 90
             )
91 91
             ->set(
92 92
                 Resolve\ResolveEntityFactory::class,
93
-                static function (AbstractContainer $container) {
93
+                static function(AbstractContainer $container) {
94 94
                     return new Resolve\ResolveEntityFactory(
95 95
                         $container->get(Config::class),
96 96
                         $container->get(EntityManager::class),
@@ -100,7 +100,7 @@  discard block
 block discarded – undo
100 100
             )
101 101
             ->set(
102 102
                 Criteria\CriteriaFactory::class,
103
-                static function (AbstractContainer $container) {
103
+                static function(AbstractContainer $container) {
104 104
                     return new Criteria\CriteriaFactory(
105 105
                         $container->get(Config::class),
106 106
                         $container->get(EntityManager::class),
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
             )
112 112
             ->set(
113 113
                 Hydrator\HydratorFactory::class,
114
-                static function (AbstractContainer $container) {
114
+                static function(AbstractContainer $container) {
115 115
                     return new Hydrator\HydratorFactory(
116 116
                         $container->get(EntityManager::class),
117 117
                         $container->get(Type\TypeManager::class),
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
             )
121 121
             ->set(
122 122
                 Input\InputFactory::class,
123
-                static function (AbstractContainer $container) {
123
+                static function(AbstractContainer $container) {
124 124
                     return new Input\InputFactory(
125 125
                         $container->get(Config::class),
126 126
                         $container->get(EntityManager::class),
Please login to merge, or discard this patch.