@@ -147,6 +147,8 @@ discard block |
||
| 147 | 147 | |
| 148 | 148 | /** |
| 149 | 149 | * Construct. |
| 150 | + * @param integer $id |
|
| 151 | + * @param integer $bladesNumber |
|
| 150 | 152 | */ |
| 151 | 153 | public function __construct($id, $bladesNumber = null, $nothing = 'wrong') |
| 152 | 154 | { |
@@ -164,6 +166,9 @@ discard block |
||
| 164 | 166 | return $this->id; |
| 165 | 167 | } |
| 166 | 168 | |
| 169 | + /** |
|
| 170 | + * @param string $color |
|
| 171 | + */ |
|
| 167 | 172 | public function setColor($color) { |
| 168 | 173 | $this->color = $color; |
| 169 | 174 | } |
@@ -69,8 +69,7 @@ discard block |
||
| 69 | 69 | public static function createNormalizer($key = 'default') |
| 70 | 70 | { |
| 71 | 71 | return isset(self::$instancePool[$key]) ? |
| 72 | - self::$instancePool[$key] : |
|
| 73 | - self::$instancePool[$key] = new static( |
|
| 72 | + self::$instancePool[$key] : self::$instancePool[$key] = new static( |
|
| 74 | 73 | PropertyAccess::createPropertyAccessor() |
| 75 | 74 | ); |
| 76 | 75 | } |
@@ -93,7 +92,7 @@ discard block |
||
| 93 | 92 | */ |
| 94 | 93 | private function createExtractorDelegate() |
| 95 | 94 | { |
| 96 | - return $this->extractorDelegate ?: $this->extractorDelegate = function () { |
|
| 95 | + return $this->extractorDelegate ?: $this->extractorDelegate = function() { |
|
| 97 | 96 | return get_object_vars($this); |
| 98 | 97 | }; |
| 99 | 98 | } |
@@ -105,7 +104,7 @@ discard block |
||
| 105 | 104 | */ |
| 106 | 105 | private function createReadingDelegate() |
| 107 | 106 | { |
| 108 | - return $this->readDelegate ?: $this->readDelegate = function ($property, PropertyAccessor $propertyAccessor) { |
|
| 107 | + return $this->readDelegate ?: $this->readDelegate = function($property, PropertyAccessor $propertyAccessor) { |
|
| 109 | 108 | switch (true) { |
| 110 | 109 | |
| 111 | 110 | // Public property / accessor case |
@@ -266,7 +265,7 @@ discard block |
||
| 266 | 265 | */ |
| 267 | 266 | private function createWrittingDelegate() |
| 268 | 267 | { |
| 269 | - return $this->writeDelegate ?: $this->writeDelegate = function (PropertyPathInterface $property, $value, PropertyAccessor $propertyAccessor) { |
|
| 268 | + return $this->writeDelegate ?: $this->writeDelegate = function(PropertyPathInterface $property, $value, PropertyAccessor $propertyAccessor) { |
|
| 270 | 269 | switch (true) { |
| 271 | 270 | |
| 272 | 271 | // Public property / accessor case |
@@ -300,15 +299,12 @@ discard block |
||
| 300 | 299 | $class = is_string($normalizable) ? |
| 301 | 300 | $normalizable : ( |
| 302 | 301 | $normalizable instanceof \ReflectionClass ? |
| 303 | - $normalizable->name : |
|
| 304 | - get_class($normalizable) |
|
| 302 | + $normalizable->name : get_class($normalizable) |
|
| 305 | 303 | ) |
| 306 | 304 | ; |
| 307 | 305 | $reflection = isset(self::$reflectionPool[$class]) ? |
| 308 | - self::$reflectionPool[$class] : |
|
| 309 | - self::$reflectionPool[$class] = $normalizable instanceof \ReflectionClass ? |
|
| 310 | - $normalizable : |
|
| 311 | - new \ReflectionClass($class) |
|
| 306 | + self::$reflectionPool[$class] : self::$reflectionPool[$class] = $normalizable instanceof \ReflectionClass ? |
|
| 307 | + $normalizable : new \ReflectionClass($class) |
|
| 312 | 308 | ; |
| 313 | 309 | |
| 314 | 310 | $object = $normalizable; |
@@ -335,8 +331,7 @@ discard block |
||
| 335 | 331 | $argKey = $this->inflector->snakelize($parameter->getName()); |
| 336 | 332 | if (isset($data[$argKey])) { |
| 337 | 333 | $arguments[] = $parameter->getClass() ? |
| 338 | - $this->normalize($data[$argKey], $parameter->getClass()) : |
|
| 339 | - $data[$argKey] |
|
| 334 | + $this->normalize($data[$argKey], $parameter->getClass()) : $data[$argKey] |
|
| 340 | 335 | ; |
| 341 | 336 | unset($data[$argKey]); |
| 342 | 337 | |
@@ -344,16 +339,14 @@ discard block |
||
| 344 | 339 | } |
| 345 | 340 | |
| 346 | 341 | $arguments[] = $parameter->isOptional() ? |
| 347 | - $parameter->getDefaultValue() : |
|
| 348 | - null |
|
| 342 | + $parameter->getDefaultValue() : null |
|
| 349 | 343 | ; |
| 350 | 344 | } |
| 351 | 345 | } |
| 352 | 346 | } |
| 353 | 347 | |
| 354 | 348 | $object = empty($arguments) ? |
| 355 | - $reflection->newInstance() : |
|
| 356 | - $reflection->newInstanceArgs($arguments); |
|
| 349 | + $reflection->newInstance() : $reflection->newInstanceArgs($arguments); |
|
| 357 | 350 | } |
| 358 | 351 | |
| 359 | 352 | // BAD ! |