|
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;
|
@@ -300,7 +301,7 @@ class ClassMetadataInfo implements ClassMetadata
|
300 | 301 | * (Optional).
|
301 | 302 | *
|
302 | 303 | * @var string|null
|
303 |
| - * @psalm-var ?class-string |
| 304 | + * @psalm-var ?class-string<EntityRepository> |
304 | 305 | */
|
305 | 306 | public $customRepositoryClassName;
|
306 | 307 |
|
@@ -395,14 +396,15 @@ class ClassMetadataInfo implements ClassMetadata
|
395 | 396 | * READ-ONLY: The inheritance mapping type used by the class.
|
396 | 397 | *
|
397 | 398 | * @var int
|
398 |
| - * @psalm-var self::$INHERITANCE_TYPE_* |
| 399 | + * @psalm-var self::INHERITANCE_TYPE_* |
399 | 400 | */
|
400 | 401 | public $inheritanceType = self::INHERITANCE_TYPE_NONE;
|
401 | 402 |
|
402 | 403 | /**
|
403 | 404 | * READ-ONLY: The Id generator type used by the class.
|
404 | 405 | *
|
405 | 406 | * @var int
|
| 407 | + * @psalm-var self::GENERATOR_TYPE_* |
406 | 408 | */
|
407 | 409 | public $generatorType = self::GENERATOR_TYPE_NONE;
|
408 | 410 |
|
@@ -668,8 +670,8 @@ class ClassMetadataInfo implements ClassMetadata
|
668 | 670 | */
|
669 | 671 | public $versionField;
|
670 | 672 |
|
671 |
| - /** @var mixed[] */ |
672 |
| - public $cache = null; |
| 673 | + /** @var mixed[]|null */ |
| 674 | + public $cache; |
673 | 675 |
|
674 | 676 | /**
|
675 | 677 | * The ReflectionClass instance of the mapped class.
|
@@ -2150,6 +2152,7 @@ public function getIdentifierColumnNames()
|
2150 | 2152 | * Sets the type of Id generator to use for the mapped class.
|
2151 | 2153 | *
|
2152 | 2154 | * @param int $generatorType
|
| 2155 | + * @psalm-param self::GENERATOR_TYPE_* $generatorType |
2153 | 2156 | *
|
2154 | 2157 | * @return void
|
2155 | 2158 | */
|
@@ -2376,6 +2379,7 @@ public function setParentClasses(array $classNames)
|
2376 | 2379 | * Sets the inheritance type used by the class and its subclasses.
|
2377 | 2380 | *
|
2378 | 2381 | * @param int $type
|
| 2382 | + * @psalm-param self::INHERITANCE_TYPE_* $type |
2379 | 2383 | *
|
2380 | 2384 | * @return void
|
2381 | 2385 | *
|
@@ -2921,8 +2925,8 @@ protected function _storeAssociationMapping(array $assocMapping)
|
2921 | 2925 | /**
|
2922 | 2926 | * Registers a custom repository class for the entity class.
|
2923 | 2927 | *
|
2924 |
| - * @param string $repositoryClassName The class name of the custom mapper. |
2925 |
| - * @psalm-param class-string $repositoryClassName |
| 2928 | + * @param string|null $repositoryClassName The class name of the custom mapper. |
| 2929 | + * @psalm-param class-string<EntityRepository>|null $repositoryClassName |
2926 | 2930 | *
|
2927 | 2931 | * @return void
|
2928 | 2932 | */
|
@@ -3589,17 +3593,18 @@ public function getAssociationsByTargetClass($targetClass)
|
3589 | 3593 |
|
3590 | 3594 | /**
|
3591 | 3595 | * @param string|null $className
|
3592 |
| - * @psalm-param ?class-string $className |
| 3596 | + * @psalm-param string|class-string|null $className |
3593 | 3597 | *
|
3594 | 3598 | * @return string|null null if the input value is null
|
| 3599 | + * @psalm-return class-string|null |
3595 | 3600 | */
|
3596 | 3601 | public function fullyQualifiedClassName($className)
|
3597 | 3602 | {
|
3598 | 3603 | if (empty($className)) {
|
3599 | 3604 | return $className;
|
3600 | 3605 | }
|
3601 | 3606 |
|
3602 |
| - if ($className !== null && strpos($className, '\\') === false && $this->namespace) { |
| 3607 | + if (strpos($className, '\\') === false && $this->namespace) { |
3603 | 3608 | return $this->namespace . '\\' . $className;
|
3604 | 3609 | }
|
3605 | 3610 |
|
|
0 commit comments