Passed
Pull Request — main (#131)
by
unknown
11:42
created
src/Criteria/Type/FiltersInputObjectType.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -13,7 +13,7 @@
 block discarded – undo
13 13
 class FiltersInputObjectType extends InputObjectType
14 14
 {
15 15
     /** @param string[] $allowedFilters */
16
-    public function __construct(string $typeName, string $fieldName, ScalarType|ListOfType $type, array $allowedFilters)
16
+    public function __construct(string $typeName, string $fieldName, ScalarType | ListOfType $type, array $allowedFilters)
17 17
     {
18 18
         $fields       = [];
19 19
         $descriptions = FiltersDef::getDescriptions();
Please login to merge, or discard this patch.
src/Metadata/AbstractMetadataFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
 {
21 21
     protected Config $config;
22 22
 
23
-    protected function getDefaultStrategy(string|null $fieldType): string
23
+    protected function getDefaultStrategy(string | null $fieldType): string
24 24
     {
25 25
         // Set default strategy based on field type
26 26
         switch ($fieldType) {
Please login to merge, or discard this patch.
src/Metadata/MetadataFactory.php 1 patch
Spacing   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,12 +17,12 @@  discard block
 block discarded – undo
17 17
 
18 18
 class MetadataFactory extends AbstractMetadataFactory
19 19
 {
20
-    protected Metadata|null $metadata = null;
20
+    protected Metadata | null $metadata = null;
21 21
     protected EntityManager $entityManager;
22 22
     protected Config $config;
23 23
 
24 24
     /** @param mixed|null $metadataConfig */
25
-    public function __construct(protected ContainerInterface $container, protected array|null $metadataConfig)
25
+    public function __construct(protected ContainerInterface $container, protected array | null $metadataConfig)
26 26
     {
27 27
         $this->entityManager = $container->get(EntityManager::class);
28 28
         $this->config        = $container->get(Config::class);
@@ -91,7 +91,7 @@  discard block
 block discarded – undo
91 91
 
92 92
             // Only one matching instance per group is allowed
93 93
             assert(
94
-                ! $entityInstance,
94
+                !$entityInstance,
95 95
                 'Duplicate attribute found for entity '
96 96
                 . $reflectionClass->getName() . ', group ' . $instance->getGroup(),
97 97
             );
@@ -107,8 +107,7 @@  discard block
 block discarded – undo
107 107
                 'excludeCriteria' => $instance->getExcludeCriteria(),
108 108
                 'description' => $instance->getDescription(),
109 109
                 'typeName' => $instance->getTypeName()
110
-                    ? $this->appendGroupSuffix($instance->getTypeName()) :
111
-                    $this->getTypeName($reflectionClass->getName()),
110
+                    ? $this->appendGroupSuffix($instance->getTypeName()) : $this->getTypeName($reflectionClass->getName()),
112 111
             ];
113 112
         }
114 113
     }
@@ -131,7 +130,7 @@  discard block
 block discarded – undo
131 130
 
132 131
                 // Only one matching instance per group is allowed
133 132
                 assert(
134
-                    ! $fieldInstance,
133
+                    !$fieldInstance,
135 134
                     'Duplicate attribute found for field '
136 135
                     . $fieldName . ', group ' . $instance->getGroup(),
137 136
                 );
@@ -182,7 +181,7 @@  discard block
 block discarded – undo
182 181
 
183 182
                 // Only one matching instance per group is allowed
184 183
                 assert(
185
-                    ! $associationInstance,
184
+                    !$associationInstance,
186 185
                     'Duplicate attribute found for association '
187 186
                     . $associationName . ', group ' . $instance->getGroup(),
188 187
                 );
Please login to merge, or discard this patch.
src/Services.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -22,16 +22,16 @@  discard block
 block discarded – undo
22 22
      */
23 23
     public function __construct(
24 24
         EntityManager $entityManager,
25
-        Config|null $config = null,
26
-        array|null $metadataConfig = null,
25
+        Config | null $config = null,
26
+        array | null $metadataConfig = null,
27 27
     ) {
28 28
         $this
29 29
             // Plain classes
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,13 +48,13 @@  discard block
 block discarded – undo
48 48
             )
49 49
             ->set(
50 50
                 Metadata\Metadata::class,
51
-                static function (ContainerInterface $container) use ($metadataConfig) {
51
+                static function(ContainerInterface $container) use ($metadataConfig) {
52 52
                     return (new Metadata\MetadataFactory($container, $metadataConfig))->getMetadata();
53 53
                 },
54 54
             )
55 55
             ->set(
56 56
                 Metadata\GlobalEnable::class,
57
-                static function (ContainerInterface $container) {
57
+                static function(ContainerInterface $container) {
58 58
                     return new Metadata\GlobalEnable(
59 59
                         $container->get(EntityManager::class),
60 60
                         $container->get(Config::class),
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
             )
64 64
             ->set(
65 65
                 Resolve\FieldResolver::class,
66
-                static function (ContainerInterface $container) {
66
+                static function(ContainerInterface $container) {
67 67
                     return new Resolve\FieldResolver(
68 68
                         $container->get(Config::class),
69 69
                         $container->get(Metadata\Metadata::class),
@@ -72,7 +72,7 @@  discard block
 block discarded – undo
72 72
             )
73 73
             ->set(
74 74
                 Resolve\ResolveCollectionFactory::class,
75
-                static function (ContainerInterface $container) {
75
+                static function(ContainerInterface $container) {
76 76
                     return new Resolve\ResolveCollectionFactory(
77 77
                         $container->get(EntityManager::class),
78 78
                         $container->get(Config::class),
@@ -85,7 +85,7 @@  discard block
 block discarded – undo
85 85
             )
86 86
             ->set(
87 87
                 Resolve\ResolveEntityFactory::class,
88
-                static function (ContainerInterface $container) {
88
+                static function(ContainerInterface $container) {
89 89
                     return new Resolve\ResolveEntityFactory(
90 90
                         $container->get(Config::class),
91 91
                         $container->get(EntityManager::class),
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
             )
96 96
             ->set(
97 97
                 Criteria\CriteriaFactory::class,
98
-                static function (ContainerInterface $container) {
98
+                static function(ContainerInterface $container) {
99 99
                     return new Criteria\CriteriaFactory(
100 100
                         $container->get(Config::class),
101 101
                         $container->get(EntityManager::class),
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
             )
107 107
             ->set(
108 108
                 Hydrator\HydratorFactory::class,
109
-                static function (ContainerInterface $container) {
109
+                static function(ContainerInterface $container) {
110 110
                     return new Hydrator\HydratorFactory(
111 111
                         $container->get(EntityManager::class),
112 112
                         $container->get(Metadata\Metadata::class),
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
             )
116 116
             ->set(
117 117
                 Input\InputFactory::class,
118
-                static function (ContainerInterface $container) {
118
+                static function(ContainerInterface $container) {
119 119
                     return new Input\InputFactory(
120 120
                         $container->get(Config::class),
121 121
                         $container->get(EntityManager::class),
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->metadata->get($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/Type/Entity.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -64,7 +64,7 @@  discard block
 block discarded – undo
64 64
         return $this->metadataConfig['typeName'];
65 65
     }
66 66
 
67
-    public function getDescription(): string|null
67
+    public function getDescription(): string | null
68 68
     {
69 69
         return $this->metadataConfig['description'];
70 70
     }
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
         $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass());
123 123
 
124 124
         foreach ($classMetadata->getFieldNames() as $fieldName) {
125
-            if (! in_array($fieldName, array_keys($this->metadataConfig['fields']))) {
125
+            if (!in_array($fieldName, array_keys($this->metadataConfig['fields']))) {
126 126
                 continue;
127 127
             }
128 128
 
@@ -140,7 +140,7 @@  discard block
 block discarded – undo
140 140
         $classMetadata = $this->entityManager->getClassMetadata($this->getEntityClass());
141 141
 
142 142
         foreach ($classMetadata->getAssociationNames() as $associationName) {
143
-            if (! in_array($associationName, array_keys($this->metadataConfig['fields']))) {
143
+            if (!in_array($associationName, array_keys($this->metadataConfig['fields']))) {
144 144
                 continue;
145 145
             }
146 146
 
@@ -151,7 +151,7 @@  discard block
 block discarded – undo
151 151
                 case ClassMetadataInfo::MANY_TO_ONE:
152 152
                 case ClassMetadataInfo::TO_ONE:
153 153
                     $targetEntity             = $associationMetadata['targetEntity'];
154
-                    $fields[$associationName] = function () use ($targetEntity) {
154
+                    $fields[$associationName] = function() use ($targetEntity) {
155 155
                         $entity = $this->metadata->get($targetEntity);
156 156
 
157 157
                         return [
@@ -164,7 +164,7 @@  discard block
 block discarded – undo
164 164
                 case ClassMetadataInfo::MANY_TO_MANY:
165 165
                 case ClassMetadataInfo::TO_MANY:
166 166
                     $targetEntity             = $associationMetadata['targetEntity'];
167
-                    $fields[$associationName] = function () use ($targetEntity, $associationName) {
167
+                    $fields[$associationName] = function() use ($targetEntity, $associationName) {
168 168
                         $entity    = $this->metadata->get($targetEntity);
169 169
                         $shortName = $this->getTypeName() . '_' . $associationName;
170 170
 
Please login to merge, or discard this patch.
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.