diff --git a/src/Annotation/Column.php b/src/Annotation/Column.php index b36ff7b0..3ac8d41b 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 3d5cd434..41889f1d 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 140bd698..b1e60507 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/ForeignKey.php b/src/Annotation/ForeignKey.php index f77bea6d..37b593af 100644 --- a/src/Annotation/ForeignKey.php +++ b/src/Annotation/ForeignKey.php @@ -10,9 +10,7 @@ /** * @Annotation - * * @NamedArgumentConstructor - * * @Target({"PROPERTY", "ANNOTATION", "CLASS"}) */ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)] diff --git a/src/Annotation/Inheritance/DiscriminatorColumn.php b/src/Annotation/Inheritance/DiscriminatorColumn.php index cb118d3a..06298ab4 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 591c7737..258c4642 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 a47e963b..3d38221b 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 19bce0c6..f6212b07 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 ac08c549..bed3274b 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 15c5370c..c3d9aceb 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 4c00f69a..cad1c7db 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 9995b2e4..c8efed13 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 f9634ea7..8bb9e951 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 30f463cf..30c467be 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 7e1bd215..f78c427c 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 da8078c1..64ea3bd5 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 4b772b2a..6650e44a 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 705dda56..a3007dc3 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 d3e28f42..48cbc502 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/Configurator.php b/src/Configurator.php index e51fe0f7..fba25a10 100644 --- a/src/Configurator.php +++ b/src/Configurator.php @@ -346,7 +346,7 @@ private function getClassMetadata(\ReflectionClass $class, string $name): iterab { try { return $this->reader->getClassMetadata($class, $name); - } catch (\Exception $e) { + } catch (Exception $e) { throw new AnnotationException($e->getMessage(), $e->getCode(), $e); } } @@ -364,7 +364,7 @@ private function getPropertyMetadata(\ReflectionProperty $property, string $name { try { return $this->reader->getPropertyMetadata($property, $name); - } catch (\Exception $e) { + } catch (Exception $e) { throw new AnnotationException($e->getMessage(), $e->getCode(), $e); } } diff --git a/src/Entities.php b/src/Entities.php index fec0d232..218d01f5 100644 --- a/src/Entities.php +++ b/src/Entities.php @@ -99,7 +99,7 @@ public function run(Registry $registry): Registry private function normalizeNames(Registry $registry): Registry { foreach ($this->locator->getClasses() as $class) { - if (! $registry->hasEntity($class->getName())) { + if (!$registry->hasEntity($class->getName())) { continue; } diff --git a/src/Exception/AnnotationRequiredArgumentsException.php b/src/Exception/AnnotationRequiredArgumentsException.php index 23f4321c..7330980b 100644 --- a/src/Exception/AnnotationRequiredArgumentsException.php +++ b/src/Exception/AnnotationRequiredArgumentsException.php @@ -12,7 +12,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/TableTest.php b/tests/Annotated/Functional/Driver/Common/TableTest.php index ff1a02fb..c20a04fc 100644 --- a/tests/Annotated/Functional/Driver/Common/TableTest.php +++ b/tests/Annotated/Functional/Driver/Common/TableTest.php @@ -157,7 +157,7 @@ public function testCompositePrimaryKey(ReaderInterface $reader): void */ 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);