Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
StyleCIBot committed Feb 8, 2024
1 parent bb376d2 commit 8d462c9
Show file tree
Hide file tree
Showing 24 changed files with 5 additions and 45 deletions.
2 changes: 0 additions & 2 deletions src/Annotation/Column.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target({"PROPERTY", "ANNOTATION", "CLASS"})
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Embeddable.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("CLASS")
*/
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("CLASS")
*/
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/ForeignKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target({"PROPERTY", "ANNOTATION", "CLASS"})
*/
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE)]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Inheritance/DiscriminatorColumn.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("CLASS")
*/
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Inheritance/JoinedTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("CLASS")
*/
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Inheritance/SingleTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("CLASS")
*/
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/BelongsTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/Embedded.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/HasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/HasOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/Inverse.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target({"PROPERTY", "ANNOTATION"})
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/ManyToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/Morphed/BelongsToMorphed.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/Morphed/MorphedHasMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/Morphed/MorphedHasOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Relation/RefersTo.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("PROPERTY")
*/
#[\Attribute(\Attribute::TARGET_PROPERTY), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target({"CLASS", "ANNOTATION"})
*/
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Table/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("ANNOTATION", "CLASS")
*/
#[\Attribute(\Attribute::TARGET_CLASS | \Attribute::IS_REPEATABLE), NamedArgumentConstructor]
Expand Down
2 changes: 0 additions & 2 deletions src/Annotation/Table/PrimaryKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@

/**
* @Annotation
*
* @NamedArgumentConstructor
*
* @Target("ANNOTATION", "CLASS")
*/
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
Expand Down
4 changes: 2 additions & 2 deletions src/Configurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand All @@ -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);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Entities.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Exception/AnnotationRequiredArgumentsException.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/Annotated/Functional/Driver/Common/TableTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 8d462c9

Please sign in to comment.