@@ -30,7 +30,7 @@ |
||
30 | 30 | |
31 | 31 | public function __construct(array $values) |
32 | 32 | { |
33 | - if (!isset($values['value']) || !\is_string($values['value'])) { |
|
33 | + if ( ! isset($values['value']) || ! \is_string($values['value'])) { |
|
34 | 34 | throw new RuntimeException(sprintf('"value" must be a string.')); |
35 | 35 | } |
36 | 36 |
@@ -53,7 +53,7 @@ |
||
53 | 53 | $validator = $this->validator; |
54 | 54 | $groups = $context->hasAttribute('validation_groups') ? $context->getAttribute('validation_groups') : null; |
55 | 55 | |
56 | - if (!$groups) { |
|
56 | + if ( ! $groups) { |
|
57 | 57 | return; |
58 | 58 | } |
59 | 59 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | |
41 | 41 | public function enableExternalEntities(bool $enable = true): self |
42 | 42 | { |
43 | - $this->disableExternalEntities = !$enable; |
|
43 | + $this->disableExternalEntities = ! $enable; |
|
44 | 44 | return $this; |
45 | 45 | } |
46 | 46 |
@@ -23,7 +23,7 @@ |
||
23 | 23 | public function createDriver(array $metadataDirs, Reader $reader): DriverInterface |
24 | 24 | { |
25 | 25 | $driver = \call_user_func($this->callback, $metadataDirs, $reader); |
26 | - if (!$driver instanceof DriverInterface) { |
|
26 | + if ( ! $driver instanceof DriverInterface) { |
|
27 | 27 | throw new LogicException('The callback must return an instance of DriverInterface.'); |
28 | 28 | } |
29 | 29 |
@@ -43,7 +43,7 @@ |
||
43 | 43 | */ |
44 | 44 | public function translateName(PropertyMetadata $property): string |
45 | 45 | { |
46 | - $name = preg_replace('/[A-Z]+/', $this->separator . '\\0', $property->name); |
|
46 | + $name = preg_replace('/[A-Z]+/', $this->separator.'\\0', $property->name); |
|
47 | 47 | |
48 | 48 | if ($this->lowerCase) { |
49 | 49 | return strtolower($name); |
@@ -40,19 +40,19 @@ |
||
40 | 40 | { |
41 | 41 | $currentSorting = $properties ? array_combine(array_keys($properties), range(1, \count($properties))) : []; |
42 | 42 | |
43 | - uksort($properties, function ($a, $b) use ($currentSorting) { |
|
43 | + uksort($properties, function($a, $b) use ($currentSorting) { |
|
44 | 44 | $existsA = isset($this->ordering[$a]); |
45 | 45 | $existsB = isset($this->ordering[$b]); |
46 | 46 | |
47 | - if (!$existsA && !$existsB) { |
|
47 | + if ( ! $existsA && ! $existsB) { |
|
48 | 48 | return $currentSorting[$a] - $currentSorting[$b]; |
49 | 49 | } |
50 | 50 | |
51 | - if (!$existsA) { |
|
51 | + if ( ! $existsA) { |
|
52 | 52 | return 1; |
53 | 53 | } |
54 | 54 | |
55 | - if (!$existsB) { |
|
55 | + if ( ! $existsB) { |
|
56 | 56 | return -1; |
57 | 57 | } |
58 | 58 |
@@ -79,7 +79,7 @@ |
||
79 | 79 | |
80 | 80 | $rs = isset($type['params'][1]) ? new \ArrayObject() : []; |
81 | 81 | |
82 | - $isList = isset($type['params'][0]) && !isset($type['params'][1]); |
|
82 | + $isList = isset($type['params'][0]) && ! isset($type['params'][1]); |
|
83 | 83 | |
84 | 84 | $elType = $this->getElementType($type); |
85 | 85 | foreach ($data as $k => $v) { |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | // Locate possible ObjectManager |
50 | 50 | $objectManager = $this->managerRegistry->getManagerForClass($metadata->name); |
51 | 51 | |
52 | - if (!$objectManager) { |
|
52 | + if ( ! $objectManager) { |
|
53 | 53 | // No ObjectManager found, proceed with normal deserialization |
54 | 54 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
55 | 55 | } |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | // Managed entity, check for proxy load |
66 | - if (!\is_array($data)) { |
|
66 | + if ( ! \is_array($data)) { |
|
67 | 67 | // Single identifier, load proxy |
68 | 68 | return $objectManager->getReference($metadata->name, $data); |
69 | 69 | } |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | $dataName = $name; |
81 | 81 | } |
82 | 82 | |
83 | - if (!array_key_exists($dataName, $data)) { |
|
83 | + if ( ! array_key_exists($dataName, $data)) { |
|
84 | 84 | return $this->fallbackConstructor->construct($visitor, $metadata, $data, $type, $context); |
85 | 85 | } |
86 | 86 | $identifierList[$name] = $data[$dataName]; |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | |
115 | 115 | switch ($type['name']) { |
116 | 116 | case 'NULL': |
117 | - if (!$this->shouldSerializeNull) { |
|
117 | + if ( ! $this->shouldSerializeNull) { |
|
118 | 118 | throw new NotAcceptableException(); |
119 | 119 | } |
120 | 120 | return $this->visitor->visitNull($data, $type); |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | case 'resource': |
141 | 141 | $msg = 'Resources are not supported in serialized data.'; |
142 | 142 | if (null !== $path = $this->context->getPath()) { |
143 | - $msg .= ' Path: ' . $path; |
|
143 | + $msg .= ' Path: '.$path; |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | throw new RuntimeException($msg); |