@@ -56,7 +56,7 @@ |
||
56 | 56 | ? null |
57 | 57 | : $context->attributes->get('validation_groups')->get(); |
58 | 58 | |
59 | - if (!$groups) { |
|
59 | + if ( ! $groups) { |
|
60 | 60 | return; |
61 | 61 | } |
62 | 62 |
@@ -38,7 +38,7 @@ |
||
38 | 38 | } |
39 | 39 | |
40 | 40 | foreach ($data as $key => $value) { |
41 | - if (!property_exists(__CLASS__, $key)) { |
|
41 | + if ( ! property_exists(__CLASS__, $key)) { |
|
42 | 42 | throw new \BadMethodCallException(sprintf('Unknown property "%s" on annotation "%s".', $key, __CLASS__)); |
43 | 43 | } |
44 | 44 | $this->{$key} = $value; |
@@ -50,7 +50,7 @@ |
||
50 | 50 | $classMetadata = $context->getMetadataFactory()->getMetadataForClass('stdClass'); |
51 | 51 | $visitor->startVisitingObject($classMetadata, $stdClass, array('name' => 'stdClass'), $context); |
52 | 52 | |
53 | - foreach ((array)$stdClass as $name => $value) { |
|
53 | + foreach ((array) $stdClass as $name => $value) { |
|
54 | 54 | $metadata = new StaticPropertyMetadata('stdClass', $name, $value); |
55 | 55 | $visitor->visitProperty($metadata, $value, $context); |
56 | 56 | } |
@@ -41,14 +41,14 @@ |
||
41 | 41 | 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, |
42 | 42 | 'type' => $type, |
43 | 43 | 'format' => $format, |
44 | - 'method' => 'serialize' . $shortName, |
|
44 | + 'method' => 'serialize'.$shortName, |
|
45 | 45 | ); |
46 | 46 | |
47 | 47 | $methods[] = array( |
48 | 48 | 'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, |
49 | 49 | 'type' => $type, |
50 | 50 | 'format' => $format, |
51 | - 'method' => 'deserialize' . $shortName, |
|
51 | + 'method' => 'deserialize'.$shortName, |
|
52 | 52 | ); |
53 | 53 | } |
54 | 54 | } |
@@ -40,7 +40,7 @@ |
||
40 | 40 | 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, |
41 | 41 | 'type' => $type, |
42 | 42 | 'format' => $format, |
43 | - 'method' => $method . 'To' . $format, |
|
43 | + 'method' => $method.'To'.$format, |
|
44 | 44 | ); |
45 | 45 | } |
46 | 46 | } |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | 'type' => $type, |
54 | 54 | 'format' => $format, |
55 | 55 | 'direction' => GraphNavigator::DIRECTION_SERIALIZATION, |
56 | - 'method' => 'serialize' . $type, |
|
56 | + 'method' => 'serialize'.$type, |
|
57 | 57 | ); |
58 | 58 | } |
59 | 59 | } |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | private function isDataXmlNull($data) |
117 | 117 | { |
118 | 118 | $attributes = $data->attributes('xsi', true); |
119 | - return isset($attributes['nil'][0]) && (string)$attributes['nil'][0] === 'true'; |
|
119 | + return isset($attributes['nil'][0]) && (string) $attributes['nil'][0] === 'true'; |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | public function deserializeDateTimeFromXml(XmlDeserializationVisitor $visitor, $data, array $type) |
@@ -175,13 +175,13 @@ discard block |
||
175 | 175 | |
176 | 176 | private function parseDateTime($data, array $type, $immutable = false) |
177 | 177 | { |
178 | - $timezone = !empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone; |
|
178 | + $timezone = ! empty($type['params'][1]) ? new \DateTimeZone($type['params'][1]) : $this->defaultTimezone; |
|
179 | 179 | $format = $this->getDeserializationFormat($type); |
180 | 180 | |
181 | 181 | if ($immutable) { |
182 | - $datetime = \DateTimeImmutable::createFromFormat($format, (string)$data, $timezone); |
|
182 | + $datetime = \DateTimeImmutable::createFromFormat($format, (string) $data, $timezone); |
|
183 | 183 | } else { |
184 | - $datetime = \DateTime::createFromFormat($format, (string)$data, $timezone); |
|
184 | + $datetime = \DateTime::createFromFormat($format, (string) $data, $timezone); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | if (false === $datetime) { |
@@ -236,15 +236,15 @@ discard block |
||
236 | 236 | $format = 'P'; |
237 | 237 | |
238 | 238 | if (0 < $dateInterval->y) { |
239 | - $format .= $dateInterval->y . 'Y'; |
|
239 | + $format .= $dateInterval->y.'Y'; |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | if (0 < $dateInterval->m) { |
243 | - $format .= $dateInterval->m . 'M'; |
|
243 | + $format .= $dateInterval->m.'M'; |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | if (0 < $dateInterval->d) { |
247 | - $format .= $dateInterval->d . 'D'; |
|
247 | + $format .= $dateInterval->d.'D'; |
|
248 | 248 | } |
249 | 249 | |
250 | 250 | if (0 < $dateInterval->h || 0 < $dateInterval->i || 0 < $dateInterval->s) { |
@@ -252,15 +252,15 @@ discard block |
||
252 | 252 | } |
253 | 253 | |
254 | 254 | if (0 < $dateInterval->h) { |
255 | - $format .= $dateInterval->h . 'H'; |
|
255 | + $format .= $dateInterval->h.'H'; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | if (0 < $dateInterval->i) { |
259 | - $format .= $dateInterval->i . 'M'; |
|
259 | + $format .= $dateInterval->i.'M'; |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | if (0 < $dateInterval->s) { |
263 | - $format .= $dateInterval->s . 'S'; |
|
263 | + $format .= $dateInterval->s.'S'; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | if ($format === 'P') { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $propertyName = $propertyMetadata->name; |
44 | 44 | if ($doctrineMetadata->hasField($propertyName) && $fieldType = $this->normalizeFieldType($doctrineMetadata->getTypeOfField($propertyName))) { |
45 | 45 | $field = $doctrineMetadata->getFieldMapping($propertyName); |
46 | - if (!empty($field['multivalue'])) { |
|
46 | + if ( ! empty($field['multivalue'])) { |
|
47 | 47 | $fieldType = 'array'; |
48 | 48 | } |
49 | 49 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | return; |
60 | 60 | } |
61 | 61 | |
62 | - if (!$doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
62 | + if ( ! $doctrineMetadata->isSingleValuedAssociation($propertyName)) { |
|
63 | 63 | $targetEntity = "ArrayCollection<{$targetEntity}>"; |
64 | 64 | } |
65 | 65 |
@@ -28,7 +28,7 @@ |
||
28 | 28 | { |
29 | 29 | $metadata = require $file; |
30 | 30 | |
31 | - if (!$metadata instanceof ClassMetadata) { |
|
31 | + if ( ! $metadata instanceof ClassMetadata) { |
|
32 | 32 | throw new RuntimeException(sprintf('The file %s was expected to return an instance of ClassMetadata, but returned %s.', $file, json_encode($metadata))); |
33 | 33 | } |
34 | 34 | if ($metadata->name !== $class->name) { |
@@ -83,7 +83,7 @@ discard block |
||
83 | 83 | $classMetadata = $this->delegate->loadMetadataForClass($class); |
84 | 84 | |
85 | 85 | // Abort if the given class is not a mapped entity |
86 | - if (!$doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) { |
|
86 | + if ( ! $doctrineMetadata = $this->tryLoadingDoctrineMetadata($class->name)) { |
|
87 | 87 | return $classMetadata; |
88 | 88 | } |
89 | 89 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | */ |
149 | 149 | protected function tryLoadingDoctrineMetadata($className) |
150 | 150 | { |
151 | - if (!$manager = $this->registry->getManagerForClass($className)) { |
|
151 | + if ( ! $manager = $this->registry->getManagerForClass($className)) { |
|
152 | 152 | return null; |
153 | 153 | } |
154 | 154 | |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | protected function normalizeFieldType($type) |
166 | 166 | { |
167 | - if (!isset($this->fieldMapping[$type])) { |
|
167 | + if ( ! isset($this->fieldMapping[$type])) { |
|
168 | 168 | return; |
169 | 169 | } |
170 | 170 |