|
15 | 15 | use Doctrine\Instantiator\Instantiator; |
16 | 16 | use Doctrine\Instantiator\InstantiatorInterface; |
17 | 17 | use Doctrine\ORM\Cache\Exception\NonCacheableEntityAssociation; |
| 18 | +use Doctrine\ORM\EntityRepository; |
18 | 19 | use Doctrine\ORM\Id\AbstractIdGenerator; |
19 | 20 | use Doctrine\Persistence\Mapping\ClassMetadata; |
20 | 21 | use Doctrine\Persistence\Mapping\ReflectionService; |
@@ -281,7 +282,7 @@ class ClassMetadataInfo implements ClassMetadata |
281 | 282 | * (Optional). |
282 | 283 | * |
283 | 284 | * @var string|null |
284 | | - * @psalm-var ?class-string |
| 285 | + * @psalm-var ?class-string<EntityRepository> |
285 | 286 | */ |
286 | 287 | public $customRepositoryClassName; |
287 | 288 |
|
@@ -376,14 +377,15 @@ class ClassMetadataInfo implements ClassMetadata |
376 | 377 | * READ-ONLY: The inheritance mapping type used by the class. |
377 | 378 | * |
378 | 379 | * @var int |
379 | | - * @psalm-var self::$INHERITANCE_TYPE_* |
| 380 | + * @psalm-var self::INHERITANCE_TYPE_* |
380 | 381 | */ |
381 | 382 | public $inheritanceType = self::INHERITANCE_TYPE_NONE; |
382 | 383 |
|
383 | 384 | /** |
384 | 385 | * READ-ONLY: The Id generator type used by the class. |
385 | 386 | * |
386 | 387 | * @var int |
| 388 | + * @psalm-var self::GENERATOR_TYPE_* |
387 | 389 | */ |
388 | 390 | public $generatorType = self::GENERATOR_TYPE_NONE; |
389 | 391 |
|
@@ -649,8 +651,8 @@ class ClassMetadataInfo implements ClassMetadata |
649 | 651 | */ |
650 | 652 | public $versionField; |
651 | 653 |
|
652 | | - /** @var mixed[] */ |
653 | | - public $cache = null; |
| 654 | + /** @var mixed[]|null */ |
| 655 | + public $cache; |
654 | 656 |
|
655 | 657 | /** |
656 | 658 | * The ReflectionClass instance of the mapped class. |
@@ -2130,6 +2132,7 @@ public function getIdentifierColumnNames() |
2130 | 2132 | * Sets the type of Id generator to use for the mapped class. |
2131 | 2133 | * |
2132 | 2134 | * @param int $generatorType |
| 2135 | + * @psalm-param self::GENERATOR_TYPE_* $generatorType |
2133 | 2136 | * |
2134 | 2137 | * @return void |
2135 | 2138 | */ |
@@ -2318,6 +2321,7 @@ public function setParentClasses(array $classNames) |
2318 | 2321 | * Sets the inheritance type used by the class and its subclasses. |
2319 | 2322 | * |
2320 | 2323 | * @param int $type |
| 2324 | + * @psalm-param self::INHERITANCE_TYPE_* $type |
2321 | 2325 | * |
2322 | 2326 | * @return void |
2323 | 2327 | * |
@@ -2863,8 +2867,8 @@ protected function _storeAssociationMapping(array $assocMapping) |
2863 | 2867 | /** |
2864 | 2868 | * Registers a custom repository class for the entity class. |
2865 | 2869 | * |
2866 | | - * @param string $repositoryClassName The class name of the custom mapper. |
2867 | | - * @psalm-param class-string $repositoryClassName |
| 2870 | + * @param string|null $repositoryClassName The class name of the custom mapper. |
| 2871 | + * @psalm-param class-string<EntityRepository>|null $repositoryClassName |
2868 | 2872 | * |
2869 | 2873 | * @return void |
2870 | 2874 | */ |
@@ -3531,17 +3535,18 @@ public function getAssociationsByTargetClass($targetClass) |
3531 | 3535 |
|
3532 | 3536 | /** |
3533 | 3537 | * @param string|null $className |
3534 | | - * @psalm-param ?class-string $className |
| 3538 | + * @psalm-param string|class-string|null $className |
3535 | 3539 | * |
3536 | 3540 | * @return string|null null if the input value is null |
| 3541 | + * @psalm-return class-string|null |
3537 | 3542 | */ |
3538 | 3543 | public function fullyQualifiedClassName($className) |
3539 | 3544 | { |
3540 | 3545 | if (empty($className)) { |
3541 | 3546 | return $className; |
3542 | 3547 | } |
3543 | 3548 |
|
3544 | | - if ($className !== null && strpos($className, '\\') === false && $this->namespace) { |
| 3549 | + if (strpos($className, '\\') === false && $this->namespace) { |
3545 | 3550 | return $this->namespace . '\\' . $className; |
3546 | 3551 | } |
3547 | 3552 |
|
|
0 commit comments