From 85d7bf863bdcfee091abe8c021c7a723afac2d90 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Fri, 5 Jan 2024 10:11:14 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Annotation/Column.php | 2 -- src/Annotation/Embeddable.php | 2 -- src/Annotation/Entity.php | 2 -- src/Annotation/Inheritance/DiscriminatorColumn.php | 2 -- src/Annotation/Inheritance/JoinedTable.php | 2 -- src/Annotation/Inheritance/SingleTable.php | 2 -- src/Annotation/Relation/BelongsTo.php | 2 -- src/Annotation/Relation/Embedded.php | 2 -- src/Annotation/Relation/HasMany.php | 2 -- src/Annotation/Relation/HasOne.php | 2 -- src/Annotation/Relation/Inverse.php | 2 -- src/Annotation/Relation/ManyToMany.php | 2 -- src/Annotation/Relation/Morphed/BelongsToMorphed.php | 2 -- src/Annotation/Relation/Morphed/MorphedHasMany.php | 2 -- src/Annotation/Relation/Morphed/MorphedHasOne.php | 2 -- src/Annotation/Relation/RefersTo.php | 2 -- src/Annotation/Table.php | 2 -- src/Annotation/Table/Index.php | 2 -- src/Annotation/Table/PrimaryKey.php | 2 -- src/Exception/AnnotationRequiredArgumentsException.php | 2 +- tests/Annotated/Functional/Driver/Common/TableTestCase.php | 2 +- 21 files changed, 2 insertions(+), 40 deletions(-) diff --git a/src/Annotation/Column.php b/src/Annotation/Column.php index 81af29d6..f3495ace 100644 --- a/src/Annotation/Column.php +++ b/src/Annotation/Column.php @@ -11,9 +11,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target({"PROPERTY", "ANNOTATION", "CLASS"}) */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] diff --git a/src/Annotation/Embeddable.php b/src/Annotation/Embeddable.php index d272a322..f83c394c 100644 --- a/src/Annotation/Embeddable.php +++ b/src/Annotation/Embeddable.php @@ -9,9 +9,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("CLASS") */ #[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor] diff --git a/src/Annotation/Entity.php b/src/Annotation/Entity.php index 8ba9402b..a3fbbe16 100644 --- a/src/Annotation/Entity.php +++ b/src/Annotation/Entity.php @@ -9,9 +9,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("CLASS") */ #[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor] diff --git a/src/Annotation/Inheritance/DiscriminatorColumn.php b/src/Annotation/Inheritance/DiscriminatorColumn.php index be4fab6b..54ba0f96 100644 --- a/src/Annotation/Inheritance/DiscriminatorColumn.php +++ b/src/Annotation/Inheritance/DiscriminatorColumn.php @@ -8,9 +8,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("CLASS") */ #[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor] diff --git a/src/Annotation/Inheritance/JoinedTable.php b/src/Annotation/Inheritance/JoinedTable.php index 2bf44212..e8b2ecc5 100644 --- a/src/Annotation/Inheritance/JoinedTable.php +++ b/src/Annotation/Inheritance/JoinedTable.php @@ -10,9 +10,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("CLASS") */ #[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor] diff --git a/src/Annotation/Inheritance/SingleTable.php b/src/Annotation/Inheritance/SingleTable.php index 47f226b2..b67d02aa 100644 --- a/src/Annotation/Inheritance/SingleTable.php +++ b/src/Annotation/Inheritance/SingleTable.php @@ -9,9 +9,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("CLASS") */ #[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/BelongsTo.php b/src/Annotation/Relation/BelongsTo.php index 72988952..37343217 100644 --- a/src/Annotation/Relation/BelongsTo.php +++ b/src/Annotation/Relation/BelongsTo.php @@ -11,9 +11,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/Embedded.php b/src/Annotation/Relation/Embedded.php index 6975d38f..3222a164 100644 --- a/src/Annotation/Relation/Embedded.php +++ b/src/Annotation/Relation/Embedded.php @@ -9,9 +9,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/HasMany.php b/src/Annotation/Relation/HasMany.php index 4c9d7ac6..273aca47 100644 --- a/src/Annotation/Relation/HasMany.php +++ b/src/Annotation/Relation/HasMany.php @@ -10,9 +10,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/HasOne.php b/src/Annotation/Relation/HasOne.php index 57e36ae8..9c935afd 100644 --- a/src/Annotation/Relation/HasOne.php +++ b/src/Annotation/Relation/HasOne.php @@ -11,9 +11,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/Inverse.php b/src/Annotation/Relation/Inverse.php index 588f332c..37f5418c 100644 --- a/src/Annotation/Relation/Inverse.php +++ b/src/Annotation/Relation/Inverse.php @@ -11,9 +11,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target({"PROPERTY", "ANNOTATION"}) */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/ManyToMany.php b/src/Annotation/Relation/ManyToMany.php index 83f6557e..f63d03a1 100644 --- a/src/Annotation/Relation/ManyToMany.php +++ b/src/Annotation/Relation/ManyToMany.php @@ -11,9 +11,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/Morphed/BelongsToMorphed.php b/src/Annotation/Relation/Morphed/BelongsToMorphed.php index 892600dd..6bffc085 100644 --- a/src/Annotation/Relation/Morphed/BelongsToMorphed.php +++ b/src/Annotation/Relation/Morphed/BelongsToMorphed.php @@ -13,9 +13,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/Morphed/MorphedHasMany.php b/src/Annotation/Relation/Morphed/MorphedHasMany.php index c3f0f183..2c8f429a 100644 --- a/src/Annotation/Relation/Morphed/MorphedHasMany.php +++ b/src/Annotation/Relation/Morphed/MorphedHasMany.php @@ -12,9 +12,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/Morphed/MorphedHasOne.php b/src/Annotation/Relation/Morphed/MorphedHasOne.php index 6a215996..d00b1649 100644 --- a/src/Annotation/Relation/Morphed/MorphedHasOne.php +++ b/src/Annotation/Relation/Morphed/MorphedHasOne.php @@ -12,9 +12,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Relation/RefersTo.php b/src/Annotation/Relation/RefersTo.php index 4c9a14b0..f6dd91a9 100644 --- a/src/Annotation/Relation/RefersTo.php +++ b/src/Annotation/Relation/RefersTo.php @@ -11,9 +11,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("PROPERTY") */ #[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor] diff --git a/src/Annotation/Table.php b/src/Annotation/Table.php index 78513a44..c93078a9 100644 --- a/src/Annotation/Table.php +++ b/src/Annotation/Table.php @@ -11,9 +11,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target({"CLASS", "ANNOTATION"}) */ #[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor] diff --git a/src/Annotation/Table/Index.php b/src/Annotation/Table/Index.php index 0d8f513e..3fbcb041 100644 --- a/src/Annotation/Table/Index.php +++ b/src/Annotation/Table/Index.php @@ -9,9 +9,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("ANNOTATION", "CLASS") */ #[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE), NamedArgumentConstructor] diff --git a/src/Annotation/Table/PrimaryKey.php b/src/Annotation/Table/PrimaryKey.php index 9fb68b88..c12d2cf5 100644 --- a/src/Annotation/Table/PrimaryKey.php +++ b/src/Annotation/Table/PrimaryKey.php @@ -9,9 +9,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target("ANNOTATION", "CLASS") */ #[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor] diff --git a/src/Exception/AnnotationRequiredArgumentsException.php b/src/Exception/AnnotationRequiredArgumentsException.php index c7ec5d8c..60a9474a 100644 --- a/src/Exception/AnnotationRequiredArgumentsException.php +++ b/src/Exception/AnnotationRequiredArgumentsException.php @@ -15,7 +15,7 @@ public static function createFor(\ReflectionProperty $property, string $annotati $requiredArguments = []; foreach ($column->getConstructor()?->getParameters() ?? [] as $parameter) { - if (! $parameter->isOptional()) { + if (!$parameter->isOptional()) { $requiredArguments[] = $parameter->getName(); } } diff --git a/tests/Annotated/Functional/Driver/Common/TableTestCase.php b/tests/Annotated/Functional/Driver/Common/TableTestCase.php index 7f216e2f..31b8067b 100644 --- a/tests/Annotated/Functional/Driver/Common/TableTestCase.php +++ b/tests/Annotated/Functional/Driver/Common/TableTestCase.php @@ -146,7 +146,7 @@ public function testCompositePrimaryKey(ReaderInterface $reader): void #[DataProvider('singularReadersProvider')] public function testIndexWithEmptyColumnsShouldThrowAnException(ReaderInterface $reader): void { - $this->expectException(\Cycle\Annotated\Exception\AnnotationException::class); + $this->expectException(AnnotationException::class); $this->expectExceptionMessage('Invalid index definition for `compositePost`. Column list can\'t be empty.'); $r = new Registry($this->dbal);