Skip to content

Commit 2b7485a

Browse files
authored
Merge pull request #10205 from greg0ire/avoid-references-to-annotations
Avoid references to annotations
2 parents 5d88dc9 + edb6332 commit 2b7485a

9 files changed

+19
-21
lines changed

lib/Doctrine/ORM/Mapping/AssociationOverride.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Doctrine\ORM\Mapping;
66

77
/**
8-
* This annotation is used to override association mapping of property for an entity relationship.
8+
* This attribute is used to override association mapping of property for an entity relationship.
99
*
1010
* @Annotation
1111
* @NamedArgumentConstructor

lib/Doctrine/ORM/Mapping/AssociationOverrides.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use function is_array;
1111

1212
/**
13-
* This annotation is used to override association mappings of relationship properties.
13+
* This attribute is used to override association mappings of relationship properties.
1414
*
1515
* @Annotation
1616
* @NamedArgumentConstructor()

lib/Doctrine/ORM/Mapping/AttributeOverride.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
namespace Doctrine\ORM\Mapping;
66

77
/**
8-
* This annotation is used to override the mapping of a entity property.
8+
* This attribute is used to override the mapping of a entity property.
99
*
1010
* @Annotation
1111
* @NamedArgumentConstructor

lib/Doctrine/ORM/Mapping/AttributeOverrides.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
use function is_array;
1111

1212
/**
13-
* This annotation is used to override the mapping of a entity property.
13+
* This attribute is used to override the mapping of a entity property.
1414
*
1515
* @Annotation
1616
* @NamedArgumentConstructor()

lib/Doctrine/ORM/Mapping/Driver/AnnotationDriver.php

+5-2
Original file line numberDiff line numberDiff line change
@@ -546,8 +546,9 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad
546546
}
547547

548548
/**
549-
* @param mixed[] $joinColumns
550-
* @psalm-param array<string, mixed> $mapping
549+
* @param mixed[] $joinColumns
550+
* @param class-string $className
551+
* @param array<string, mixed> $mapping
551552
*/
552553
private function loadRelationShipMapping(
553554
ReflectionProperty $property,
@@ -660,6 +661,8 @@ private function loadRelationShipMapping(
660661
/**
661662
* Attempts to resolve the fetch mode.
662663
*
664+
* @param class-string $className
665+
*
663666
* @psalm-return ClassMetadata::FETCH_* The fetch mode as defined in ClassMetadata.
664667
*
665668
* @throws MappingException If the fetch mode is not valid.

lib/Doctrine/ORM/Mapping/Driver/AttributeDriver.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,8 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad
566566
/**
567567
* Attempts to resolve the fetch mode.
568568
*
569-
* @param string $className The class name.
570-
* @param string $fetchMode The fetch mode.
569+
* @param class-string $className The class name.
570+
* @param string $fetchMode The fetch mode.
571571
*
572572
* @return ClassMetadata::FETCH_* The fetch mode as defined in ClassMetadata.
573573
*

lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -966,7 +966,7 @@ private function getCascadeMappings(SimpleXMLElement $cascadeElement): array
966966
foreach ($cascadeElement->children() as $action) {
967967
// According to the JPA specifications, XML uses "cascade-persist"
968968
// instead of "persist". Here, both variations
969-
// are supported because both YAML and Annotation use "persist"
969+
// are supported because YAML, Annotation and Attribute use "persist"
970970
// and we want to make sure that this driver doesn't need to know
971971
// anything about the supported cascading actions
972972
$cascades[] = str_replace('cascade-', '', $action->getName());

lib/Doctrine/ORM/Mapping/EntityListeners.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
use Doctrine\Common\Annotations\Annotation\NamedArgumentConstructor;
99

1010
/**
11-
* The EntityListeners annotation specifies the callback listener classes to be used for an entity or mapped superclass.
12-
* The EntityListeners annotation may be applied to an entity class or mapped superclass.
11+
* The EntityListeners attribute specifies the callback listener classes to be used for an entity or mapped superclass.
12+
* The EntityListeners attribute may be applied to an entity class or mapped superclass.
1313
*
1414
* @Annotation
1515
* @NamedArgumentConstructor()

lib/Doctrine/ORM/Mapping/MappingException.php

+5-10
Original file line numberDiff line numberDiff line change
@@ -813,20 +813,15 @@ public static function duplicateEntityListener($listenerName, $methodName, $clas
813813
return new self(sprintf('Entity Listener "%s#%s()" in "%s" was already declared, but it must be declared only once.', $listenerName, $methodName, $className));
814814
}
815815

816-
/**
817-
* @param string $className
818-
* @param string $annotation
819-
*
820-
* @return MappingException
821-
*/
822-
public static function invalidFetchMode($className, $annotation)
816+
/** @param class-string $className */
817+
public static function invalidFetchMode(string $className, string $fetchMode): self
823818
{
824-
return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $annotation . "'");
819+
return new self("Entity '" . $className . "' has a mapping with invalid fetch mode '" . $fetchMode . "'");
825820
}
826821

827-
public static function invalidGeneratedMode(string $annotation): MappingException
822+
public static function invalidGeneratedMode(string $generatedMode): self
828823
{
829-
return new self("Invalid generated mode '" . $annotation . "'");
824+
return new self("Invalid generated mode '" . $generatedMode . "'");
830825
}
831826

832827
/**

0 commit comments

Comments
 (0)