@@ -95,12 +95,12 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function setAccessorOrder($order, array $customOrder = []) |
97 | 97 | { |
98 | - if (!in_array($order, [self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM], true)) { |
|
98 | + if ( ! in_array($order, [self::ACCESSOR_ORDER_UNDEFINED, self::ACCESSOR_ORDER_ALPHABETICAL, self::ACCESSOR_ORDER_CUSTOM], true)) { |
|
99 | 99 | throw new InvalidArgumentException(sprintf('The accessor order "%s" is invalid.', $order)); |
100 | 100 | } |
101 | 101 | |
102 | 102 | foreach ($customOrder as $name) { |
103 | - if (!\is_string($name)) { |
|
103 | + if ( ! \is_string($name)) { |
|
104 | 104 | throw new InvalidArgumentException(sprintf('$customOrder is expected to be a list of strings, but got element of value %s.', json_encode($name))); |
105 | 105 | } |
106 | 106 | } |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | |
137 | 137 | public function merge(MergeableInterface $object) |
138 | 138 | { |
139 | - if (!$object instanceof ClassMetadata) { |
|
139 | + if ( ! $object instanceof ClassMetadata) { |
|
140 | 140 | throw new InvalidArgumentException('$object must be an instance of ClassMetadata.'); |
141 | 141 | } |
142 | 142 | parent::merge($object); |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | $this->discriminatorBaseClass, |
161 | 161 | $this->discriminatorBaseClass |
162 | 162 | )); |
163 | - } elseif (!$this->discriminatorFieldName && $object->discriminatorFieldName) { |
|
163 | + } elseif ( ! $this->discriminatorFieldName && $object->discriminatorFieldName) { |
|
164 | 164 | $this->discriminatorFieldName = $object->discriminatorFieldName; |
165 | 165 | $this->discriminatorMap = $object->discriminatorMap; |
166 | 166 | } |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | $this->discriminatorBaseClass = $object->discriminatorBaseClass; |
176 | 176 | } |
177 | 177 | |
178 | - if ($this->discriminatorMap && !$this->reflection->isAbstract()) { |
|
178 | + if ($this->discriminatorMap && ! $this->reflection->isAbstract()) { |
|
179 | 179 | if (false === $typeValue = array_search($this->name, $this->discriminatorMap, true)) { |
180 | 180 | throw new LogicException(sprintf( |
181 | 181 | 'The sub-class "%s" is not listed in the discriminator of the base class "%s".', |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | $this->discriminatorValue = $typeValue; |
188 | 188 | |
189 | 189 | if (isset($this->propertyMetadata[$this->discriminatorFieldName]) |
190 | - && !$this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata |
|
190 | + && ! $this->propertyMetadata[$this->discriminatorFieldName] instanceof StaticPropertyMetadata |
|
191 | 191 | ) { |
192 | 192 | throw new LogicException(sprintf( |
193 | 193 | 'The discriminator field name "%s" of the base-class "%s" conflicts with a regular property of the sub-class "%s".', |
@@ -215,12 +215,12 @@ discard block |
||
215 | 215 | |
216 | 216 | public function registerNamespace($uri, $prefix = null) |
217 | 217 | { |
218 | - if (!\is_string($uri)) { |
|
218 | + if ( ! \is_string($uri)) { |
|
219 | 219 | throw new InvalidArgumentException(sprintf('$uri is expected to be a strings, but got value %s.', json_encode($uri))); |
220 | 220 | } |
221 | 221 | |
222 | 222 | if ($prefix !== null) { |
223 | - if (!\is_string($prefix)) { |
|
223 | + if ( ! \is_string($prefix)) { |
|
224 | 224 | throw new InvalidArgumentException(sprintf('$prefix is expected to be a strings, but got value %s.', json_encode($prefix))); |
225 | 225 | } |
226 | 226 | } else { |
@@ -31,7 +31,7 @@ |
||
31 | 31 | { |
32 | 32 | uasort( |
33 | 33 | $properties, |
34 | - function (PropertyMetadata $a, PropertyMetadata $b) : int { |
|
34 | + function(PropertyMetadata $a, PropertyMetadata $b) : int { |
|
35 | 35 | return strcmp($a->name, $b->name); |
36 | 36 | } |
37 | 37 | ); |
@@ -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 |