diff --git a/src/Annotation/Alias.php b/src/Annotation/Alias.php index dce0b40..012db93 100644 --- a/src/Annotation/Alias.php +++ b/src/Annotation/Alias.php @@ -6,9 +6,7 @@ /** * @Annotation - * * @Target({"PROPERTY"}) - * * @NamedArgumentConstructor * * @Attributes({ diff --git a/src/Annotation/ArrayType.php b/src/Annotation/ArrayType.php index 84668aa..f9d342d 100644 --- a/src/Annotation/ArrayType.php +++ b/src/Annotation/ArrayType.php @@ -7,9 +7,7 @@ /** * @Annotation - * * @Target({"PROPERTY"}) - * * @NamedArgumentConstructor * * @Attributes({ diff --git a/src/Annotation/ConcreteResolver.php b/src/Annotation/ConcreteResolver.php index 80e66ec..4d20031 100644 --- a/src/Annotation/ConcreteResolver.php +++ b/src/Annotation/ConcreteResolver.php @@ -6,7 +6,6 @@ /** * @Annotation - * * @Target({"CLASS"}) */ #[Attribute(Attribute::TARGET_CLASS)] diff --git a/src/Annotation/Mutate.php b/src/Annotation/Mutate.php index 07ad104..f85dbf7 100644 --- a/src/Annotation/Mutate.php +++ b/src/Annotation/Mutate.php @@ -8,7 +8,6 @@ /** * @Annotation - * * @Target({"PROPERTY"}) */ #[Attribute(Attribute::TARGET_PROPERTY)] diff --git a/src/Annotation/SkipConstructor.php b/src/Annotation/SkipConstructor.php index 25792bc..e994f30 100644 --- a/src/Annotation/SkipConstructor.php +++ b/src/Annotation/SkipConstructor.php @@ -6,7 +6,6 @@ /** * @Annotation - * * @Target({"CLASS"}) */ #[Attribute(Attribute::TARGET_CLASS)] diff --git a/src/Annotation/UnionResolver.php b/src/Annotation/UnionResolver.php index e828846..46a20fa 100644 --- a/src/Annotation/UnionResolver.php +++ b/src/Annotation/UnionResolver.php @@ -8,7 +8,6 @@ /** * @Annotation - * * @Target({"PROPERTY"}) */ #[Attribute(Attribute::TARGET_PROPERTY)] diff --git a/src/Hydrator.php b/src/Hydrator.php index 7d022a9..750b5fd 100644 --- a/src/Hydrator.php +++ b/src/Hydrator.php @@ -22,6 +22,7 @@ use SergiX44\Hydrator\Annotation\SkipConstructor; use SergiX44\Hydrator\Annotation\UnionResolver; use SergiX44\Hydrator\Exception\InvalidObjectException; + use function array_key_exists; use function class_exists; use function ctype_digit; @@ -37,6 +38,7 @@ use function is_subclass_of; use function sprintf; use function strtotime; + use const FILTER_NULL_ON_FAILURE; use const FILTER_VALIDATE_BOOLEAN; use const FILTER_VALIDATE_FLOAT; diff --git a/tests/HydratorTest.php b/tests/HydratorTest.php index 7b6dec8..59daa6c 100644 --- a/tests/HydratorTest.php +++ b/tests/HydratorTest.php @@ -775,7 +775,7 @@ public function testHydrateArrayAbstractProperty(): void public function testHydrateArrayAbstractPropertyWithObject(): void { $o = (new Hydrator())->hydrate(new ObjectWithArrayOfAbstracts(), [ - 'value' => [(object)[ + 'value' => [(object) [ 'type' => 'jack', 'sweetness' => null, 'category' => 'brandy',