Completed
Push — main ( bd0d3d...b8edf8 )
by Tom
02:05 queued 02:02
created
src/Resolve/FieldResolver.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -46,7 +46,7 @@
 block discarded – undo
46 46
          * For disabled hydrator cache, store only the last hydrator result and reuse for consecutive calls
47 47
          * then drop the cache if it doesn't hit.
48 48
          */
49
-        if (! $this->config->getUseHydratorCache()) {
49
+        if (!$this->config->getUseHydratorCache()) {
50 50
             if (isset($this->extractValues[$splObjectHash])) {
51 51
                 return $this->extractValues[$splObjectHash][$info->fieldName] ?? null;
52 52
             }
Please login to merge, or discard this patch.
src/Metadata/MetadataFactory.php 1 patch
Spacing   +4 added lines, -5 removed lines patch added patch discarded remove patch
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 
96 96
             // Only one matching instance per group is allowed
97 97
             assert(
98
-                ! $entityInstance,
98
+                !$entityInstance,
99 99
                 'Duplicate attribute found for entity '
100 100
                 . $reflectionClass->getName() . ', group ' . $instance->getGroup(),
101 101
             );
@@ -112,8 +112,7 @@  discard block
 block discarded – undo
112 112
                 'excludeFilters' => Filters::toStringArray($instance->getExcludeFilters()),
113 113
                 'description' => $instance->getDescription(),
114 114
                 'typeName' => $instance->getTypeName()
115
-                    ? $this->appendGroupSuffix($instance->getTypeName()) :
116
-                    $this->getTypeName($reflectionClass->getName()),
115
+                    ? $this->appendGroupSuffix($instance->getTypeName()) : $this->getTypeName($reflectionClass->getName()),
117 116
             ];
118 117
         }
119 118
     }
@@ -139,7 +138,7 @@  discard block
 block discarded – undo
139 138
 
140 139
                 // Only one matching instance per group is allowed
141 140
                 assert(
142
-                    ! $fieldInstance,
141
+                    !$fieldInstance,
143 142
                     'Duplicate attribute found for field '
144 143
                     . $fieldName . ', group ' . $instance->getGroup(),
145 144
                 );
@@ -184,7 +183,7 @@  discard block
 block discarded – undo
184 183
 
185 184
                 // Only one matching instance per group is allowed
186 185
                 assert(
187
-                    ! $associationInstance,
186
+                    !$associationInstance,
188 187
                     'Duplicate attribute found for association '
189 188
                     . $associationName . ', group ' . $instance->getGroup(),
190 189
                 );
Please login to merge, or discard this patch.
src/Filter/Filters.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@  discard block
 block discarded – undo
88 88
     public static function fromArray(array $filters): array
89 89
     {
90 90
         $filters = array_map(
91
-            static function ($filter) {
91
+            static function($filter) {
92 92
                 return is_string($filter) ? Filters::from($filter) : $filter;
93 93
             },
94 94
             $filters,
@@ -107,7 +107,7 @@  discard block
 block discarded – undo
107 107
     public static function toStringArray(array $filters): array
108 108
     {
109 109
         return array_map(
110
-            static function (Filters $filter) {
110
+            static function(Filters $filter) {
111 111
                 return $filter->value;
112 112
             },
113 113
             $filters,
Please login to merge, or discard this patch.
src/Filter/FilterFactory.php 1 patch
Spacing   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -70,15 +70,15 @@  discard block
 block discarded – undo
70 70
         );
71 71
 
72 72
         // Get the allowed filters
73
-        $allowedFilters = array_udiff(Filters::cases(), $excludedFilters, static function ($a, $b) {
73
+        $allowedFilters = array_udiff(Filters::cases(), $excludedFilters, static function($a, $b) {
74 74
             return $a->value <=> $b->value;
75 75
         });
76 76
 
77 77
         // Limit association filters
78 78
         if ($associationName) {
79 79
             $excludeFilters = Filters::fromArray($associationMetadata['excludeFilters'] ?? []);
80
-            $allowedFilters = array_filter($allowedFilters, static function ($value) use ($excludeFilters) {
81
-                return ! in_array($value, $excludeFilters);
80
+            $allowedFilters = array_filter($allowedFilters, static function($value) use ($excludeFilters) {
81
+                return !in_array($value, $excludeFilters);
82 82
             });
83 83
         }
84 84
 
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
 
113 113
         foreach ($classMetadata->getFieldNames() as $fieldName) {
114 114
             // Only process fields that are in the graphql metadata
115
-            if (! in_array($fieldName, array_keys($entityMetadata['fields']))) {
115
+            if (!in_array($fieldName, array_keys($entityMetadata['fields']))) {
116 116
                 continue;
117 117
             }
118 118
 
@@ -127,8 +127,8 @@  discard block
 block discarded – undo
127 127
                 $fieldExcludeFilters = Filters::fromArray($entityMetadata['fields'][$fieldName]['excludeFilters']);
128 128
                 $allowedFilters      = array_filter(
129 129
                     $allowedFilters,
130
-                    static function ($value) use ($fieldExcludeFilters) {
131
-                        return ! in_array($value, $fieldExcludeFilters);
130
+                    static function($value) use ($fieldExcludeFilters) {
131
+                        return !in_array($value, $fieldExcludeFilters);
132 132
                     },
133 133
                 );
134 134
             }
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
         // Add eq filter for to-one associations
162 162
         foreach ($classMetadata->getAssociationNames() as $associationName) {
163 163
             // Only process fields which are in the graphql metadata
164
-            if (! isset($entityMetadata['fields'][$associationName])) {
164
+            if (!isset($entityMetadata['fields'][$associationName])) {
165 165
                 continue;
166 166
             }
167 167
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
                     ClassMetadataInfo::MANY_TO_MANY,
174 174
                     ClassMetadataInfo::ONE_TO_MANY,
175 175
                 ])
176
-                || ! in_array(Filters::EQ, $allowedFilters)
176
+                || !in_array(Filters::EQ, $allowedFilters)
177 177
             ) {
178 178
                 continue;
179 179
             }
Please login to merge, or discard this patch.
src/Attribute/ExcludeFilters.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
             $this->excludeFilters = array_udiff(
35 35
                 Filters::cases(),
36 36
                 $this->includeFilters,
37
-                static function (Filters $a1, Filters $a2) {
37
+                static function(Filters $a1, Filters $a2) {
38 38
                     return $a1->value <=> $a2->value;
39 39
                 },
40 40
             );
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
             $this->excludeFilters = array_uintersect(
43 43
                 Filters::cases(),
44 44
                 $this->excludeFilters,
45
-                static function (Filters $a1, Filters $a2) {
45
+                static function(Filters $a1, Filters $a2) {
46 46
                     return $a1->value <=> $a2->value;
47 47
                 },
48 48
             );
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
@@ -44,7 +44,7 @@  discard block
 block discarded – undo
44 44
         $fields       = [];
45 45
         $targetEntity = $this->typeManager->build(Entity::class, $id);
46 46
 
47
-        if (! count($requiredFields) && ! count($optionalFields)) {
47
+        if (!count($requiredFields) && !count($optionalFields)) {
48 48
             $this->addAllFieldsAsRequired($targetEntity, $fields);
49 49
         } else {
50 50
             $this->addRequiredFields($targetEntity, $requiredFields, $fields);
@@ -68,7 +68,7 @@  discard block
 block discarded – undo
68 68
         array &$fields,
69 69
     ): void {
70 70
         foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) {
71
-            if (! in_array($fieldName, $optionalFields)) {
71
+            if (!in_array($fieldName, $optionalFields)) {
72 72
                 continue;
73 73
             }
74 74
 
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         array &$fields,
100 100
     ): void {
101 101
         foreach ($this->entityManager->getClassMetadata($targetEntity->getEntityClass())->getFieldNames() as $fieldName) {
102
-            if (! in_array($fieldName, $requiredFields)) {
102
+            if (!in_array($fieldName, $requiredFields)) {
103 103
                 continue;
104 104
             }
105 105
 
Please login to merge, or discard this patch.
src/Type/Entity.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
         $this->hydratorFactory   = $container->get(HydratorFactory::class);
61 61
         $this->typeManager       = $container->get(TypeManager::class);
62 62
 
63
-        if (! isset($container->get('metadata')[$typeName])) {
63
+        if (!isset($container->get('metadata')[$typeName])) {
64 64
             throw new Error(
65 65
                 'Entity ' . $typeName . ' is not mapped in the metadata',
66 66
             );
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
         $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass());
156 156
 
157 157
         foreach ($classMetadata->getFieldNames() as $fieldName) {
158
-            if (! in_array($fieldName, array_keys($this->metadata['fields']))) {
158
+            if (!in_array($fieldName, array_keys($this->metadata['fields']))) {
159 159
                 continue;
160 160
             }
161 161
 
@@ -173,7 +173,7 @@  discard block
 block discarded – undo
173 173
         $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass());
174 174
 
175 175
         foreach ($classMetadata->getAssociationNames() as $associationName) {
176
-            if (! in_array($associationName, array_keys($this->metadata['fields']))) {
176
+            if (!in_array($associationName, array_keys($this->metadata['fields']))) {
177 177
                 continue;
178 178
             }
179 179
 
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
                 ])
187 187
             ) {
188 188
                 $targetEntity             = $associationMetadata['targetEntity'];
189
-                $fields[$associationName] = function () use ($targetEntity) {
189
+                $fields[$associationName] = function() use ($targetEntity) {
190 190
                     $entity = $this->typeManager->build(self::class, $targetEntity);
191 191
 
192 192
                     return [
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 
199 199
             // Collections
200 200
             $targetEntity             = $associationMetadata['targetEntity'];
201
-            $fields[$associationName] = function () use ($targetEntity, $associationName) {
201
+            $fields[$associationName] = function() use ($targetEntity, $associationName) {
202 202
                 $entity    = $this->typeManager->build(self::class, $targetEntity);
203 203
                 $shortName = $this->getTypeName() . '_' . $associationName;
204 204
 
Please login to merge, or discard this patch.