@@ -99,7 +99,7 @@ |
||
| 99 | 99 | private function matchSimpleType(mixed $data, array $type, Context $context): mixed |
| 100 | 100 | { |
| 101 | 101 | foreach ($type['params'][0] as $possibleType) { |
| 102 | - if ($this->isPrimitiveType($possibleType['name']) && !$this->testPrimitive($data, $possibleType['name'], $context->getFormat())) { |
|
| 102 | + if ($this->isPrimitiveType($possibleType['name']) && ! $this->testPrimitive($data, $possibleType['name'], $context->getFormat())) { |
|
| 103 | 103 | continue; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -20,8 +20,8 @@ discard block |
||
| 20 | 20 | { |
| 21 | 21 | assert($doctrineMetadata instanceof ORMClassMetadata || $doctrineMetadata instanceof ODMClassMetadata); |
| 22 | 22 | if ( |
| 23 | - empty($classMetadata->discriminatorMap) && !$classMetadata->discriminatorDisabled |
|
| 24 | - && !empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
| 23 | + empty($classMetadata->discriminatorMap) && ! $classMetadata->discriminatorDisabled |
|
| 24 | + && ! empty($doctrineMetadata->discriminatorMap) && $doctrineMetadata->isRootEntity() |
|
| 25 | 25 | ) { |
| 26 | 26 | $classMetadata->setDiscriminator( |
| 27 | 27 | $doctrineMetadata->discriminatorColumn['name'], |
@@ -49,11 +49,11 @@ discard block |
||
| 49 | 49 | // For inheritance schemes, we cannot add any type as we would only add the super-type of the hierarchy. |
| 50 | 50 | // On serialization, this would lead to only the supertype being serialized, and properties of subtypes |
| 51 | 51 | // being ignored. |
| 52 | - if ($targetMetadata instanceof ODMClassMetadata && !$targetMetadata->isInheritanceTypeNone()) { |
|
| 52 | + if ($targetMetadata instanceof ODMClassMetadata && ! $targetMetadata->isInheritanceTypeNone()) { |
|
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
| 56 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
| 57 | 57 | $targetEntity = sprintf('ArrayCollection<%s>', $targetEntity); |
| 58 | 58 | } |
| 59 | 59 | |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | */ |
| 60 | 60 | private function reorderTypes(array $types): array |
| 61 | 61 | { |
| 62 | - uasort($types, static function ($a, $b) { |
|
| 62 | + uasort($types, static function($a, $b) { |
|
| 63 | 63 | $order = ['null' => 0, 'true' => 1, 'false' => 2, 'bool' => 3, 'int' => 4, 'float' => 5, 'array' => 6, 'string' => 7]; |
| 64 | 64 | |
| 65 | 65 | return ($order[$a['name']] ?? 8) <=> ($order[$b['name']] ?? 8); |
@@ -159,7 +159,7 @@ discard block |
||
| 159 | 159 | */ |
| 160 | 160 | private function shouldTypeHint(?ReflectionType $reflectionType): bool |
| 161 | 161 | { |
| 162 | - if (!$reflectionType instanceof ReflectionNamedType) { |
|
| 162 | + if ( ! $reflectionType instanceof ReflectionNamedType) { |
|
| 163 | 163 | return false; |
| 164 | 164 | } |
| 165 | 165 | |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | */ |
| 177 | 177 | private function shouldTypeHintUnion(?ReflectionType $reflectionType) |
| 178 | 178 | { |
| 179 | - if (!$reflectionType instanceof \ReflectionUnionType) { |
|
| 179 | + if ( ! $reflectionType instanceof \ReflectionUnionType) { |
|
| 180 | 180 | return false; |
| 181 | 181 | } |
| 182 | 182 | |
@@ -25,10 +25,10 @@ discard block |
||
| 25 | 25 | |
| 26 | 26 | switch ($direction) { |
| 27 | 27 | case GraphNavigatorInterface::DIRECTION_DESERIALIZATION: |
| 28 | - return 'deserialize' . $type . 'From' . $format; |
|
| 28 | + return 'deserialize'.$type.'From'.$format; |
|
| 29 | 29 | |
| 30 | 30 | case GraphNavigatorInterface::DIRECTION_SERIALIZATION: |
| 31 | - return 'serialize' . $type . 'To' . $format; |
|
| 31 | + return 'serialize'.$type.'To'.$format; |
|
| 32 | 32 | |
| 33 | 33 | default: |
| 34 | 34 | throw new LogicException(sprintf('The direction %s does not exist; see GraphNavigatorInterface::DIRECTION_??? constants.', json_encode($direction))); |
@@ -43,7 +43,7 @@ discard block |
||
| 43 | 43 | public function registerSubscribingHandler(SubscribingHandlerInterface $handler): void |
| 44 | 44 | { |
| 45 | 45 | foreach ($handler->getSubscribingMethods() as $methodData) { |
| 46 | - if (!isset($methodData['type'], $methodData['format'])) { |
|
| 46 | + if ( ! isset($methodData['type'], $methodData['format'])) { |
|
| 47 | 47 | throw new RuntimeException(sprintf('For each subscribing method a "type" and "format" attribute must be given, but only got "%s" for %s.', implode('" and "', array_keys($methodData)), \get_class($handler))); |
| 48 | 48 | } |
| 49 | 49 | |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | */ |
| 27 | 27 | public function __construct($container, array $handlers = []) |
| 28 | 28 | { |
| 29 | - if (!$container instanceof PsrContainerInterface && !$container instanceof ContainerInterface) { |
|
| 29 | + if ( ! $container instanceof PsrContainerInterface && ! $container instanceof ContainerInterface) { |
|
| 30 | 30 | throw new InvalidArgumentException(sprintf('The container must be an instance of %s or %s (%s given).', PsrContainerInterface::class, ContainerInterface::class, \is_object($container) ? \get_class($container) : \gettype($container))); |
| 31 | 31 | } |
| 32 | 32 | |