diff --git a/src/ConstructorParametersHydratorDecorator.php b/src/ConstructorParametersHydratorDecorator.php index 83addb6d..bc878c54 100644 --- a/src/ConstructorParametersHydratorDecorator.php +++ b/src/ConstructorParametersHydratorDecorator.php @@ -75,24 +75,23 @@ private function getConstructorParameters(ProxyObject $object): array /** * @param mixed $value - * @param ReflectionParameter $constructorParameter * @return mixed */ private function castScalarValue($value, ReflectionParameter $constructorParameter) { - if ($value === null || !$constructorParameter->getType() instanceof ReflectionNamedType) { + if ($value === null || ! $constructorParameter->getType() instanceof ReflectionNamedType) { return $value; } switch ($constructorParameter->getType()->getName()) { case 'string': - return (string)$value; + return (string) $value; case 'int': - return (int)$value; + return (int) $value; case 'float': - return (float)$value; + return (float) $value; case 'bool': - return (bool)$value; + return (bool) $value; default: return $value; } diff --git a/test/TestAsset/ObjectWithConstructor.php b/test/TestAsset/ObjectWithConstructor.php index 25ab306c..7d501a0f 100644 --- a/test/TestAsset/ObjectWithConstructor.php +++ b/test/TestAsset/ObjectWithConstructor.php @@ -23,10 +23,10 @@ final class ObjectWithConstructor public function __construct(string $foo, bool $isMandatory, float $price, ?int $bar = 42) { - $this->foo = $foo; + $this->foo = $foo; $this->isMandatory = $isMandatory; - $this->bar = $bar; - $this->price = $price; + $this->bar = $bar; + $this->price = $price; } public function getFoo(): string