@@ -139,7 +139,7 @@ discard block |
||
| 139 | 139 | |
| 140 | 140 | switch ($type['name']) { |
| 141 | 141 | case 'NULL': |
| 142 | - if (!$this->shouldSerializeNull && !$this->isRootNullAllowed()) { |
|
| 142 | + if ( ! $this->shouldSerializeNull && ! $this->isRootNullAllowed()) { |
|
| 143 | 143 | throw new NotAcceptableException(); |
| 144 | 144 | } |
| 145 | 145 | |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | case 'resource': |
| 170 | 170 | $msg = 'Resources are not supported in serialized data.'; |
| 171 | 171 | if (null !== $path = $this->context->getPath()) { |
| 172 | - $msg .= ' Path: ' . $path; |
|
| 172 | + $msg .= ' Path: '.$path; |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | throw new RuntimeException($msg); |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | throw new ExcludedClassException(); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - if (!is_object($data)) { |
|
| 239 | - throw new InvalidArgumentException('Value at ' . $this->context->getPath() . ' is expected to be an object of class ' . $type['name'] . ' but is of type ' . gettype($data)); |
|
| 238 | + if ( ! is_object($data)) { |
|
| 239 | + throw new InvalidArgumentException('Value at '.$this->context->getPath().' is expected to be an object of class '.$type['name'].' but is of type '.gettype($data)); |
|
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | $this->context->pushClassMetadata($metadata); |
@@ -10,9 +10,9 @@ discard block |
||
| 10 | 10 | { |
| 11 | 11 | private function loadAnnotationParameters(array $vars): void |
| 12 | 12 | { |
| 13 | - if (!array_key_exists('values', $vars)) { |
|
| 13 | + if ( ! array_key_exists('values', $vars)) { |
|
| 14 | 14 | $values = []; |
| 15 | - } elseif (!is_array($vars['values'])) { |
|
| 15 | + } elseif ( ! is_array($vars['values'])) { |
|
| 16 | 16 | $values = ['value' => $vars['values']]; |
| 17 | 17 | } else { |
| 18 | 18 | $values = $vars['values']; |
@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | } |
| 31 | 31 | |
| 32 | 32 | foreach ($vars as $key => $value) { |
| 33 | - if (!property_exists(static::class, $key)) { |
|
| 33 | + if ( ! property_exists(static::class, $key)) { |
|
| 34 | 34 | throw new InvalidArgumentException(sprintf('Unknown property "%s" on annotation "%s".', $key, static::class)); |
| 35 | 35 | } |
| 36 | 36 | |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | public function getFilters() |
| 36 | 36 | { |
| 37 | 37 | return [ |
| 38 | - new TwigFilter($this->serializationFunctionsPrefix . 'serialize', [$this, 'serialize']), |
|
| 38 | + new TwigFilter($this->serializationFunctionsPrefix.'serialize', [$this, 'serialize']), |
|
| 39 | 39 | ]; |
| 40 | 40 | } |
| 41 | 41 | |
@@ -47,7 +47,7 @@ discard block |
||
| 47 | 47 | public function getFunctions() |
| 48 | 48 | { |
| 49 | 49 | return [ |
| 50 | - new TwigFunction($this->serializationFunctionsPrefix . 'serialization_context', '\JMS\Serializer\SerializationContext::create'), |
|
| 50 | + new TwigFunction($this->serializationFunctionsPrefix.'serialization_context', '\JMS\Serializer\SerializationContext::create'), |
|
| 51 | 51 | ]; |
| 52 | 52 | } |
| 53 | 53 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | public function getFilters() |
| 21 | 21 | { |
| 22 | 22 | return [ |
| 23 | - new TwigFilter($this->serializationFunctionsPrefix . 'serialize', [SerializerRuntimeHelper::class, 'serialize']), |
|
| 23 | + new TwigFilter($this->serializationFunctionsPrefix.'serialize', [SerializerRuntimeHelper::class, 'serialize']), |
|
| 24 | 24 | ]; |
| 25 | 25 | } |
| 26 | 26 | |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | public function getFunctions() |
| 33 | 33 | { |
| 34 | 34 | return [ |
| 35 | - new TwigFunction($this->serializationFunctionsPrefix . 'serialization_context', '\JMS\Serializer\SerializationContext::create'), |
|
| 35 | + new TwigFunction($this->serializationFunctionsPrefix.'serialization_context', '\JMS\Serializer\SerializationContext::create'), |
|
| 36 | 36 | ]; |
| 37 | 37 | } |
| 38 | 38 | } |
@@ -25,7 +25,7 @@ |
||
| 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 | } |
@@ -119,7 +119,7 @@ discard block |
||
| 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 |
||
| 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 | } |
@@ -28,7 +28,7 @@ |
||
| 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 | |
@@ -49,7 +49,7 @@ discard block |
||
| 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 |
||
| 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 |
||
| 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 |
||
| 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 | |
@@ -70,7 +70,7 @@ |
||
| 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 | } |