Passed
Pull Request — master (#1553)
by
unknown
11:34
created
src/Builder/DefaultDriverFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,7 +58,7 @@  discard block
 block discarded – undo
58 58
 
59 59
     public function createDriver(array $metadataDirs, ?Reader $annotationReader = null): DriverInterface
60 60
     {
61
-        if (PHP_VERSION_ID < 80000 && empty($metadataDirs) && !interface_exists(Reader::class)) {
61
+        if (PHP_VERSION_ID < 80000 && empty($metadataDirs) && ! interface_exists(Reader::class)) {
62 62
             throw new RuntimeException(sprintf('To use "%s", either a list of metadata directories must be provided, the "doctrine/annotations" package installed, or use PHP 8.0 or later.', self::class));
63 63
         }
64 64
 
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
             $metadataDrivers[] = new AnnotationOrAttributeDriver($this->propertyNamingStrategy, $this->typeParser, $this->expressionEvaluator, $annotationReader);
77 77
         }
78 78
 
79
-        if (!empty($metadataDirs)) {
79
+        if ( ! empty($metadataDirs)) {
80 80
             $fileLocator = new FileLocator($metadataDirs);
81 81
 
82 82
             array_unshift($metadataDrivers, new XmlDriver($fileLocator, $this->propertyNamingStrategy, $this->typeParser, $this->expressionEvaluator));
Please login to merge, or discard this patch.
src/Builder/CallbackDriverFactory.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@
 block discarded – undo
27 27
     public function createDriver(array $metadataDirs, ?Reader $reader = null): DriverInterface
28 28
     {
29 29
         $driver = \call_user_func($this->callback, $metadataDirs, $reader);
30
-        if (!$driver instanceof DriverInterface) {
30
+        if ( ! $driver instanceof DriverInterface) {
31 31
             throw new LogicException('The callback must return an instance of DriverInterface.');
32 32
         }
33 33
 
Please login to merge, or discard this patch.
src/Context.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -78,7 +78,7 @@  discard block
 block discarded – undo
78 78
             $this->addExclusionStrategy(new VersionExclusionStrategy($this->attributes['version']));
79 79
         }
80 80
 
81
-        if (!empty($this->attributes['max_depth_checks'])) {
81
+        if ( ! empty($this->attributes['max_depth_checks'])) {
82 82
             $this->addExclusionStrategy(new DepthExclusionStrategy());
83 83
         }
84 84
 
@@ -133,7 +133,7 @@  discard block
 block discarded – undo
133 133
 
134 134
     final protected function assertMutable(): void
135 135
     {
136
-        if (!$this->initialized) {
136
+        if ( ! $this->initialized) {
137 137
             return;
138 138
         }
139 139
 
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
     {
223 223
         $metadata = $this->metadataStack->pop();
224 224
 
225
-        if (!$metadata instanceof PropertyMetadata) {
225
+        if ( ! $metadata instanceof PropertyMetadata) {
226 226
             throw new RuntimeException('Context metadataStack not working well');
227 227
         }
228 228
     }
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
     {
232 232
         $metadata = $this->metadataStack->pop();
233 233
 
234
-        if (!$metadata instanceof ClassMetadata) {
234
+        if ( ! $metadata instanceof ClassMetadata) {
235 235
             throw new RuntimeException('Context metadataStack not working well');
236 236
         }
237 237
     }
@@ -243,7 +243,7 @@  discard block
 block discarded – undo
243 243
 
244 244
     public function getCurrentPath(): array
245 245
     {
246
-        if (!$this->metadataStack) {
246
+        if ( ! $this->metadataStack) {
247 247
             return [];
248 248
         }
249 249
 
Please login to merge, or discard this patch.
src/Metadata/Driver/TypedPropertiesDriver.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -60,7 +60,7 @@  discard block
 block discarded – undo
60 60
     private function reorderTypes(array $type): array
61 61
     {
62 62
         if ($type['params']) {
63
-            uasort($type['params'], static function ($a, $b) {
63
+            uasort($type['params'], static function($a, $b) {
64 64
                 $order = ['null' => 0, 'true' => 1, 'false' => 2, 'bool' => 3, 'int' => 4, 'float' => 5, 'string' => 6];
65 65
 
66 66
                 return ($order[$a['name']] ?? 7) <=> ($order[$b['name']] ?? 7);
@@ -152,7 +152,7 @@  discard block
 block discarded – undo
152 152
      */
153 153
     private function shouldTypeHint(?ReflectionType $reflectionType): bool
154 154
     {
155
-        if (!$reflectionType instanceof ReflectionNamedType) {
155
+        if ( ! $reflectionType instanceof ReflectionNamedType) {
156 156
             return false;
157 157
         }
158 158
 
@@ -169,7 +169,7 @@  discard block
 block discarded – undo
169 169
      */
170 170
     private function shouldTypeHintUnion(?ReflectionType $reflectionType)
171 171
     {
172
-        if (!$reflectionType instanceof \ReflectionUnionType) {
172
+        if ( ! $reflectionType instanceof \ReflectionUnionType) {
173 173
             return false;
174 174
         }
175 175
 
Please login to merge, or discard this patch.
src/Handler/UnionHandler.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -70,22 +70,22 @@  discard block
 block discarded – undo
70 70
         foreach ($type['params'] as $possibleType) {
71 71
             $finalType = null;
72 72
 
73
-            if (!$context->getMetadataStack()->isEmpty()) {
73
+            if ( ! $context->getMetadataStack()->isEmpty()) {
74 74
                 $propertyMetadata = $context->getMetadataStack()->top();
75 75
                 if (null !== $propertyMetadata->unionDiscriminatorField) {
76
-                    if (!array_key_exists($propertyMetadata->unionDiscriminatorField, $data)) {
77
-                        throw new NonVisitableTypeException('Union Discriminator Field \'' . $propertyMetadata->unionDiscriminatorField . '\' not found in data');
76
+                    if ( ! array_key_exists($propertyMetadata->unionDiscriminatorField, $data)) {
77
+                        throw new NonVisitableTypeException('Union Discriminator Field \''.$propertyMetadata->unionDiscriminatorField.'\' not found in data');
78 78
                     }
79 79
 
80 80
                     $lkup = $data[$propertyMetadata->unionDiscriminatorField];
81
-                    if (!empty($propertyMetadata->unionDiscriminatorMap)) {
81
+                    if ( ! empty($propertyMetadata->unionDiscriminatorMap)) {
82 82
                         if (array_key_exists($lkup, $propertyMetadata->unionDiscriminatorMap)) {
83 83
                             $finalType = [
84 84
                                 'name' => $propertyMetadata->unionDiscriminatorMap[$lkup],
85 85
                                 'params' => [],
86 86
                             ];
87 87
                         } else {
88
-                            throw new NonVisitableTypeException('Union Discriminator Map does not contain key \'' . $lkup . '\'');
88
+                            throw new NonVisitableTypeException('Union Discriminator Map does not contain key \''.$lkup.'\'');
89 89
                         }
90 90
                     } else {
91 91
                         $finalType = [
@@ -113,7 +113,7 @@  discard block
 block discarded – undo
113 113
     private function matchSimpleType(mixed $data, array $type, Context $context): mixed
114 114
     {
115 115
         foreach ($type['params'] as $possibleType) {
116
-            if ($this->isPrimitiveType($possibleType['name']) && !$this->testPrimitive($data, $possibleType['name'], $context->getFormat())) {
116
+            if ($this->isPrimitiveType($possibleType['name']) && ! $this->testPrimitive($data, $possibleType['name'], $context->getFormat())) {
117 117
                 continue;
118 118
             }
119 119
 
Please login to merge, or discard this patch.