Passed
Pull Request — main (#39)
by Tom
02:16
created
src/Attribute/Association.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -10,7 +10,7 @@
 block discarded – undo
10 10
 /**
11 11
  * Attribute to describe an association for GraphQL
12 12
  */
13
-#[Attribute(Attribute::TARGET_PROPERTY | Attribute::IS_REPEATABLE)]
13
+#[Attribute(Attribute::TARGET_PROPERTY|Attribute::IS_REPEATABLE)]
14 14
 class Association
15 15
 {
16 16
     use ExcludeFilters;
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
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
             // Only one matching instance per group is allowed
96 96
             assert(
97
-                ! $entityInstance,
97
+                !$entityInstance,
98 98
                 'Duplicate attribute found for entity '
99 99
                 . $reflectionClass->getName() . ', group ' . $instance->getGroup(),
100 100
             );
@@ -111,8 +111,7 @@  discard block
 block discarded – undo
111 111
                 'excludeFilters' => $instance->getExcludeFilters(),
112 112
                 'description' => $instance->getDescription(),
113 113
                 'typeName' => $instance->getTypeName()
114
-                    ? $this->appendGroupSuffix($instance->getTypeName()) :
115
-                    $this->getTypeName($reflectionClass->getName()),
114
+                    ? $this->appendGroupSuffix($instance->getTypeName()) : $this->getTypeName($reflectionClass->getName()),
116 115
             ];
117 116
         }
118 117
     }
@@ -138,7 +137,7 @@  discard block
 block discarded – undo
138 137
 
139 138
                 // Only one matching instance per group is allowed
140 139
                 assert(
141
-                    ! $fieldInstance,
140
+                    !$fieldInstance,
142 141
                     'Duplicate attribute found for field '
143 142
                     . $fieldName . ', group ' . $instance->getGroup(),
144 143
                 );
@@ -183,7 +182,7 @@  discard block
 block discarded – undo
183 182
 
184 183
                 // Only one matching instance per group is allowed
185 184
                 assert(
186
-                    ! $associationInstance,
185
+                    !$associationInstance,
187 186
                     'Duplicate attribute found for association '
188 187
                     . $associationName . ', group ' . $instance->getGroup(),
189 188
                 );
Please login to merge, or discard this patch.
src/Filter/Filters.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -88,7 +88,7 @@
 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,
Please login to merge, or discard this patch.
src/Filter/FilterFactory.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -81,8 +81,8 @@  discard block
 block discarded – undo
81 81
         // Limit association filters
82 82
         if ($associationName) {
83 83
             $excludeFilters = Filters::fromArray($associationMetadata['excludeFilters'] ?? []);
84
-            $allowedFilters = array_filter($allowedFilters, static function ($value) use ($excludeFilters) {
85
-                return ! in_array($value, $excludeFilters);
84
+            $allowedFilters = array_filter($allowedFilters, static function($value) use ($excludeFilters) {
85
+                return !in_array($value, $excludeFilters);
86 86
             });
87 87
         }
88 88
 
@@ -116,7 +116,7 @@  discard block
 block discarded – undo
116 116
 
117 117
         foreach ($classMetadata->getFieldNames() as $fieldName) {
118 118
             // Only process fields that are in the graphql metadata
119
-            if (! in_array($fieldName, array_keys($entityMetadata['fields']))) {
119
+            if (!in_array($fieldName, array_keys($entityMetadata['fields']))) {
120 120
                 continue;
121 121
             }
122 122
 
@@ -131,8 +131,8 @@  discard block
 block discarded – undo
131 131
                 $fieldExcludeFilters = Filters::fromArray($entityMetadata['fields'][$fieldName]['excludeFilters']);
132 132
                 $allowedFilters      = array_filter(
133 133
                     $allowedFilters,
134
-                    static function ($value) use ($fieldExcludeFilters) {
135
-                        return ! in_array($value, $fieldExcludeFilters);
134
+                    static function($value) use ($fieldExcludeFilters) {
135
+                        return !in_array($value, $fieldExcludeFilters);
136 136
                     },
137 137
                 );
138 138
             }
@@ -165,7 +165,7 @@  discard block
 block discarded – undo
165 165
         // Add eq filter for to-one associations
166 166
         foreach ($classMetadata->getAssociationNames() as $associationName) {
167 167
             // Only process fields which are in the graphql metadata
168
-            if (! in_array($associationName, array_keys($entityMetadata['fields']))) {
168
+            if (!in_array($associationName, array_keys($entityMetadata['fields']))) {
169 169
                 continue;
170 170
             }
171 171
 
Please login to merge, or discard this patch.
src/Services.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -28,8 +28,8 @@  discard block
 block discarded – undo
28 28
             ->set(EntityManager::class, $entityManager)
29 29
             ->set(
30 30
                 Config::class,
31
-                static function () use ($config) {
32
-                    if (! $config) {
31
+                static function() use ($config) {
32
+                    if (!$config) {
33 33
                         $config = new Config();
34 34
                     }
35 35
 
@@ -46,7 +46,7 @@  discard block
 block discarded – undo
46 46
             )
47 47
             ->set(
48 48
                 'metadata',
49
-                static function (AbstractContainer $container) use ($metadata) {
49
+                static function(AbstractContainer $container) use ($metadata) {
50 50
                     return (new Metadata\MetadataFactory(
51 51
                         $metadata,
52 52
                         $container->get(EntityManager::class),
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
             )
59 59
             ->set(
60 60
                 Metadata\GlobalEnable::class,
61
-                static function (AbstractContainer $container) {
61
+                static function(AbstractContainer $container) {
62 62
                     return new Metadata\GlobalEnable(
63 63
                         $container->get(EntityManager::class),
64 64
                         $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),
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
             )
102 102
             ->set(
103 103
                 Filter\FilterFactory::class,
104
-                static function (AbstractContainer $container) {
104
+                static function(AbstractContainer $container) {
105 105
                     return new Filter\FilterFactory(
106 106
                         $container->get(Config::class),
107 107
                         $container->get(EntityManager::class),
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             )
113 113
             ->set(
114 114
                 Hydrator\HydratorFactory::class,
115
-                static function (AbstractContainer $container) {
115
+                static function(AbstractContainer $container) {
116 116
                     return new Hydrator\HydratorFactory(
117 117
                         $container->get(EntityManager::class),
118 118
                         $container->get(Type\TypeManager::class),
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
             )
122 122
             ->set(
123 123
                 Input\InputFactory::class,
124
-                static function (AbstractContainer $container) {
124
+                static function(AbstractContainer $container) {
125 125
                     return new Input\InputFactory(
126 126
                         $container->get(Config::class),
127 127
                         $container->get(EntityManager::class),
Please login to merge, or discard this patch.
src/Resolve/ResolveEntityFactory.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -34,7 +34,7 @@  discard block
 block discarded – undo
34 34
 
35 35
     public function get(Entity $entity, string|null $eventName): Closure
36 36
     {
37
-        return function ($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) {
37
+        return function($objectValue, array $args, $context, ResolveInfo $info) use ($entity, $eventName) {
38 38
             $entityClass        = $entity->getEntityClass();
39 39
             $queryBuilderFilter = new QueryBuilderFilter();
40 40
 
@@ -147,7 +147,7 @@  discard block
 block discarded – undo
147 147
         $itemCount = $paginator->count();
148 148
 
149 149
         // Rebuild paginator if needed
150
-        if ($paginationFields['last'] && ! $paginationFields['before']) {
150
+        if ($paginationFields['last'] && !$paginationFields['before']) {
151 151
             $offsetAndLimit['offset'] = $itemCount - $paginationFields['last'];
152 152
             $queryBuilder->setFirstResult($offsetAndLimit['offset']);
153 153
             $paginator = new Paginator($queryBuilder->getQuery());
@@ -161,7 +161,7 @@  discard block
 block discarded – undo
161 161
                 'cursor' => $cursors['last'],
162 162
             ];
163 163
 
164
-            if (! $cursors['first']) {
164
+            if (!$cursors['first']) {
165 165
                 $cursors['first'] = $cursors['last'];
166 166
             }
167 167
 
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
         $limit = $this->metadata[$entity->getEntityClass()]['limit'];
191 191
 
192
-        if (! $limit) {
192
+        if (!$limit) {
193 193
             $limit = $this->config->getLimit();
194 194
         }
195 195
 
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
@@ -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.