@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | |
| 145 | 145 | case 'bool': |
| 146 | 146 | case 'boolean': |
| 147 | - return !is_array($data) && (string) (bool) $data === (string) $data; |
|
| 147 | + return ! is_array($data) && (string) (bool) $data === (string) $data; |
|
| 148 | 148 | |
| 149 | 149 | case 'true': |
| 150 | 150 | return true === $data; |
@@ -153,7 +153,7 @@ discard block |
||
| 153 | 153 | return false === $data; |
| 154 | 154 | |
| 155 | 155 | case 'string': |
| 156 | - return !is_array($data) && !is_object($data); |
|
| 156 | + return ! is_array($data) && ! is_object($data); |
|
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | return false; |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | 'direction' => GraphNavigatorInterface::DIRECTION_SERIALIZATION, |
| 33 | 33 | 'type' => $type, |
| 34 | 34 | 'format' => $format, |
| 35 | - 'method' => $method . 'To' . $format, |
|
| 35 | + 'method' => $method.'To'.$format, |
|
| 36 | 36 | ]; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public function serializeListToXml(XmlSerializationVisitor $visitor, ConstraintViolationList $list): void |
| 44 | 44 | { |
| 45 | 45 | $currentNode = $visitor->getCurrentNode(); |
| 46 | - if (!$currentNode) { |
|
| 46 | + if ( ! $currentNode) { |
|
| 47 | 47 | $visitor->createRoot(); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -67,7 +67,7 @@ discard block |
||
| 67 | 67 | $violationNode = $visitor->getDocument()->createElement('violation'); |
| 68 | 68 | |
| 69 | 69 | $parent = $visitor->getCurrentNode(); |
| 70 | - if (!$parent) { |
|
| 70 | + if ( ! $parent) { |
|
| 71 | 71 | $visitor->setCurrentAndRootNode($violationNode); |
| 72 | 72 | } else { |
| 73 | 73 | $parent->appendChild($violationNode); |
@@ -176,22 +176,22 @@ discard block |
||
| 176 | 176 | $class = $this->getReflection()->getDeclaringClass(); |
| 177 | 177 | |
| 178 | 178 | if (empty($getter)) { |
| 179 | - if ($class->hasMethod('get' . $this->name) && $class->getMethod('get' . $this->name)->isPublic()) { |
|
| 180 | - $getter = 'get' . $this->name; |
|
| 181 | - } elseif ($class->hasMethod('is' . $this->name) && $class->getMethod('is' . $this->name)->isPublic()) { |
|
| 182 | - $getter = 'is' . $this->name; |
|
| 183 | - } elseif ($class->hasMethod('has' . $this->name) && $class->getMethod('has' . $this->name)->isPublic()) { |
|
| 184 | - $getter = 'has' . $this->name; |
|
| 179 | + if ($class->hasMethod('get'.$this->name) && $class->getMethod('get'.$this->name)->isPublic()) { |
|
| 180 | + $getter = 'get'.$this->name; |
|
| 181 | + } elseif ($class->hasMethod('is'.$this->name) && $class->getMethod('is'.$this->name)->isPublic()) { |
|
| 182 | + $getter = 'is'.$this->name; |
|
| 183 | + } elseif ($class->hasMethod('has'.$this->name) && $class->getMethod('has'.$this->name)->isPublic()) { |
|
| 184 | + $getter = 'has'.$this->name; |
|
| 185 | 185 | } else { |
| 186 | - throw new InvalidMetadataException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get' . ucfirst($this->name), 'is' . ucfirst($this->name), 'has' . ucfirst($this->name), $this->class, $this->name)); |
|
| 186 | + throw new InvalidMetadataException(sprintf('There is neither a public %s method, nor a public %s method, nor a public %s method in class %s. Please specify which public method should be used for retrieving the value of the property %s.', 'get'.ucfirst($this->name), 'is'.ucfirst($this->name), 'has'.ucfirst($this->name), $this->class, $this->name)); |
|
| 187 | 187 | } |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | - if (empty($setter) && !$this->readOnly) { |
|
| 191 | - if ($class->hasMethod('set' . $this->name) && $class->getMethod('set' . $this->name)->isPublic()) { |
|
| 192 | - $setter = 'set' . $this->name; |
|
| 190 | + if (empty($setter) && ! $this->readOnly) { |
|
| 191 | + if ($class->hasMethod('set'.$this->name) && $class->getMethod('set'.$this->name)->isPublic()) { |
|
| 192 | + $setter = 'set'.$this->name; |
|
| 193 | 193 | } else { |
| 194 | - throw new InvalidMetadataException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set' . ucfirst($this->name), $this->class, $this->name)); |
|
| 194 | + throw new InvalidMetadataException(sprintf('There is no public %s method in class %s. Please specify which public method should be used for setting the value of the property %s.', 'set'.ucfirst($this->name), $this->class, $this->name)); |
|
| 195 | 195 | } |
| 196 | 196 | } |
| 197 | 197 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | return is_array($type) |
| 217 | 217 | && 'array' === $type['name'] |
| 218 | 218 | && isset($type['params'][0]) |
| 219 | - && !isset($type['params'][1]); |
|
| 219 | + && ! isset($type['params'][1]); |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | /** |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | if ($type instanceof ArrayTypeNode) { |
| 127 | 127 | $resolvedType = $this->resolveTypeFromTypeNode($type->type, $reflector); |
| 128 | 128 | |
| 129 | - return 'array<' . $resolvedType . '>'; |
|
| 129 | + return 'array<'.$resolvedType.'>'; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | // Generic array syntax: array<Product> | array<\Foo\Bar\Product> | array<int,Product> |
@@ -134,13 +134,13 @@ discard block |
||
| 134 | 134 | if ($this->isSimpleType($type->type, 'array')) { |
| 135 | 135 | $resolvedTypes = array_map(fn (TypeNode $node) => $this->resolveTypeFromTypeNode($node, $reflector), $type->genericTypes); |
| 136 | 136 | |
| 137 | - return 'array<' . implode(',', $resolvedTypes) . '>'; |
|
| 137 | + return 'array<'.implode(',', $resolvedTypes).'>'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | if ($this->isSimpleType($type->type, 'list')) { |
| 141 | 141 | $resolvedTypes = array_map(fn (TypeNode $node) => $this->resolveTypeFromTypeNode($node, $reflector), $type->genericTypes); |
| 142 | 142 | |
| 143 | - return 'list<' . implode(',', $resolvedTypes) . '>'; |
|
| 143 | + return 'list<'.implode(',', $resolvedTypes).'>'; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | throw new \InvalidArgumentException(sprintf("Can't use non-array generic type %s for collection in %s:%s", (string) $type->type, $reflector->getDeclaringClass()->getName(), $reflector->getName())); |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | return []; |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | - return array_merge(...array_map(static function ($node) { |
|
| 166 | + return array_merge(...array_map(static function($node) { |
|
| 167 | 167 | if ($node->type instanceof UnionTypeNode) { |
| 168 | 168 | return $node->type->types; |
| 169 | 169 | } |
@@ -248,7 +248,7 @@ discard block |
||
| 248 | 248 | */ |
| 249 | 249 | private function resolveTypeFromTypeNode(TypeNode $typeNode, $reflector): string |
| 250 | 250 | { |
| 251 | - if (!($typeNode instanceof IdentifierTypeNode)) { |
|
| 251 | + if ( ! ($typeNode instanceof IdentifierTypeNode)) { |
|
| 252 | 252 | throw new \InvalidArgumentException(sprintf("Can't use unsupported type %s for collection in %s:%s", (string) $typeNode, $reflector->getDeclaringClass()->getName(), $reflector->getName())); |
| 253 | 253 | } |
| 254 | 254 | |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | private function expandClassNameUsingUseStatements(string $typeHint, \ReflectionClass $declaringClass, $reflector): string |
| 262 | 262 | { |
| 263 | - $expandedClassName = $declaringClass->getNamespaceName() . '\\' . $typeHint; |
|
| 263 | + $expandedClassName = $declaringClass->getNamespaceName().'\\'.$typeHint; |
|
| 264 | 264 | if ($this->isClassOrInterface($expandedClassName)) { |
| 265 | 265 | return $expandedClassName; |
| 266 | 266 | } |
@@ -298,7 +298,7 @@ discard block |
||
| 298 | 298 | |
| 299 | 299 | private function endsWith(string $statementClassToCheck, string $typeHintToSearchFor): bool |
| 300 | 300 | { |
| 301 | - $typeHintToSearchFor = '\\' . $typeHintToSearchFor; |
|
| 301 | + $typeHintToSearchFor = '\\'.$typeHintToSearchFor; |
|
| 302 | 302 | |
| 303 | 303 | return substr($statementClassToCheck, -strlen($typeHintToSearchFor)) === $typeHintToSearchFor; |
| 304 | 304 | } |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | preg_match_all(self::GROUP_USE_STATEMENTS_REGEX, $classContents, $foundGroupUseStatements); |
| 320 | 320 | for ($useStatementIndex = 0; $useStatementIndex < count($foundGroupUseStatements[0]); $useStatementIndex++) { |
| 321 | 321 | foreach (explode(',', $foundGroupUseStatements[2][$useStatementIndex]) as $singleUseStatement) { |
| 322 | - $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]) . trim($singleUseStatement); |
|
| 322 | + $foundUseStatements[] = trim($foundGroupUseStatements[1][$useStatementIndex]).trim($singleUseStatement); |
|
| 323 | 323 | } |
| 324 | 324 | } |
| 325 | 325 | |
@@ -358,7 +358,7 @@ discard block |
||
| 358 | 358 | */ |
| 359 | 359 | private function resolveType(string $typeHint, $reflector): string |
| 360 | 360 | { |
| 361 | - if (!$this->hasGlobalNamespacePrefix($typeHint) && !$this->isPrimitiveType($typeHint)) { |
|
| 361 | + if ( ! $this->hasGlobalNamespacePrefix($typeHint) && ! $this->isPrimitiveType($typeHint)) { |
|
| 362 | 362 | $typeHint = $this->expandClassNameUsingUseStatements($typeHint, $this->getDeclaringClassOrTrait($reflector), $reflector); |
| 363 | 363 | } |
| 364 | 364 | |
@@ -376,15 +376,15 @@ discard block |
||
| 376 | 376 | private function resolveTypeFromDocblock($reflector): array |
| 377 | 377 | { |
| 378 | 378 | $docComment = $reflector->getDocComment(); |
| 379 | - if (!$docComment && PHP_VERSION_ID >= 80000 && $reflector instanceof \ReflectionProperty && $reflector->isPromoted()) { |
|
| 379 | + if ( ! $docComment && PHP_VERSION_ID >= 80000 && $reflector instanceof \ReflectionProperty && $reflector->isPromoted()) { |
|
| 380 | 380 | $constructor = $reflector->getDeclaringClass()->getConstructor(); |
| 381 | - if (!$constructor) { |
|
| 381 | + if ( ! $constructor) { |
|
| 382 | 382 | return []; |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | $docComment = $constructor->getDocComment(); |
| 386 | 386 | |
| 387 | - if (!$docComment) { |
|
| 387 | + if ( ! $docComment) { |
|
| 388 | 388 | return []; |
| 389 | 389 | } |
| 390 | 390 | |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | return $this->flattenParamTagValueTypes($reflector->getName(), $phpDocNode->getParamTagValues()); |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | - if (!$docComment) { |
|
| 397 | + if ( ! $docComment) { |
|
| 398 | 398 | return []; |
| 399 | 399 | } |
| 400 | 400 | |
@@ -21,8 +21,8 @@ discard block |
||
| 21 | 21 | { |
| 22 | 22 | assert($doctrineMetadata instanceof ORMClassMetadata || $doctrineMetadata instanceof ODMClassMetadata); |
| 23 | 23 | if ( |
| 24 | - empty($classMetadata->discriminatorMap) && !$classMetadata->discriminatorDisabled |
|
| 25 | - && !empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
| 24 | + empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled |
|
| 25 | + && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
| 26 | 26 | ) { |
| 27 | 27 | if ($doctrineMetadata->discriminatorColumn instanceof DiscriminatorColumnMapping) { |
| 28 | 28 | // Doctrine 3.1+ |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy. |
| 60 | 60 | // On serialization, this would lead to only the supertype being serialized, and properties of subtypes |
| 61 | 61 | // being ignored. |
| 62 | - if ($targetMetadata instanceof ODMClassMetadata && !$targetMetadata->isInheritanceTypeNone()) { |
|
| 62 | + if ($targetMetadata instanceof ODMClassMetadata && ! $targetMetadata->isInheritanceTypeNone()) { |
|
| 63 | 63 | return; |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
| 66 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
| 67 | 67 | $targetEntity = sprintf('ArrayCollection<%s>', $targetEntity); |
| 68 | 68 | } |
| 69 | 69 | |