Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 488a5dd

Browse files
authored
Remove vendor prefix of PHPDoc referencing class-string (#11643)
1 parent 896c655 commit 488a5dd

45 files changed

Lines changed: 175 additions & 246 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

psalm-baseline.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@
305305
<code><![CDATA[$persister->loadById($sortedId)]]></code>
306306
</InvalidReturnStatement>
307307
<InvalidReturnType>
308-
<code><![CDATA[?T]]></code>
308+
<code><![CDATA[T|null]]></code>
309309
</InvalidReturnType>
310310
<MissingReturnType>
311311
<code><![CDATA[wrapInTransaction]]></code>

src/Cache/AssociationCacheEntry.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,13 @@ class AssociationCacheEntry implements CacheEntry
2121
* The entity class name
2222
*
2323
* @readonly Public only for performance reasons, it should be considered immutable.
24-
* @var string
25-
* @psalm-var class-string
24+
* @var class-string
2625
*/
2726
public $class;
2827

2928
/**
30-
* @param string $class The entity class.
29+
* @param class-string $class The entity class.
3130
* @param array<string, mixed> $identifier The entity identifier.
32-
* @psalm-param class-string $class
3331
*/
3432
public function __construct($class, array $identifier)
3533
{

src/Cache/CollectionCacheKey.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ class CollectionCacheKey extends CacheKey
2626
* The owner entity class
2727
*
2828
* @readonly Public only for performance reasons, it should be considered immutable.
29-
* @var string
30-
* @psalm-var class-string
29+
* @var class-string
3130
*/
3231
public $entityClass;
3332

@@ -40,10 +39,9 @@ class CollectionCacheKey extends CacheKey
4039
public $association;
4140

4241
/**
43-
* @param string $entityClass The entity class.
42+
* @param class-string $entityClass The entity class.
4443
* @param string $association The field name that represents the association.
4544
* @param array<string, mixed> $ownerIdentifier The identifier of the owning entity.
46-
* @psalm-param class-string $entityClass
4745
*/
4846
public function __construct($entityClass, $association, array $ownerIdentifier)
4947
{

src/Cache/EntityCacheEntry.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,13 @@ class EntityCacheEntry implements CacheEntry
2525
* The entity class name
2626
*
2727
* @readonly Public only for performance reasons, it should be considered immutable.
28-
* @var string
29-
* @psalm-var class-string
28+
* @var class-string
3029
*/
3130
public $class;
3231

3332
/**
34-
* @param string $class The entity class.
33+
* @param class-string $class The entity class.
3534
* @param array<string,mixed> $data The entity data.
36-
* @psalm-param class-string $class
3735
*/
3836
public function __construct($class, array $data)
3937
{

src/Cache/EntityCacheKey.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,13 @@ class EntityCacheKey extends CacheKey
2626
* The entity class name
2727
*
2828
* @readonly Public only for performance reasons, it should be considered immutable.
29-
* @var string
30-
* @psalm-var class-string
29+
* @var class-string
3130
*/
3231
public $entityClass;
3332

3433
/**
35-
* @param string $entityClass The entity class name. In a inheritance hierarchy it should always be the root entity class.
34+
* @param class-string $entityClass The entity class name. In a inheritance hierarchy it should always be the root entity class.
3635
* @param array<string, mixed> $identifier The entity identifier
37-
* @psalm-param class-string $entityClass
3836
*/
3937
public function __construct($entityClass, array $identifier)
4038
{

src/Cache/Persister/Collection/AbstractCollectionPersister.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -254,9 +254,8 @@ protected function evictCollectionCache(PersistentCollection $collection)
254254
/**
255255
* @deprecated This method is not used anymore.
256256
*
257-
* @param string $targetEntity
258-
* @param object $element
259-
* @psalm-param class-string $targetEntity
257+
* @param class-string $targetEntity
258+
* @param object $element
260259
*
261260
* @return void
262261
*/

src/Configuration.php

Lines changed: 14 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -687,8 +687,7 @@ public function addCustomNumericFunction($name, $className)
687687
*
688688
* @param string $name
689689
*
690-
* @return string|callable|null
691-
* @psalm-return class-string|callable|null
690+
* @return class-string|callable|null
692691
*/
693692
public function getCustomNumericFunction($name)
694693
{
@@ -705,7 +704,7 @@ public function getCustomNumericFunction($name)
705704
*
706705
* Any previously added numeric functions are discarded.
707706
*
708-
* @psalm-param array<string, class-string> $functions The map of custom
707+
* @param array<string, class-string> $functions The map of custom
709708
* DQL numeric functions.
710709
*
711710
* @return void
@@ -740,8 +739,7 @@ public function addCustomDatetimeFunction($name, $className)
740739
*
741740
* @param string $name
742741
*
743-
* @return string|callable|null
744-
* @psalm-return class-string|callable|null
742+
* @return class-string|callable|null
745743
*/
746744
public function getCustomDatetimeFunction($name)
747745
{
@@ -807,8 +805,7 @@ public function setCustomHydrationModes($modes)
807805
*
808806
* @param string $modeName The hydration mode name.
809807
*
810-
* @return string|null The hydrator class name.
811-
* @psalm-return class-string<AbstractHydrator>|null
808+
* @return class-string<AbstractHydrator>|null The hydrator class name.
812809
*/
813810
public function getCustomHydrationMode($modeName)
814811
{
@@ -818,9 +815,8 @@ public function getCustomHydrationMode($modeName)
818815
/**
819816
* Adds a custom hydration mode.
820817
*
821-
* @param string $modeName The hydration mode name.
822-
* @param string $hydrator The hydrator class name.
823-
* @psalm-param class-string<AbstractHydrator> $hydrator
818+
* @param string $modeName The hydration mode name.
819+
* @param class-string<AbstractHydrator> $hydrator The hydrator class name.
824820
*
825821
* @return void
826822
*/
@@ -832,8 +828,7 @@ public function addCustomHydrationMode($modeName, $hydrator)
832828
/**
833829
* Sets a class metadata factory.
834830
*
835-
* @param string $cmfName
836-
* @psalm-param class-string $cmfName
831+
* @param class-string $cmfName
837832
*
838833
* @return void
839834
*/
@@ -842,10 +837,7 @@ public function setClassMetadataFactoryName($cmfName)
842837
$this->_attributes['classMetadataFactoryName'] = $cmfName;
843838
}
844839

845-
/**
846-
* @return string
847-
* @psalm-return class-string
848-
*/
840+
/** @return class-string */
849841
public function getClassMetadataFactoryName()
850842
{
851843
if (! isset($this->_attributes['classMetadataFactoryName'])) {
@@ -858,9 +850,8 @@ public function getClassMetadataFactoryName()
858850
/**
859851
* Adds a filter to the list of possible filters.
860852
*
861-
* @param string $name The name of the filter.
862-
* @param string $className The class name of the filter.
863-
* @psalm-param class-string<SQLFilter> $className
853+
* @param string $name The name of the filter.
854+
* @param class-string<SQLFilter> $className The class name of the filter.
864855
*
865856
* @return void
866857
*/
@@ -874,9 +865,8 @@ public function addFilter($name, $className)
874865
*
875866
* @param string $name The name of the filter.
876867
*
877-
* @return string|null The class name of the filter, or null if it is not
878-
* defined.
879-
* @psalm-return class-string<SQLFilter>|null
868+
* @return class-string<SQLFilter>|null The class name of the filter,
869+
* or null if it is not defined.
880870
*/
881871
public function getFilterClassName($name)
882872
{
@@ -886,8 +876,7 @@ public function getFilterClassName($name)
886876
/**
887877
* Sets default repository class.
888878
*
889-
* @param string $className
890-
* @psalm-param class-string<EntityRepository> $className
879+
* @param class-string<EntityRepository> $className
891880
*
892881
* @return void
893882
*
@@ -915,8 +904,7 @@ public function setDefaultRepositoryClassName($className)
915904
/**
916905
* Get default repository class.
917906
*
918-
* @return string
919-
* @psalm-return class-string<EntityRepository>
907+
* @return class-string<EntityRepository>
920908
*/
921909
public function getDefaultRepositoryClassName()
922910
{

src/Decorator/EntityManagerDecorator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public function getExpressionBuilder()
5050
/**
5151
* {@inheritDoc}
5252
*
53-
* @psalm-param class-string<T> $className
53+
* @param class-string<T> $className
5454
*
5555
* @psalm-return EntityRepository<T>
5656
*

src/EntityManager.php

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
use Doctrine\ORM\Query\ResultSetMapping;
3131
use Doctrine\ORM\Repository\RepositoryFactory;
3232
use Doctrine\Persistence\Mapping\MappingException;
33-
use Doctrine\Persistence\ObjectRepository;
3433
use InvalidArgumentException;
3534
use Throwable;
3635

@@ -407,25 +406,23 @@ public function flush($entity = null)
407406
/**
408407
* Finds an Entity by its identifier.
409408
*
410-
* @param string $className The class name of the entity to find.
411-
* @param mixed $id The identity of the entity to find.
412-
* @param int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants
413-
* or NULL if no specific lock mode should be used
414-
* during the search.
415-
* @param int|null $lockVersion The version of the entity to find when using
416-
* optimistic locking.
417-
* @psalm-param class-string<T> $className
409+
* @param class-string<T> $className The class name of the entity to find.
410+
* @param mixed $id The identity of the entity to find.
411+
* @param int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants
412+
* or NULL if no specific lock mode should be used
413+
* during the search.
414+
* @param int|null $lockVersion The version of the entity to find when using
415+
* optimistic locking.
418416
* @psalm-param LockMode::*|null $lockMode
419417
*
420-
* @return object|null The entity instance or NULL if the entity can not be found.
421-
* @psalm-return ?T
418+
* @return T|null The entity instance or NULL if the entity can not be found.
422419
*
423420
* @throws OptimisticLockException
424421
* @throws ORMInvalidArgumentException
425422
* @throws TransactionRequiredException
426423
* @throws ORMException
427424
*
428-
* @template T
425+
* @template T of object
429426
*/
430427
public function find($className, $id, $lockMode = null, $lockVersion = null)
431428
{
@@ -803,11 +800,9 @@ public function lock($entity, $lockMode, $lockVersion = null)
803800
/**
804801
* Gets the repository for an entity class.
805802
*
806-
* @param string $entityName The name of the entity.
807-
* @psalm-param class-string<T> $entityName
803+
* @param class-string<T> $entityName The name of the entity.
808804
*
809-
* @return ObjectRepository|EntityRepository The repository class.
810-
* @psalm-return EntityRepository<T>
805+
* @return EntityRepository<T> The repository class.
811806
*
812807
* @template T of object
813808
*/

src/EntityManagerInterface.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ interface EntityManagerInterface extends ObjectManager
2929
/**
3030
* {@inheritDoc}
3131
*
32-
* @psalm-param class-string<T> $className
32+
* @param class-string<T> $className
3333
*
34-
* @psalm-return EntityRepository<T>
34+
* @return EntityRepository<T>
3535
*
3636
* @template T of object
3737
*/
@@ -172,12 +172,10 @@ public function createQueryBuilder();
172172
* Gets a reference to the entity identified by the given type and identifier
173173
* without actually loading it, if the entity is not yet loaded.
174174
*
175-
* @param string $entityName The name of the entity type.
176-
* @param mixed $id The entity identifier.
177-
* @psalm-param class-string<T> $entityName
175+
* @param class-string<T> $entityName The name of the entity type.
176+
* @param mixed $id The entity identifier.
178177
*
179-
* @return object|null The entity reference.
180-
* @psalm-return T|null
178+
* @return T|null The entity reference.
181179
*
182180
* @throws ORMException
183181
*
@@ -202,12 +200,10 @@ public function getReference($entityName, $id);
202200
*
203201
* @deprecated 2.7 This method is being removed from the ORM and won't have any replacement
204202
*
205-
* @param string $entityName The name of the entity type.
206-
* @param mixed $identifier The entity identifier.
207-
* @psalm-param class-string<T> $entityName
203+
* @param class-string<T> $entityName The name of the entity type.
204+
* @param mixed $identifier The entity identifier.
208205
*
209-
* @return object|null The (partial) entity reference
210-
* @psalm-return T|null
206+
* @return T|null The (partial) entity reference
211207
*
212208
* @template T
213209
*/
@@ -337,7 +333,7 @@ public function hasFilters();
337333
/**
338334
* {@inheritDoc}
339335
*
340-
* @psalm-param string|class-string<T> $className
336+
* @param string|class-string<T> $className
341337
*
342338
* @return Mapping\ClassMetadata
343339
* @psalm-return ($className is class-string<T> ? Mapping\ClassMetadata<T> : Mapping\ClassMetadata<object>)

0 commit comments

Comments
 (0)