Passed
Branch main (2388f5)
by Tom
02:52
created
src/Metadata/MetadataFactory.php 1 patch
Spacing   +7 added lines, -8 removed lines patch added patch discarded remove patch
@@ -22,12 +22,12 @@  discard block
 block discarded – undo
22 22
 
23 23
 class MetadataFactory
24 24
 {
25
-    protected Metadata|null $metadata = null;
25
+    protected Metadata | null $metadata = null;
26 26
     protected EntityManager $entityManager;
27 27
     protected Config $config;
28 28
 
29 29
     /** @param mixed|null $metadataConfig */
30
-    public function __construct(protected ContainerInterface $container, protected array|null $metadataConfig)
30
+    public function __construct(protected ContainerInterface $container, protected array | null $metadataConfig)
31 31
     {
32 32
         $this->entityManager = $container->get(EntityManager::class);
33 33
         $this->config        = $container->get(Config::class);
@@ -158,7 +158,7 @@  discard block
 block discarded – undo
158 158
 
159 159
             // Only one matching instance per group is allowed
160 160
             assert(
161
-                ! $entityInstance,
161
+                !$entityInstance,
162 162
                 'Duplicate attribute found for entity '
163 163
                 . $reflectionClass->getName() . ', group ' . $instance->getGroup(),
164 164
             );
@@ -174,8 +174,7 @@  discard block
 block discarded – undo
174 174
                 'excludeCriteria' => $instance->getExcludeCriteria(),
175 175
                 'description' => $instance->getDescription(),
176 176
                 'typeName' => $instance->getTypeName()
177
-                    ? $this->appendGroupSuffix($instance->getTypeName()) :
178
-                    $this->getTypeName($reflectionClass->getName()),
177
+                    ? $this->appendGroupSuffix($instance->getTypeName()) : $this->getTypeName($reflectionClass->getName()),
179 178
             ];
180 179
         }
181 180
     }
@@ -198,7 +197,7 @@  discard block
 block discarded – undo
198 197
 
199 198
                 // Only one matching instance per group is allowed
200 199
                 assert(
201
-                    ! $fieldInstance,
200
+                    !$fieldInstance,
202 201
                     'Duplicate attribute found for field '
203 202
                     . $fieldName . ', group ' . $instance->getGroup(),
204 203
                 );
@@ -246,7 +245,7 @@  discard block
 block discarded – undo
246 245
 
247 246
                 // Only one matching instance per group is allowed
248 247
                 assert(
249
-                    ! $associationInstance,
248
+                    !$associationInstance,
250 249
                     'Duplicate attribute found for association '
251 250
                     . $associationName . ', group ' . $instance->getGroup(),
252 251
                 );
@@ -316,7 +315,7 @@  discard block
 block discarded – undo
316 315
         return $this->appendGroupSuffix($this->stripEntityPrefix($entityClass));
317 316
     }
318 317
 
319
-    private function getDefaultStrategy(string|null $fieldType): string
318
+    private function getDefaultStrategy(string | null $fieldType): string
320 319
     {
321 320
         // Set default strategy based on field type
322 321
         /** @psalm-suppress UndefinedDocblockClass */
Please login to merge, or discard this patch.
src/Metadata/Metadata.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -13,27 +13,27 @@
 block discarded – undo
13 13
 {
14 14
     public function __construct(
15 15
         protected ContainerInterface $container,
16
-        protected array|null $metadataConfig,
16
+        protected array | null $metadataConfig,
17 17
     ) {
18 18
     }
19 19
 
20 20
     /** @throws Error */
21 21
     public function get(string $id): Entity
22 22
     {
23
-        if (! isset($this->metadataConfig[$id])) {
23
+        if (!isset($this->metadataConfig[$id])) {
24 24
             throw new Error(
25 25
                 'Entity ' . $id . ' is not mapped in the metadata',
26 26
             );
27 27
         }
28 28
 
29
-        if (! $this->has($id)) {
29
+        if (!$this->has($id)) {
30 30
             $this->set($id, new Entity($this->container, $this->metadataConfig[$id]));
31 31
         }
32 32
 
33 33
         return parent::get($id);
34 34
     }
35 35
 
36
-    public function getMetadataConfig(): array|null
36
+    public function getMetadataConfig(): array | null
37 37
     {
38 38
         return $this->metadataConfig;
39 39
     }
Please login to merge, or discard this patch.