@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | |
| 59 | 59 | public function visitString($data, array $type, Context $context) |
| 60 | 60 | { |
| 61 | - $data = (string)$data; |
|
| 61 | + $data = (string) $data; |
|
| 62 | 62 | |
| 63 | 63 | if (null === $this->result) { |
| 64 | 64 | $this->result = $data; |
@@ -69,7 +69,7 @@ discard block |
||
| 69 | 69 | |
| 70 | 70 | public function visitBoolean($data, array $type, Context $context) |
| 71 | 71 | { |
| 72 | - $data = (Boolean)$data; |
|
| 72 | + $data = (Boolean) $data; |
|
| 73 | 73 | |
| 74 | 74 | if (null === $this->result) { |
| 75 | 75 | $this->result = $data; |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | |
| 81 | 81 | public function visitInteger($data, array $type, Context $context) |
| 82 | 82 | { |
| 83 | - $data = (integer)$data; |
|
| 83 | + $data = (integer) $data; |
|
| 84 | 84 | |
| 85 | 85 | if (null === $this->result) { |
| 86 | 86 | $this->result = $data; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | public function visitDouble($data, array $type, Context $context) |
| 93 | 93 | { |
| 94 | - $data = (double)$data; |
|
| 94 | + $data = (double) $data; |
|
| 95 | 95 | |
| 96 | 96 | if (null === $this->result) { |
| 97 | 97 | $this->result = $data; |
@@ -102,12 +102,12 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | public function visitArray($data, array $type, Context $context) |
| 104 | 104 | { |
| 105 | - if (!is_array($data)) { |
|
| 105 | + if ( ! is_array($data)) { |
|
| 106 | 106 | throw new RuntimeException(sprintf('Expected array, but got %s: %s', gettype($data), json_encode($data))); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | // If no further parameters were given, keys/values are just passed as is. |
| 110 | - if (!$type['params']) { |
|
| 110 | + if ( ! $type['params']) { |
|
| 111 | 111 | if (null === $this->result) { |
| 112 | 112 | $this->result = $data; |
| 113 | 113 | } |
@@ -166,15 +166,15 @@ discard block |
||
| 166 | 166 | return; |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | - if (!is_array($data)) { |
|
| 169 | + if ( ! is_array($data)) { |
|
| 170 | 170 | throw new RuntimeException(sprintf('Invalid data "%s"(%s), expected "%s".', $data, $metadata->type['name'], $metadata->reflection->class)); |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | - if (!array_key_exists($name, $data)) { |
|
| 173 | + if ( ! array_key_exists($name, $data)) { |
|
| 174 | 174 | return; |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | - if (!$metadata->type) { |
|
| 177 | + if ( ! $metadata->type) { |
|
| 178 | 178 | throw new RuntimeException(sprintf('You must define a type for %s::$%s.', $metadata->reflection->class, $metadata->name)); |
| 179 | 179 | } |
| 180 | 180 | |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | |
| 115 | 115 | private function assertMutable() |
| 116 | 116 | { |
| 117 | - if (!$this->initialized) { |
|
| 117 | + if ( ! $this->initialized) { |
|
| 118 | 118 | return; |
| 119 | 119 | } |
| 120 | 120 | |
@@ -169,8 +169,8 @@ discard block |
||
| 169 | 169 | throw new \LogicException('The groups must not be empty.'); |
| 170 | 170 | } |
| 171 | 171 | |
| 172 | - $this->attributes->set('groups', (array)$groups); |
|
| 173 | - $this->addExclusionStrategy(new GroupsExclusionStrategy((array)$groups)); |
|
| 172 | + $this->attributes->set('groups', (array) $groups); |
|
| 173 | + $this->addExclusionStrategy(new GroupsExclusionStrategy((array) $groups)); |
|
| 174 | 174 | |
| 175 | 175 | return $this; |
| 176 | 176 | } |
@@ -190,7 +190,7 @@ discard block |
||
| 190 | 190 | */ |
| 191 | 191 | public function setSerializeNull($bool) |
| 192 | 192 | { |
| 193 | - $this->serializeNull = (boolean)$bool; |
|
| 193 | + $this->serializeNull = (boolean) $bool; |
|
| 194 | 194 | |
| 195 | 195 | return $this; |
| 196 | 196 | } |
@@ -230,7 +230,7 @@ discard block |
||
| 230 | 230 | { |
| 231 | 231 | $metadata = $this->metadataStack->pop(); |
| 232 | 232 | |
| 233 | - if (!$metadata instanceof PropertyMetadata) { |
|
| 233 | + if ( ! $metadata instanceof PropertyMetadata) { |
|
| 234 | 234 | throw new RuntimeException('Context metadataStack not working well'); |
| 235 | 235 | } |
| 236 | 236 | } |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | { |
| 240 | 240 | $metadata = $this->metadataStack->pop(); |
| 241 | 241 | |
| 242 | - if (!$metadata instanceof ClassMetadata) { |
|
| 242 | + if ( ! $metadata instanceof ClassMetadata) { |
|
| 243 | 243 | throw new RuntimeException('Context metadataStack not working well'); |
| 244 | 244 | } |
| 245 | 245 | } |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | */ |
| 255 | 255 | public function getCurrentPath() |
| 256 | 256 | { |
| 257 | - if (!$this->metadataStack) { |
|
| 257 | + if ( ! $this->metadataStack) { |
|
| 258 | 258 | return array(); |
| 259 | 259 | } |
| 260 | 260 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | // Locate possible ObjectManager |
| 52 | 52 | $objectManager = $this->managerRegistry->getManagerForClass($metadata->name); |
| 53 | 53 | |
| 54 | - if (!$objectManager) { |
|
| 54 | + if ( ! $objectManager) { |
|
| 55 | 55 | // No ObjectManager found, proceed with normal deserialization |
| 56 | 56 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
| 57 | 57 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | // Managed entity, check for proxy load |
| 68 | - if (!is_array($data)) { |
|
| 68 | + if ( ! is_array($data)) { |
|
| 69 | 69 | // Single identifier, load proxy |
| 70 | 70 | return $objectManager->getReference($metadata->name, $data); |
| 71 | 71 | } |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | $identifierList = array(); |
| 76 | 76 | |
| 77 | 77 | foreach ($classMetadata->getIdentifierFieldNames() as $name) { |
| 78 | - if (!array_key_exists($name, $data)) { |
|
| 78 | + if ( ! array_key_exists($name, $data)) { |
|
| 79 | 79 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
| 80 | 80 | } |
| 81 | 81 | |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | private function getErrorMessage(FormError $error) |
| 123 | 123 | { |
| 124 | 124 | |
| 125 | - if ($this->translator === null){ |
|
| 125 | + if ($this->translator === null) { |
|
| 126 | 126 | return $error->getMessage(); |
| 127 | 127 | } |
| 128 | 128 | |
@@ -122,7 +122,7 @@ |
||
| 122 | 122 | private function getErrorMessage(FormError $error) |
| 123 | 123 | { |
| 124 | 124 | |
| 125 | - if ($this->translator === null){ |
|
| 125 | + if ($this->translator === null) { |
|
| 126 | 126 | return $error->getMessage(); |
| 127 | 127 | } |
| 128 | 128 | |