Passed
Pull Request — master (#1448)
by Asmir
02:29
created
src/Annotation/Groups.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -25,7 +25,7 @@
 block discarded – undo
25 25
             All the other cases should work as expected.
26 26
             The alternative here is to use the explicit syntax  Groups(groups=['value' => '...'])
27 27
         */
28
-        if (count($values) > 0 && ((!isset($values['value']) && !isset($values['groups'])) || count($values) > 1) && 0 === count($groups)) {
28
+        if (count($values) > 0 && (( ! isset($values['value']) && ! isset($values['groups'])) || count($values) > 1) && 0 === count($groups)) {
29 29
             $vars['groups'] = $values;
30 30
             $vars['values'] = [];
31 31
         }
Please login to merge, or discard this patch.
src/Construction/DoctrineObjectConstructor.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         // Locate possible ObjectManager
70 70
         $objectManager = $this->managerRegistry->getManagerForClass($metadata->name);
71 71
 
72
-        if (!$objectManager) {
72
+        if ( ! $objectManager) {
73 73
             // No ObjectManager found, proceed with normal deserialization
74 74
             return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
75 75
         }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
         }
84 84
 
85 85
         // Managed entity, check for proxy load
86
-        if (!is_array($data) && !(is_object($data) && 'SimpleXMLElement' === get_class($data))) {
86
+        if ( ! is_array($data) && ! (is_object($data) && 'SimpleXMLElement' === get_class($data))) {
87 87
             // Single identifier, load proxy
88 88
             return $objectManager->getReference($metadata->name, $data);
89 89
         }
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 
95 95
         foreach ($classMetadata->getIdentifierFieldNames() as $name) {
96 96
             // Avoid calling objectManager->find if some identification properties are excluded
97
-            if (!isset($metadata->propertyMetadata[$name])) {
97
+            if ( ! isset($metadata->propertyMetadata[$name])) {
98 98
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
99 99
             }
100 100
 
@@ -105,9 +105,9 @@  discard block
 block discarded – undo
105 105
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
106 106
             }
107 107
 
108
-            if (is_array($data) && !array_key_exists($propertyMetadata->serializedName, $data)) {
108
+            if (is_array($data) && ! array_key_exists($propertyMetadata->serializedName, $data)) {
109 109
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
110
-            } elseif (is_object($data) && !property_exists($data, $propertyMetadata->serializedName)) {
110
+            } elseif (is_object($data) && ! property_exists($data, $propertyMetadata->serializedName)) {
111 111
                 return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context);
112 112
             }
113 113
 
Please login to merge, or discard this patch.
src/Handler/ArrayCollectionHandler.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -119,7 +119,7 @@  discard block
 block discarded – undo
119 119
         }
120 120
 
121 121
         $propertyMetadata = $context->getMetadataStack()->top();
122
-        if (!$propertyMetadata instanceof PropertyMetadata) {
122
+        if ( ! $propertyMetadata instanceof PropertyMetadata) {
123 123
             return $elements;
124 124
         }
125 125
 
@@ -137,18 +137,18 @@  discard block
 block discarded – undo
137 137
             && $classMetadata->isCollectionValuedAssociation($propertyMetadata->name)
138 138
         ) {
139 139
             $existingCollection = $classMetadata->getFieldValue($currentObject, $propertyMetadata->name);
140
-            if (!$existingCollection instanceof OrmPersistentCollection) {
140
+            if ( ! $existingCollection instanceof OrmPersistentCollection) {
141 141
                 return $elements;
142 142
             }
143 143
 
144 144
             foreach ($elements as $element) {
145
-                if (!$existingCollection->contains($element)) {
145
+                if ( ! $existingCollection->contains($element)) {
146 146
                     $existingCollection->add($element);
147 147
                 }
148 148
             }
149 149
 
150 150
             foreach ($existingCollection as $collectionElement) {
151
-                if (!$elements->contains($collectionElement)) {
151
+                if ( ! $elements->contains($collectionElement)) {
152 152
                     $existingCollection->removeElement($collectionElement);
153 153
                 }
154 154
             }
Please login to merge, or discard this patch.
src/JsonSerializationVisitor.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
     public function visitDouble(float $data, array $type)
72 72
     {
73 73
         $percision = $type['params'][0] ?? null;
74
-        if (!is_int($percision)) {
74
+        if ( ! is_int($percision)) {
75 75
             return $data;
76 76
         }
77 77
 
@@ -93,7 +93,7 @@  discard block
 block discarded – undo
93 93
 
94 94
         $rs = isset($type['params'][1]) ? new \ArrayObject() : [];
95 95
 
96
-        $isList = isset($type['params'][0]) && !isset($type['params'][1]);
96
+        $isList = isset($type['params'][0]) && ! isset($type['params'][1]);
97 97
 
98 98
         $elType = $this->getElementType($type);
99 99
         foreach ($data as $k => $v) {
Please login to merge, or discard this patch.
src/Exclusion/DepthExclusionStrategy.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -28,7 +28,7 @@
 block discarded – undo
28 28
         $relativeDepth = 0;
29 29
 
30 30
         foreach ($context->getMetadataStack() as $metadata) {
31
-            if (!$metadata instanceof PropertyMetadata) {
31
+            if ( ! $metadata instanceof PropertyMetadata) {
32 32
                 continue;
33 33
             }
34 34
 
Please login to merge, or discard this patch.
src/JsonDeserializationStrictVisitor.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -49,7 +49,7 @@  discard block
 block discarded – undo
49 49
             return null;
50 50
         }
51 51
 
52
-        if (! is_string($data)) {
52
+        if ( ! is_string($data)) {
53 53
             throw NonVisitableTypeException::fromDataAndType($data, $type);
54 54
         }
55 55
 
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
             return null;
66 66
         }
67 67
 
68
-        if (! is_bool($data)) {
68
+        if ( ! is_bool($data)) {
69 69
             throw NonVisitableTypeException::fromDataAndType($data, $type);
70 70
         }
71 71
 
@@ -81,7 +81,7 @@  discard block
 block discarded – undo
81 81
             return null;
82 82
         }
83 83
 
84
-        if (! is_int($data)) {
84
+        if ( ! is_int($data)) {
85 85
             throw NonVisitableTypeException::fromDataAndType($data, $type);
86 86
         }
87 87
 
@@ -97,7 +97,7 @@  discard block
 block discarded – undo
97 97
             return null;
98 98
         }
99 99
 
100
-        if (! is_float($data)) {
100
+        if ( ! is_float($data)) {
101 101
             throw NonVisitableTypeException::fromDataAndType($data, $type);
102 102
         }
103 103
 
Please login to merge, or discard this patch.
src/Metadata/Driver/DocBlockDriver/DocBlockTypeResolver.php 1 patch
Spacing   +13 added lines, -13 removed lines patch added patch discarded remove patch
@@ -56,7 +56,7 @@  discard block
 block discarded – undo
56 56
      */
57 57
     public function getPropertyDocblockTypeHint(\ReflectionProperty $reflectionProperty): ?string
58 58
     {
59
-        if (!$reflectionProperty->getDocComment()) {
59
+        if ( ! $reflectionProperty->getDocComment()) {
60 60
             return null;
61 61
         }
62 62
 
@@ -91,25 +91,25 @@  discard block
 block discarded – undo
91 91
         if ($type instanceof ArrayTypeNode) {
92 92
             $resolvedType = $this->resolveTypeFromTypeNode($type->type, $reflectionProperty);
93 93
 
94
-            return 'array<' . $resolvedType . '>';
94
+            return 'array<'.$resolvedType.'>';
95 95
         }
96 96
 
97 97
         // Generic array syntax: array<Product> | array<\Foo\Bar\Product> | array<int,Product>
98 98
         if ($type instanceof GenericTypeNode) {
99 99
             if ($this->isSimpleType($type->type, 'array')) {
100
-                $resolvedTypes = array_map(function (TypeNode $node) use ($reflectionProperty) {
100
+                $resolvedTypes = array_map(function(TypeNode $node) use ($reflectionProperty) {
101 101
                     return $this->resolveTypeFromTypeNode($node, $reflectionProperty);
102 102
                 }, $type->genericTypes);
103 103
 
104
-                return 'array<' . implode(',', $resolvedTypes) . '>';
104
+                return 'array<'.implode(',', $resolvedTypes).'>';
105 105
             }
106 106
 
107 107
             if ($this->isSimpleType($type->type, 'list')) {
108
-                $resolvedTypes = array_map(function (TypeNode $node) use ($reflectionProperty) {
108
+                $resolvedTypes = array_map(function(TypeNode $node) use ($reflectionProperty) {
109 109
                     return $this->resolveTypeFromTypeNode($node, $reflectionProperty);
110 110
                 }, $type->genericTypes);
111 111
 
112
-                return 'array<int, ' . implode(',', $resolvedTypes) . '>';
112
+                return 'array<int, '.implode(',', $resolvedTypes).'>';
113 113
             }
114 114
 
115 115
             throw new \InvalidArgumentException(sprintf("Can't use non-array generic type %s for collection in %s:%s", (string) $type->type, $reflectionProperty->getDeclaringClass()->getName(), $reflectionProperty->getName()));
@@ -132,7 +132,7 @@  discard block
 block discarded – undo
132 132
             return [];
133 133
         }
134 134
 
135
-        return array_merge(...array_map(static function (VarTagValueNode $node) {
135
+        return array_merge(...array_map(static function(VarTagValueNode $node) {
136 136
             if ($node->type instanceof UnionTypeNode) {
137 137
                 return $node->type->types;
138 138
             }
@@ -150,7 +150,7 @@  discard block
 block discarded – undo
150 150
      */
151 151
     private function filterNullFromTypes(array $types): array
152 152
     {
153
-        return array_values(array_filter(array_map(function (TypeNode $node) {
153
+        return array_values(array_filter(array_map(function(TypeNode $node) {
154 154
             return $this->isNullType($node) ? null : $node;
155 155
         }, $types)));
156 156
     }
@@ -193,7 +193,7 @@  discard block
 block discarded – undo
193 193
      */
194 194
     private function resolveTypeFromTypeNode(TypeNode $typeNode, \ReflectionProperty $reflectionProperty): string
195 195
     {
196
-        if (!($typeNode instanceof IdentifierTypeNode)) {
196
+        if ( ! ($typeNode instanceof IdentifierTypeNode)) {
197 197
             throw new \InvalidArgumentException(sprintf("Can't use unsupported type %s for collection in %s:%s", (string) $typeNode, $reflectionProperty->getDeclaringClass()->getName(), $reflectionProperty->getName()));
198 198
         }
199 199
 
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
             return $typeHint;
207 207
         }
208 208
 
209
-        $expandedClassName = $declaringClass->getNamespaceName() . '\\' . $typeHint;
209
+        $expandedClassName = $declaringClass->getNamespaceName().'\\'.$typeHint;
210 210
         if ($this->isClassOrInterface($expandedClassName)) {
211 211
             return $expandedClassName;
212 212
         }
@@ -232,7 +232,7 @@  discard block
 block discarded – undo
232 232
 
233 233
     private function endsWith(string $statementClassToCheck, string $typeHintToSearchFor): bool
234 234
     {
235
-        $typeHintToSearchFor = '\\' . $typeHintToSearchFor;
235
+        $typeHintToSearchFor = '\\'.$typeHintToSearchFor;
236 236
 
237 237
         return substr($statementClassToCheck, -strlen($typeHintToSearchFor)) === $typeHintToSearchFor;
238 238
     }
@@ -253,7 +253,7 @@  discard block
 block discarded – undo
253 253
         preg_match_all(self::GROUP_USE_STATEMENTS_REGEX, $classContents, $foundGroupUseStatements);
254 254
         for ($useStatementIndex = 0; $useStatementIndex < count($foundGroupUseStatements[0]); $useStatementIndex++) {
255 255
             foreach (explode(',', $foundGroupUseStatements[2][$useStatementIndex]) as $singleUseStatement) {
256
-                $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]) . trim($singleUseStatement);
256
+                $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]).trim($singleUseStatement);
257 257
             }
258 258
         }
259 259
 
@@ -286,7 +286,7 @@  discard block
 block discarded – undo
286 286
 
287 287
     private function resolveType(string $typeHint, \ReflectionProperty $reflectionProperty): string
288 288
     {
289
-        if (!$this->hasGlobalNamespacePrefix($typeHint) && !$this->isPrimitiveType($typeHint)) {
289
+        if ( ! $this->hasGlobalNamespacePrefix($typeHint) && ! $this->isPrimitiveType($typeHint)) {
290 290
             $typeHint = $this->expandClassNameUsingUseStatements($typeHint, $this->getDeclaringClassOrTrait($reflectionProperty), $reflectionProperty);
291 291
         }
292 292
 
Please login to merge, or discard this patch.
src/Handler/SymfonyUidHandler.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -70,7 +70,7 @@
 block discarded – undo
70 70
                     'direction' => GraphNavigatorInterface::DIRECTION_DESERIALIZATION,
71 71
                     'format'    => $format,
72 72
                     'type'      => $class,
73
-                    'method'    => 'deserializeUidFrom' . ucfirst($format),
73
+                    'method'    => 'deserializeUidFrom'.ucfirst($format),
74 74
                 ];
75 75
             }
76 76
         }
Please login to merge, or discard this patch.
src/Handler/FormErrorHandler.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -43,7 +43,7 @@  discard block
 block discarded – undo
43 43
                 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION,
44 44
                 'type' => FormInterface::class,
45 45
                 'format' => $format,
46
-                'method' => 'serializeFormTo' . ucfirst($format),
46
+                'method' => 'serializeFormTo'.ucfirst($format),
47 47
             ];
48 48
             $methods[] = [
49 49
                 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION,
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
 
58 58
     public function __construct(?object $translator = null, string $translationDomain = 'validators')
59 59
     {
60
-        if (null !== $translator && (!$translator instanceof TranslatorInterface && !$translator instanceof TranslatorContract)) {
60
+        if (null !== $translator && ( ! $translator instanceof TranslatorInterface && ! $translator instanceof TranslatorContract)) {
61 61
             throw new \InvalidArgumentException(sprintf(
62 62
                 'The first argument passed to %s must be instance of %s or %s, %s given',
63 63
                 self::class,
Please login to merge, or discard this patch.