diff --git a/.gitattributes b/.gitattributes index 1b71dc4e5b3..cec212e0701 100644 --- a/.gitattributes +++ b/.gitattributes @@ -19,5 +19,3 @@ phpstan-baseline.neon export-ignore phpstan-dbal2.neon export-ignore phpstan-params.neon export-ignore phpstan-persistence2.neon export-ignore -psalm.xml export-ignore -psalm-baseline.xml export-ignore diff --git a/.github/workflows/coding-standards.yml b/.github/workflows/coding-standards.yml index 12edb5facc9..9fc2664859c 100644 --- a/.github/workflows/coding-standards.yml +++ b/.github/workflows/coding-standards.yml @@ -24,4 +24,4 @@ on: jobs: coding-standards: - uses: "doctrine/.github/.github/workflows/coding-standards.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/coding-standards.yml@6.0.0" diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index 6ef2b0bb59b..84bf616c873 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -17,4 +17,4 @@ on: jobs: documentation: name: "Documentation" - uses: "doctrine/.github/.github/workflows/documentation.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/documentation.yml@6.0.0" diff --git a/.github/workflows/release-on-milestone-closed.yml b/.github/workflows/release-on-milestone-closed.yml index 1b53878b22e..0a35bee6617 100644 --- a/.github/workflows/release-on-milestone-closed.yml +++ b/.github/workflows/release-on-milestone-closed.yml @@ -7,7 +7,7 @@ on: jobs: release: - uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@5.3.0" + uses: "doctrine/.github/.github/workflows/release-on-milestone-closed.yml@6.0.0" secrets: GIT_AUTHOR_EMAIL: ${{ secrets.GIT_AUTHOR_EMAIL }} GIT_AUTHOR_NAME: ${{ secrets.GIT_AUTHOR_NAME }} diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 52f30872a9c..94448e0bd3a 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -9,7 +9,6 @@ on: - composer.* - src/** - phpstan* - - psalm* - tests/StaticAnalysis/** push: branches: @@ -19,7 +18,6 @@ on: - composer.* - src/** - phpstan* - - psalm* - tests/StaticAnalysis/** jobs: diff --git a/psalm-baseline.xml b/psalm-baseline.xml deleted file mode 100644 index cef61546b74..00000000000 --- a/psalm-baseline.xml +++ /dev/null @@ -1,1244 +0,0 @@ - - - - - isEmpty() ? $filteredParameters->first() : null]]> - - - - - - - - - - - - - - - - - - - - - - - - - getConfiguration() - ->getSecondLevelCacheConfiguration() - ->getCacheFactory()]]> - - - - - - - - - - - - - identifiers[$assocIndex]]]> - identifiers[$assocIndex]]]> - identifiers[$index]]]> - identifiers[$index]]]> - - - class]]> - class]]> - - - - - - - - - - - - - - - - - - - - - - identifiers]]> - - - getOwner()]]> - - - - - - - - - getOwner()]]> - getOwner()]]> - - - - - getOwner()]]> - - - - - getOwner()]]> - getOwner()]]> - - - - - - - - - - - - class]]> - - - getOwner()]]> - getOwner()]]> - - - getCache()]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - time]]> - - - - - - - - - - - - - - - - name ? $entity : null]]> - load($sortedId, null, null, [], $lockMode)]]> - loadById($sortedId)]]> - metadataFactory]]> - - - - - - getProxyDir()]]> - getProxyNamespace()]]> - - - - - - - - - - - - - - - load($criteria, null, null, [], null, 1, $orderBy)]]> - - - - &Selectable]]> - - - - loadAll($criteria, $orderBy, $limit, $offset)]]> - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - resultPointers[$parent]]]> - - - resultPointers[$parent][key($first)]]]> - resultPointers[$dqlAlias] =& $coll[array_key_last($coll)]]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - columnNames]]> - columnNames]]> - columnNames]]> - columnNames]]> - - - - - - - - - - - - - - - - - - - - - - declaredField]]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - reflClass]]> - - - - - - table]]> - table]]> - - - - - - - - - - - table[$indexType][$indexName]]]> - - - table[$indexType]]]> - - - em]]> - em]]> - - - - - - - - - - - - - generatorType]]> - idGenerator]]> - - - - - - - - - - - instances]]> - - - - - - - - - - - - - - - - - - - - - - - $seqGeneratorAttribute->sequenceName, - 'allocationSize' => $seqGeneratorAttribute->allocationSize, - 'initialValue' => $seqGeneratorAttribute->initialValue, - ]]]> - - - - - - - - - - - - - - - getReflectionClass()]]> - - - - - - - - - name)]]> - - - - - - - - - - - tables[$tableName]]]> - tables[$tableName]]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cacheToArray($manyToManyElement->cache)]]> - cacheToArray($manyToOneElement->cache)]]> - cacheToArray($oneToManyElement->cache)]]> - cacheToArray($oneToOneElement->cache)]]> - - - table]]> - - - - $usage, - 'region' => $region, - ]]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - mappedBy)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - fetch === ClassMetadata::FETCH_EXTRA_LAZY - ? new LazyCriteriaCollection($persister, $criteria) - : new ArrayCollection($persister->loadCriteria($criteria))]]> - em->find($this->typeClass->name, $key)]]> - - - ]]> - - - unwrap()->matching($criteria)]]> - - - - - - - backRefFieldName]]> - - - - - - - unwrap(), 'add']]]> - - - - - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - - - - - - - - - - getOwner()]]> - getOwner()]]> - getOwner()]]> - - - - - - - - - - true]]]> - true]]]> - true]]]> - - - - - - - - - - ]]> - - - - - - - - - - - - currentPersisterContext->sqlTableAliases]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - proxyFactories]]> - - - isEmbeddedClass]]> - isMappedSuperclass]]> - - - proxyFactories[$className] = $proxyFactory]]> - - - - - - - - - - 4]]> - - - - - - - - - - - - - - getDQL()]]> - - - - - - - - - - - ArithmeticPrimary()]]> - ArithmeticPrimary()]]> - - - - - ArithmeticPrimary()]]> - ArithmeticPrimary()]]> - - - - - ArithmeticPrimary()]]> - ArithmeticPrimary()]]> - - - unit->value]]> - - - - - ArithmeticPrimary()]]> - ArithmeticPrimary()]]> - - - - - unit->value]]> - - - - - - - - - - simpleArithmeticExpression]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - sqlStatements]]> - - - - - - sqlStatements]]> - - - - - - - - - - - - - - sqlStatements]]> - - - - - sqlStatements]]> - - - - - executeStatement($this->sqlStatements, $params, $types)]]> - - - - - - sqlStatements]]> - - - - - - - - - - - - - - arguments]]> - - - ]]> - - - - - - - - - - conditionType]]> - - - - - - - - - - - - - - - - - - - - - - parameters]]> - - - - - - - - - - - - - - queryComponents]]> - - - - - - - - - - - - - - - - - - - - - lexer->getLiteral($token)]]> - lexer->getLiteral($token)]]> - lexer->getLiteral($token)]]> - - - - query->getDQL()]]> - value]]> - - - value]]> - value]]> - lexer->glimpse()->type]]> - value]]> - value]]> - - - value === TokenType::T_IDENTIFIER->value]]> - - - - - parameters)]]> - - - ]]> - - - - - - - - - - - - - - simpleArithmeticExpression]]> - subselect]]> - - rangeVariableDeclaration]]> - caseOperand]]> - - - scalarResultAliasMap]]> - scalarResultAliasMap]]> - - - - - - - - $join]]]> - $join]]]> - - - - - - - isEmpty() ? $filteredParameters->first() : null]]> - - - - - - - - - - - - - - - - - - - - - - repositoryList[$repositoryHash] ??= $this->createRepository($entityManager, $entityName)]]> - - - - - - - - - - - - - - - - - - - - - name]]> - - - getConfiguration()->getProxyDir()]]> - - - - - - - - - - entityListeners]]> - - - - - - - - - - - - - - - - - - - getName()]]> - getName()]]> - - - - - - - - getName()]]> - getName()]]> - - - - - - - - - - - - - - - - - - getSqlStatements()]]> - - - - - - - - - orderByItems]]> - - - orderByClause]]> - - - orderByItems]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - entityChangeSets]]> - entityChangeSets]]> - - - - - - - - - - identityMap[$rootClassName]]]> - - - getTypeOfField($class->getSingleIdentifierFieldName())]]> - getOwner()]]> - getOwner()]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - name]]> - subClasses]]> - - - diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index b399821aa34..00000000000 --- a/psalm.xml +++ /dev/null @@ -1,246 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AbstractQuery.php b/src/AbstractQuery.php index 0ff92c30089..62862e9a915 100644 --- a/src/AbstractQuery.php +++ b/src/AbstractQuery.php @@ -83,7 +83,7 @@ abstract class AbstractQuery * The parameter map of this query. * * @var ArrayCollection|Parameter[] - * @psalm-var ArrayCollection + * @phpstan-var ArrayCollection */ protected ArrayCollection $parameters; @@ -95,14 +95,14 @@ abstract class AbstractQuery /** * The map of query hints. * - * @psalm-var array + * @phpstan-var array */ protected array $hints = []; /** * The hydration mode. * - * @psalm-var string|AbstractQuery::HYDRATE_* + * @phpstan-var string|AbstractQuery::HYDRATE_* */ protected string|int $hydrationMode = self::HYDRATE_OBJECT; @@ -130,7 +130,7 @@ abstract class AbstractQuery /** * Second level query cache mode. * - * @psalm-var Cache::MODE_*|null + * @phpstan-var Cache::MODE_*|null */ protected int|null $cacheMode = null; @@ -217,14 +217,14 @@ public function setLifetime(int $lifetime): static return $this; } - /** @psalm-return Cache::MODE_*|null */ + /** @phpstan-return Cache::MODE_*|null */ public function getCacheMode(): int|null { return $this->cacheMode; } /** - * @psalm-param Cache::MODE_* $cacheMode + * @phpstan-param Cache::MODE_* $cacheMode * * @return $this */ @@ -267,7 +267,7 @@ public function free(): void /** * Get all defined parameters. * - * @psalm-return ArrayCollection + * @phpstan-return ArrayCollection */ public function getParameters(): ArrayCollection { @@ -296,14 +296,14 @@ public function getParameter(int|string $key): Parameter|null * Sets a collection of query parameters. * * @param ArrayCollection|mixed[] $parameters - * @psalm-param ArrayCollection|mixed[] $parameters + * @phpstan-param ArrayCollection|mixed[] $parameters * * @return $this */ public function setParameters(ArrayCollection|array $parameters): static { if (is_array($parameters)) { - /** @psalm-var ArrayCollection $parameterCollection */ + /** @phpstan-var ArrayCollection $parameterCollection */ $parameterCollection = new ArrayCollection(); foreach ($parameters as $key => $value) { @@ -642,7 +642,7 @@ public function getQueryCacheProfile(): QueryCacheProfile|null * Change the default fetch mode of an association for this query. * * @param class-string $class - * @psalm-param Mapping\ClassMetadata::FETCH_EAGER|Mapping\ClassMetadata::FETCH_LAZY $fetchMode + * @phpstan-param Mapping\ClassMetadata::FETCH_EAGER|Mapping\ClassMetadata::FETCH_LAZY $fetchMode */ public function setFetchMode(string $class, string $assocName, int $fetchMode): static { @@ -656,7 +656,7 @@ public function setFetchMode(string $class, string $assocName, int $fetchMode): * * @param string|int $hydrationMode Doctrine processing mode to be used during hydration process. * One of the Query::HYDRATE_* constants. - * @psalm-param string|AbstractQuery::HYDRATE_* $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_* $hydrationMode * * @return $this */ @@ -670,7 +670,7 @@ public function setHydrationMode(string|int $hydrationMode): static /** * Gets the hydration mode currently used by the query. * - * @psalm-return string|AbstractQuery::HYDRATE_* + * @phpstan-return string|AbstractQuery::HYDRATE_* */ public function getHydrationMode(): string|int { @@ -682,7 +682,7 @@ public function getHydrationMode(): string|int * * Alias for execute(null, $hydrationMode = HYDRATE_OBJECT). * - * @psalm-param string|AbstractQuery::HYDRATE_* $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_* $hydrationMode */ public function getResult(string|int $hydrationMode = self::HYDRATE_OBJECT): mixed { @@ -728,7 +728,7 @@ public function getScalarResult(): array /** * Get exactly one result or null. * - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode * * @throws NonUniqueResultException */ @@ -763,7 +763,7 @@ public function getOneOrNullResult(string|int|null $hydrationMode = null): mixed * If the result is not unique, a NonUniqueResultException is thrown. * If there is no result, a NoResultException is thrown. * - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode * * @throws NonUniqueResultException If the query result is not unique. * @throws NoResultException If the query returned no result. @@ -843,8 +843,8 @@ public function getHints(): array * Executes the query and returns an iterable that can be used to incrementally * iterate over the result. * - * @psalm-param ArrayCollection|mixed[] $parameters - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param ArrayCollection|mixed[] $parameters + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode * * @return iterable */ @@ -877,8 +877,8 @@ public function toIterable( /** * Executes the query. * - * @psalm-param ArrayCollection|mixed[]|null $parameters - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param ArrayCollection|mixed[]|null $parameters + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode */ public function execute( ArrayCollection|array|null $parameters = null, @@ -894,8 +894,8 @@ public function execute( /** * Execute query ignoring second level cache. * - * @psalm-param ArrayCollection|mixed[]|null $parameters - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param ArrayCollection|mixed[]|null $parameters + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode */ private function executeIgnoreQueryCache( ArrayCollection|array|null $parameters = null, @@ -965,8 +965,8 @@ private function getHydrationCache(): CacheItemPoolInterface /** * Load from second level cache or executes the query and put into cache. * - * @psalm-param ArrayCollection|mixed[]|null $parameters - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param ArrayCollection|mixed[]|null $parameters + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode */ private function executeUsingQueryCache( ArrayCollection|array|null $parameters = null, @@ -1029,7 +1029,7 @@ private function getTimestampKey(): TimestampCacheKey|null * automatically generated for you. * * @return string[] ($key, $hash) - * @psalm-return array{string, string} ($key, $hash) + * @phpstan-return array{string, string} ($key, $hash) */ protected function getHydrationCacheId(): array { diff --git a/src/Cache/DefaultCache.php b/src/Cache/DefaultCache.php index 685181c906e..3f947cf773b 100644 --- a/src/Cache/DefaultCache.php +++ b/src/Cache/DefaultCache.php @@ -25,7 +25,7 @@ class DefaultCache implements Cache /** * @var QueryCache[] - * @psalm-var array + * @phpstan-var array */ private array $queryCaches = []; diff --git a/src/Cache/DefaultQueryCache.php b/src/Cache/DefaultQueryCache.php index 08e703cd4b0..bf0cbc1b362 100644 --- a/src/Cache/DefaultQueryCache.php +++ b/src/Cache/DefaultQueryCache.php @@ -297,7 +297,7 @@ public function put(QueryCacheKey $key, ResultSetMapping $rsm, mixed $result, ar /** * @return mixed[]|null - * @psalm-return array{targetEntity: class-string, type: mixed, list?: array[], identifier?: array}|null + * @phpstan-return array{targetEntity: class-string, type: mixed, list?: array[], identifier?: array}|null */ private function storeAssociationCache(QueryCacheKey $key, AssociationMapping $assoc, mixed $assocValue): array|null { @@ -348,7 +348,7 @@ private function storeAssociationCache(QueryCacheKey $key, AssociationMapping $a ]; } - /** @psalm-return list|object|null */ + /** @phpstan-return list|object|null */ private function getAssociationValue( ResultSetMapping $rsm, string $assocAlias, @@ -374,9 +374,9 @@ private function getAssociationValue( } /** - * @psalm-param array $path + * @phpstan-param array $path * - * @psalm-return list|object|null + * @phpstan-return list|object|null */ private function getAssociationPathValue(mixed $value, array $path): array|object|null { diff --git a/src/Configuration.php b/src/Configuration.php index 59ddb214d8a..361d146a50b 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -41,16 +41,16 @@ class Configuration extends \Doctrine\DBAL\Configuration /** @var mixed[] */ protected array $attributes = []; - /** @psalm-var array, ClassMetadata::GENERATOR_TYPE_*> */ + /** @phpstan-var array, ClassMetadata::GENERATOR_TYPE_*> */ private $identityGenerationPreferences = []; - /** @psalm-param array, ClassMetadata::GENERATOR_TYPE_*> $value */ + /** @phpstan-param array, ClassMetadata::GENERATOR_TYPE_*> $value */ public function setIdentityGenerationPreferences(array $value): void { $this->identityGenerationPreferences = $value; } - /** @psalm-return array, ClassMetadata::GENERATOR_TYPE_*> $value */ + /** @phpstan-return array, ClassMetadata::GENERATOR_TYPE_*> $value */ public function getIdentityGenerationPreferences(): array { return $this->identityGenerationPreferences; @@ -122,7 +122,7 @@ public function setMetadataDriverImpl(MappingDriver $driverImpl): void /** * Sets the entity alias map. * - * @psalm-param array $entityNamespaces + * @phpstan-param array $entityNamespaces */ public function setEntityNamespaces(array $entityNamespaces): void { @@ -132,7 +132,7 @@ public function setEntityNamespaces(array $entityNamespaces): void /** * Retrieves the list of registered entity namespace aliases. * - * @psalm-return array + * @phpstan-return array */ public function getEntityNamespaces(): array { @@ -191,7 +191,7 @@ public function setMetadataCache(CacheItemPoolInterface $cache): void * DQL function names are case-insensitive. * * @param class-string|callable $className Class name or a callable that returns the function. - * @psalm-param class-string|callable(string):FunctionNode $className + * @phpstan-param class-string|callable(string):FunctionNode $className */ public function addCustomStringFunction(string $name, string|callable $className): void { @@ -201,7 +201,7 @@ public function addCustomStringFunction(string $name, string|callable $className /** * Gets the implementation class name of a registered custom string DQL function. * - * @psalm-return class-string|callable(string):FunctionNode|null + * @phpstan-return class-string|callable(string):FunctionNode|null */ public function getCustomStringFunction(string $name): string|callable|null { @@ -218,7 +218,7 @@ public function getCustomStringFunction(string $name): string|callable|null * * Any previously added string functions are discarded. * - * @psalm-param array|callable(string):FunctionNode> $functions The map of custom + * @phpstan-param array|callable(string):FunctionNode> $functions The map of custom * DQL string functions. */ public function setCustomStringFunctions(array $functions): void @@ -236,7 +236,7 @@ public function setCustomStringFunctions(array $functions): void * DQL function names are case-insensitive. * * @param class-string|callable $className Class name or a callable that returns the function. - * @psalm-param class-string|callable(string):FunctionNode $className + * @phpstan-param class-string|callable(string):FunctionNode $className */ public function addCustomNumericFunction(string $name, string|callable $className): void { @@ -246,7 +246,7 @@ public function addCustomNumericFunction(string $name, string|callable $classNam /** * Gets the implementation class name of a registered custom numeric DQL function. * - * @psalm-return ?class-string|callable(string):FunctionNode + * @phpstan-return class-string|callable(string):FunctionNode|null */ public function getCustomNumericFunction(string $name): string|callable|null { @@ -281,7 +281,7 @@ public function setCustomNumericFunctions(array $functions): void * DQL function names are case-insensitive. * * @param string|callable $className Class name or a callable that returns the function. - * @psalm-param class-string|callable(string):FunctionNode $className + * @phpstan-param class-string|callable(string):FunctionNode $className */ public function addCustomDatetimeFunction(string $name, string|callable $className): void { @@ -309,7 +309,7 @@ public function getCustomDatetimeFunction(string $name): string|callable|null * Any previously added date/time functions are discarded. * * @param array $functions The map of custom DQL date/time functions. - * @psalm-param array|callable(string):FunctionNode> $functions + * @phpstan-param array|callable(string):FunctionNode> $functions */ public function setCustomDatetimeFunctions(array $functions): void { @@ -538,7 +538,7 @@ public function getSecondLevelCacheConfiguration(): CacheConfiguration|null /** * Returns query hints, which will be applied to every query in application * - * @psalm-return array + * @phpstan-return array */ public function getDefaultQueryHints(): array { @@ -548,7 +548,7 @@ public function getDefaultQueryHints(): array /** * Sets array of query hints, which will be applied to every query in application * - * @psalm-param array $defaultQueryHints + * @phpstan-param array $defaultQueryHints */ public function setDefaultQueryHints(array $defaultQueryHints): void { diff --git a/src/EntityManager.php b/src/EntityManager.php index 5324d9cac7b..06b34689abf 100644 --- a/src/EntityManager.php +++ b/src/EntityManager.php @@ -586,7 +586,7 @@ public function hasFilters(): bool } /** - * @psalm-param LockMode::* $lockMode + * @phpstan-param LockMode::* $lockMode * * @throws OptimisticLockException * @throws TransactionRequiredException diff --git a/src/EntityManagerInterface.php b/src/EntityManagerInterface.php index d4c64ef06dc..03dbdbbea19 100644 --- a/src/EntityManagerInterface.php +++ b/src/EntityManagerInterface.php @@ -71,10 +71,10 @@ public function beginTransaction(): void; * If an exception occurs during execution of the function or flushing or transaction commit, * the transaction is rolled back, the EntityManager closed and the exception re-thrown. * - * @psalm-param callable(self): T $func The function to execute transactionally. + * @phpstan-param callable(self): T $func The function to execute transactionally. * * @return mixed The value returned from the closure. - * @psalm-return T + * @phpstan-return T * * @template T */ @@ -117,11 +117,11 @@ public function createQueryBuilder(): QueryBuilder; * during the search. * @param int|null $lockVersion The version of the entity to find when using * optimistic locking. - * @psalm-param class-string $className - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param class-string $className + * @phpstan-param LockMode::*|null $lockMode * * @return object|null The entity instance or NULL if the entity can not be found. - * @psalm-return T|null + * @phpstan-return T|null * * @throws OptimisticLockException * @throws ORMInvalidArgumentException @@ -139,7 +139,7 @@ public function find(string $className, mixed $id, LockMode|int|null $lockMode = * @param LockMode|int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants * or NULL if no specific lock mode should be used * during the search. - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param LockMode::*|null $lockMode * * @throws ORMInvalidArgumentException * @throws ORMException @@ -172,7 +172,7 @@ public function close(): void; /** * Acquire a lock on the given entity. * - * @psalm-param LockMode::* $lockMode + * @phpstan-param LockMode::* $lockMode * * @throws OptimisticLockException * @throws PessimisticLockException @@ -202,7 +202,7 @@ public function getUnitOfWork(): UnitOfWork; /** * Create a new instance for the given hydration mode. * - * @psalm-param string|AbstractQuery::HYDRATE_* $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_* $hydrationMode * * @throws ORMException */ @@ -233,9 +233,9 @@ public function hasFilters(): bool; * * @param string|class-string $className * - * @psalm-return ($className is class-string ? Mapping\ClassMetadata : Mapping\ClassMetadata) + * @phpstan-return ($className is class-string ? Mapping\ClassMetadata : Mapping\ClassMetadata) * - * @psalm-template T of object + * @phpstan-template T of object */ public function getClassMetadata(string $className): Mapping\ClassMetadata; } diff --git a/src/EntityRepository.php b/src/EntityRepository.php index 87a264344f7..fb1315b785d 100644 --- a/src/EntityRepository.php +++ b/src/EntityRepository.php @@ -76,10 +76,10 @@ public function createResultSetMappingBuilder(string $alias): ResultSetMappingBu * @param LockMode|int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants * or NULL if no specific lock mode should be used * during the search. - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param LockMode::*|null $lockMode * * @return object|null The entity instance or NULL if the entity can not be found. - * @psalm-return ?T + * @phpstan-return ?T */ public function find(mixed $id, LockMode|int|null $lockMode = null, int|null $lockVersion = null): object|null { @@ -89,7 +89,7 @@ public function find(mixed $id, LockMode|int|null $lockMode = null, int|null $lo /** * Finds all entities in the repository. * - * @psalm-return list The entities. + * @phpstan-return list The entities. */ public function findAll(): array { @@ -101,7 +101,7 @@ public function findAll(): array * * {@inheritDoc} * - * @psalm-return list + * @phpstan-return list */ public function findBy(array $criteria, array|null $orderBy = null, int|null $limit = null, int|null $offset = null): array { @@ -113,10 +113,10 @@ public function findBy(array $criteria, array|null $orderBy = null, int|null $li /** * Finds a single entity by a set of criteria. * - * @psalm-param array $criteria - * @psalm-param array|null $orderBy + * @phpstan-param array $criteria + * @phpstan-param array|null $orderBy * - * @psalm-return T|null + * @phpstan-return T|null */ public function findOneBy(array $criteria, array|null $orderBy = null): object|null { @@ -128,10 +128,10 @@ public function findOneBy(array $criteria, array|null $orderBy = null): object|n /** * Counts entities by a set of criteria. * - * @psalm-param array $criteria + * @phpstan-param array $criteria * * @return int The cardinality of the objects that match the given criteria. - * @psalm-return 0|positive-int + * @phpstan-return 0|positive-int * * @todo Add this method to `ObjectRepository` interface in the next major release */ @@ -144,7 +144,7 @@ public function count(array $criteria = []): int * Adds support for magic method calls. * * @param mixed[] $arguments - * @psalm-param list $arguments + * @phpstan-param list $arguments * * @throws BadMethodCallException If the method called is invalid. */ @@ -185,7 +185,7 @@ protected function getEntityManager(): EntityManagerInterface return $this->em; } - /** @psalm-return ClassMetadata */ + /** @phpstan-return ClassMetadata */ protected function getClassMetadata(): ClassMetadata { return $this->class; @@ -195,7 +195,7 @@ protected function getClassMetadata(): ClassMetadata * Select all elements from a selectable that match the expression and * return a new collection containing these elements. * - * @psalm-return AbstractLazyCollection&Selectable + * @phpstan-return AbstractLazyCollection&Selectable */ public function matching(Criteria $criteria): AbstractLazyCollection&Selectable { @@ -209,7 +209,7 @@ public function matching(Criteria $criteria): AbstractLazyCollection&Selectable * * @param string $method The method to call * @param string $by The property name used as condition - * @psalm-param list $arguments The arguments to pass at method call + * @phpstan-param list $arguments The arguments to pass at method call * * @throws InvalidMagicMethodCall If the method called is invalid or the * requested field/association does not exist. diff --git a/src/Event/ListenersInvoker.php b/src/Event/ListenersInvoker.php index c0c327e5aad..b7e06912fbb 100644 --- a/src/Event/ListenersInvoker.php +++ b/src/Event/ListenersInvoker.php @@ -38,7 +38,7 @@ public function __construct(EntityManagerInterface $em) * @param ClassMetadata $metadata The entity metadata. * @param string $eventName The entity lifecycle event. * - * @psalm-return int-mask-of Bitmask of subscribed event systems. + * @phpstan-return int-mask-of Bitmask of subscribed event systems. */ public function getSubscribedSystems(ClassMetadata $metadata, string $eventName): int { @@ -66,7 +66,7 @@ public function getSubscribedSystems(ClassMetadata $metadata, string $eventName) * @param string $eventName The entity lifecycle event. * @param object $entity The Entity on which the event occurred. * @param EventArgs $event The Event args. - * @psalm-param int-mask-of $invoke Bitmask to invoke listeners. + * @phpstan-param int-mask-of $invoke Bitmask to invoke listeners. */ public function invoke( ClassMetadata $metadata, diff --git a/src/Event/PreUpdateEventArgs.php b/src/Event/PreUpdateEventArgs.php index 090487b8605..d50033414cf 100644 --- a/src/Event/PreUpdateEventArgs.php +++ b/src/Event/PreUpdateEventArgs.php @@ -24,7 +24,7 @@ class PreUpdateEventArgs extends LifecycleEventArgs /** * @param mixed[][] $changeSet - * @psalm-param array $changeSet + * @phpstan-param array $changeSet */ public function __construct(object $entity, EntityManagerInterface $em, array &$changeSet) { @@ -37,7 +37,7 @@ public function __construct(object $entity, EntityManagerInterface $em, array &$ * Retrieves entity changeset. * * @return mixed[][] - * @psalm-return array + * @phpstan-return array */ public function getEntityChangeSet(): array { diff --git a/src/Internal/Hydration/AbstractHydrator.php b/src/Internal/Hydration/AbstractHydrator.php index 2ccba498e63..0a44d3a02b5 100644 --- a/src/Internal/Hydration/AbstractHydrator.php +++ b/src/Internal/Hydration/AbstractHydrator.php @@ -29,7 +29,7 @@ * Base class for all hydrators. A hydrator is a class that provides some form * of transformation of an SQL result set into another structure. * - * @psalm-consistent-constructor + * @phpstan-consistent-constructor */ abstract class AbstractHydrator { @@ -86,7 +86,7 @@ public function __construct(protected EntityManagerInterface $em) /** * Initiates a row-by-row hydration. * - * @psalm-param array $hints + * @phpstan-param array $hints * * @return Generator * @@ -153,7 +153,7 @@ final protected function resultSetMapping(): ResultSetMapping /** * Hydrates all rows returned by the passed statement instance at once. * - * @psalm-param array $hints + * @phpstan-param array $hints */ public function hydrateAll(Result $stmt, ResultSetMapping $resultSetMapping, array $hints = []): mixed { @@ -242,14 +242,14 @@ abstract protected function hydrateAllData(): mixed; * the values applied. Scalar values are kept in a specific key 'scalars'. * * @param mixed[] $data SQL Result Row. - * @psalm-param array $id Dql-Alias => ID-Hash. - * @psalm-param array $nonemptyComponents Does this DQL-Alias has at least one non NULL value? + * @phpstan-param array $id Dql-Alias => ID-Hash. + * @phpstan-param array $nonemptyComponents Does this DQL-Alias has at least one non NULL value? * * @return array> An array with all the fields * (name => value) of the data * row, grouped by their * component alias. - * @psalm-return array{ + * @phpstan-return array{ * data: array, * newObjects?: array $data + * @phpstan-param array $data * * @return mixed[] The processed row. - * @psalm-return array + * @phpstan-return array */ protected function gatherScalarRowData(array &$data): array { @@ -405,7 +405,7 @@ protected function gatherScalarRowData(array &$data): array * @param string $key Column name * * @return mixed[]|null - * @psalm-return array|null + * @phpstan-return array|null */ protected function hydrateColumnInfo(string $key): array|null { @@ -502,7 +502,7 @@ protected function hydrateColumnInfo(string $key): array|null /** * @return string[] - * @psalm-return non-empty-list + * @phpstan-return non-empty-list */ private function getDiscriminatorValues(ClassMetadata $classMetadata): array { diff --git a/src/Internal/Hydration/ObjectHydrator.php b/src/Internal/Hydration/ObjectHydrator.php index fe780e8b892..21383e8c16e 100644 --- a/src/Internal/Hydration/ObjectHydrator.php +++ b/src/Internal/Hydration/ObjectHydrator.php @@ -213,7 +213,7 @@ private function initRelatedCollection( * Gets an entity instance. * * @param string $dqlAlias The DQL alias of the entity's class. - * @psalm-param array $data The instance data. + * @phpstan-param array $data The instance data. * * @throws HydrationException */ @@ -266,7 +266,7 @@ private function getEntity(array $data, string $dqlAlias): object /** * @param class-string $className - * @psalm-param array $data + * @phpstan-param array $data */ private function getEntityFromIdentityMap(string $className, array $data): object|bool { diff --git a/src/Internal/NoUnknownNamedArguments.php b/src/Internal/NoUnknownNamedArguments.php index 7584744c162..a3843307f27 100644 --- a/src/Internal/NoUnknownNamedArguments.php +++ b/src/Internal/NoUnknownNamedArguments.php @@ -29,7 +29,7 @@ trait NoUnknownNamedArguments * @param TItem[] $parameter * * @template TItem - * @psalm-assert list $parameter + * @phpstan-assert list $parameter */ private static function validateVariadicParameter(array $parameter): void { diff --git a/src/Mapping/AssociationMapping.php b/src/Mapping/AssociationMapping.php index ce7bdb40ab4..74bef09f9de 100644 --- a/src/Mapping/AssociationMapping.php +++ b/src/Mapping/AssociationMapping.php @@ -97,7 +97,7 @@ final public function __construct( /** * @param mixed[] $mappingArray - * @psalm-param array{ + * @phpstan-param array{ * fieldName: string, * sourceEntity: class-string, * targetEntity: class-string, @@ -153,75 +153,75 @@ public static function fromMappingArray(array $mappingArray): static } /** - * @psalm-assert-if-true OwningSideMapping $this - * @psalm-assert-if-false InverseSideMapping $this + * @phpstan-assert-if-true OwningSideMapping $this + * @phpstan-assert-if-false InverseSideMapping $this */ final public function isOwningSide(): bool { return $this instanceof OwningSideMapping; } - /** @psalm-assert-if-true ToOneAssociationMapping $this */ + /** @phpstan-assert-if-true ToOneAssociationMapping $this */ final public function isToOne(): bool { return $this instanceof ToOneAssociationMapping; } - /** @psalm-assert-if-true ToManyAssociationMapping $this */ + /** @phpstan-assert-if-true ToManyAssociationMapping $this */ final public function isToMany(): bool { return $this instanceof ToManyAssociationMapping; } - /** @psalm-assert-if-true OneToOneOwningSideMapping $this */ + /** @phpstan-assert-if-true OneToOneOwningSideMapping $this */ final public function isOneToOneOwningSide(): bool { return $this->isOneToOne() && $this->isOwningSide(); } - /** @psalm-assert-if-true OneToOneOwningSideMapping|ManyToOneAssociationMapping $this */ + /** @phpstan-assert-if-true OneToOneOwningSideMapping|ManyToOneAssociationMapping $this */ final public function isToOneOwningSide(): bool { return $this->isToOne() && $this->isOwningSide(); } - /** @psalm-assert-if-true ManyToManyOwningSideMapping $this */ + /** @phpstan-assert-if-true ManyToManyOwningSideMapping $this */ final public function isManyToManyOwningSide(): bool { return $this instanceof ManyToManyOwningSideMapping; } - /** @psalm-assert-if-true OneToOneAssociationMapping $this */ + /** @phpstan-assert-if-true OneToOneAssociationMapping $this */ final public function isOneToOne(): bool { return $this instanceof OneToOneAssociationMapping; } - /** @psalm-assert-if-true OneToManyAssociationMapping $this */ + /** @phpstan-assert-if-true OneToManyAssociationMapping $this */ final public function isOneToMany(): bool { return $this instanceof OneToManyAssociationMapping; } - /** @psalm-assert-if-true ManyToOneAssociationMapping $this */ + /** @phpstan-assert-if-true ManyToOneAssociationMapping $this */ final public function isManyToOne(): bool { return $this instanceof ManyToOneAssociationMapping; } - /** @psalm-assert-if-true ManyToManyAssociationMapping $this */ + /** @phpstan-assert-if-true ManyToManyAssociationMapping $this */ final public function isManyToMany(): bool { return $this instanceof ManyToManyAssociationMapping; } - /** @psalm-assert-if-true ToManyAssociationMapping $this */ + /** @phpstan-assert-if-true ToManyAssociationMapping $this */ final public function isOrdered(): bool { return $this->isToMany() && $this->orderBy() !== []; } - /** @psalm-assert-if-true ToManyAssociationMapping $this */ + /** @phpstan-assert-if-true ToManyAssociationMapping $this */ public function isIndexed(): bool { return false; diff --git a/src/Mapping/AssociationOverride.php b/src/Mapping/AssociationOverride.php index e0ebc073fd3..a10372dbd2b 100644 --- a/src/Mapping/AssociationOverride.php +++ b/src/Mapping/AssociationOverride.php @@ -27,7 +27,7 @@ final class AssociationOverride implements MappingAttribute * @param JoinColumn|array $inverseJoinColumns * @param JoinTable|null $joinTable The join table that maps the relationship. * @param string|null $inversedBy The name of the association-field on the inverse-side. - * @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY'|null $fetch + * @phpstan-param 'LAZY'|'EAGER'|'EXTRA_LAZY'|null $fetch */ public function __construct( public readonly string $name, diff --git a/src/Mapping/Builder/ClassMetadataBuilder.php b/src/Mapping/Builder/ClassMetadataBuilder.php index 48f052c86d5..2e9fca1a9d2 100644 --- a/src/Mapping/Builder/ClassMetadataBuilder.php +++ b/src/Mapping/Builder/ClassMetadataBuilder.php @@ -109,7 +109,7 @@ public function setTable(string $name): static /** * Adds Index. * - * @psalm-param list $columns + * @phpstan-param list $columns * * @return $this */ @@ -127,7 +127,7 @@ public function addIndex(array $columns, string $name): static /** * Adds Unique Constraint. * - * @psalm-param list $columns + * @phpstan-param list $columns * * @return $this */ @@ -235,7 +235,7 @@ public function addLifecycleEvent(string $methodName, string $event): static /** * Adds Field. * - * @psalm-param array $mapping + * @phpstan-param array $mapping * * @return $this */ diff --git a/src/Mapping/Builder/OneToManyAssociationBuilder.php b/src/Mapping/Builder/OneToManyAssociationBuilder.php index 077c558cdd9..0b0e1aac9e1 100644 --- a/src/Mapping/Builder/OneToManyAssociationBuilder.php +++ b/src/Mapping/Builder/OneToManyAssociationBuilder.php @@ -12,7 +12,7 @@ class OneToManyAssociationBuilder extends AssociationBuilder { /** - * @psalm-param array $fieldNames + * @phpstan-param array $fieldNames * * @return $this */ diff --git a/src/Mapping/Cache.php b/src/Mapping/Cache.php index 3161ab3a545..5eda277c90a 100644 --- a/src/Mapping/Cache.php +++ b/src/Mapping/Cache.php @@ -10,7 +10,7 @@ #[Attribute(Attribute::TARGET_CLASS | Attribute::TARGET_PROPERTY)] final class Cache implements MappingAttribute { - /** @psalm-param 'READ_ONLY'|'NONSTRICT_READ_WRITE'|'READ_WRITE' $usage */ + /** @phpstan-param 'READ_ONLY'|'NONSTRICT_READ_WRITE'|'READ_WRITE' $usage */ public function __construct( public readonly string $usage = 'READ_ONLY', public readonly string|null $region = null, diff --git a/src/Mapping/ChangeTrackingPolicy.php b/src/Mapping/ChangeTrackingPolicy.php index 7181d9f6f1c..f72fa5c550e 100644 --- a/src/Mapping/ChangeTrackingPolicy.php +++ b/src/Mapping/ChangeTrackingPolicy.php @@ -9,7 +9,7 @@ #[Attribute(Attribute::TARGET_CLASS)] final class ChangeTrackingPolicy implements MappingAttribute { - /** @psalm-param 'DEFERRED_IMPLICIT'|'DEFERRED_EXPLICIT' $value */ + /** @phpstan-param 'DEFERRED_IMPLICIT'|'DEFERRED_EXPLICIT' $value */ public function __construct( public readonly string $value, ) { diff --git a/src/Mapping/ClassMetadata.php b/src/Mapping/ClassMetadata.php index f7745144fa6..7351d09bce0 100644 --- a/src/Mapping/ClassMetadata.php +++ b/src/Mapping/ClassMetadata.php @@ -71,7 +71,7 @@ * get the whole class name, namespace inclusive, prepended to every property in * the serialized representation). * - * @psalm-type ConcreteAssociationMapping = OneToOneOwningSideMapping|OneToOneInverseSideMapping|ManyToOneAssociationMapping|OneToManyAssociationMapping|ManyToManyOwningSideMapping|ManyToManyInverseSideMapping + * @phpstan-type ConcreteAssociationMapping = OneToOneOwningSideMapping|OneToOneInverseSideMapping|ManyToOneAssociationMapping|OneToManyAssociationMapping|ManyToManyOwningSideMapping|ManyToManyInverseSideMapping * @template-covariant T of object * @template-implements PersistenceClassMetadata */ @@ -237,7 +237,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * hierarchy. If the entity is not part of a mapped inheritance hierarchy this is the same * as {@link $name}. * - * @psalm-var class-string + * @phpstan-var class-string */ public string $rootEntityName; @@ -261,7 +261,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * The name of the custom repository class used for the entity class. * (Optional). * - * @psalm-var ?class-string + * @phpstan-var ?class-string */ public string|null $customRepositoryClassName = null; @@ -279,7 +279,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * READ-ONLY: The names of the parent entity classes (ancestors), starting with the * nearest one and ending with the root entity class. * - * @psalm-var list + * @phpstan-var list */ public array $parentClasses = []; @@ -306,14 +306,14 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * For subclasses of such root entities, the list can be reused/passed downwards, it only needs to * be filtered accordingly (only keep remaining subclasses) * - * @psalm-var list + * @phpstan-var list */ public array $subClasses = []; /** * READ-ONLY: The names of all embedded classes based on properties. * - * @psalm-var array + * @phpstan-var array */ public array $embeddedClasses = []; @@ -321,21 +321,21 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * READ-ONLY: The field names of all fields that are part of the identifier/primary key * of the mapped entity class. * - * @psalm-var list + * @phpstan-var list */ public array $identifier = []; /** * READ-ONLY: The inheritance mapping type used by the class. * - * @psalm-var self::INHERITANCE_TYPE_* + * @phpstan-var self::INHERITANCE_TYPE_* */ public int $inheritanceType = self::INHERITANCE_TYPE_NONE; /** * READ-ONLY: The Id generator type used by the class. * - * @psalm-var self::GENERATOR_TYPE_* + * @phpstan-var self::GENERATOR_TYPE_* */ public int $generatorType = self::GENERATOR_TYPE_NONE; @@ -351,7 +351,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * READ-ONLY: An array of field names. Used to look up field names from column names. * Keys are column names and values are field names. * - * @psalm-var array + * @phpstan-var array */ public array $fieldNames = []; @@ -386,7 +386,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * * @var array * - * @psalm-var array + * @phpstan-var array */ public array $discriminatorMap = []; @@ -406,7 +406,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * uniqueConstraints => array * * @var mixed[] - * @psalm-var array{ + * @phpstan-var array{ * name: string, * schema?: string, * indexes?: array, @@ -420,14 +420,14 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable /** * READ-ONLY: The registered lifecycle callbacks for entities of this class. * - * @psalm-var array> + * @phpstan-var array> */ public array $lifecycleCallbacks = []; /** * READ-ONLY: The registered entity listeners. * - * @psalm-var array> + * @phpstan-var array> */ public array $entityListeners = []; @@ -443,7 +443,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * ) * * - * @psalm-var array + * @phpstan-var array */ public array $associationMappings = []; @@ -487,7 +487,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * * * @var array|null - * @psalm-var array{sequenceName: string, allocationSize: string, initialValue: string, quoted?: mixed}|null + * @phpstan-var array{sequenceName: string, allocationSize: string, initialValue: string, quoted?: mixed}|null * @todo Merge with tableGeneratorDefinition into generic generatorDefinition */ public array|null $sequenceGeneratorDefinition = null; @@ -554,7 +554,7 @@ class ClassMetadata implements PersistenceClassMetadata, Stringable * metadata of the class with the given name. * * @param string $name The name of the entity class the new instance is used for. - * @psalm-param class-string $name + * @phpstan-param class-string $name */ public function __construct(public string $name, NamingStrategy|null $namingStrategy = null, TypedFieldMapper|null $typedFieldMapper = null) { @@ -568,7 +568,7 @@ public function __construct(public string $name, NamingStrategy|null $namingStra * Gets the ReflectionProperties of the mapped class. * * @return ReflectionProperty[]|null[] An array of ReflectionProperty instances. - * @psalm-return array + * @phpstan-return array */ public function getReflectionProperties(): array { @@ -634,7 +634,7 @@ public function getIdentifierValues(object $entity): array /** * Populates the entity identifier of an entity. * - * @psalm-param array $id + * @phpstan-param array $id * * @todo Rename to assignIdentifier() */ @@ -938,7 +938,7 @@ public function validateLifecycleCallbacks(ReflectionService $reflService): void } } - /** @psalm-param array{usage?: mixed, region?: mixed} $cache */ + /** @phpstan-param array{usage?: mixed, region?: mixed} $cache */ public function enableCache(array $cache): void { if (! isset($cache['usage'])) { @@ -952,17 +952,17 @@ public function enableCache(array $cache): void $this->cache = $cache; } - /** @psalm-param array{usage?: int, region?: string} $cache */ + /** @phpstan-param array{usage?: int, region?: string} $cache */ public function enableAssociationCache(string $fieldName, array $cache): void { $this->associationMappings[$fieldName]->cache = $this->getAssociationCacheDefaults($fieldName, $cache); } /** - * @psalm-param array{usage?: int, region?: string|null} $cache + * @phpstan-param array{usage?: int, region?: string|null} $cache * * @return int[]|string[] - * @psalm-return array{usage: int, region: string|null} + * @phpstan-return array{usage: int, region: string|null} */ public function getAssociationCacheDefaults(string $fieldName, array $cache): array { @@ -1079,7 +1079,7 @@ public function getAssociationMapping(string $fieldName): AssociationMapping /** * Gets all association mappings of the class. * - * @psalm-return array + * @phpstan-return array */ public function getAssociationMappings(): array { @@ -1146,7 +1146,7 @@ private function validateAndCompleteTypedAssociationMapping(array $mapping): arr /** * Validates & completes the given field mapping. * - * @psalm-param array{ + * @phpstan-param array{ * fieldName?: string, * columnName?: string, * id?: bool, @@ -1246,7 +1246,7 @@ protected function validateAndCompleteFieldMapping(array $mapping): FieldMapping * Validates & completes the basic mapping information that is common to all * association mappings (one-to-one, many-ot-one, one-to-many, many-to-many). * - * @psalm-param array $mapping The mapping. + * @phpstan-param array $mapping The mapping. * * @return ConcreteAssociationMapping * @@ -1461,7 +1461,7 @@ public function getSingleIdentifierColumnName(): string * Sets the mapped identifier/primary key fields of this class. * Mainly used by the ClassMetadataFactory to assign inherited identifiers. * - * @psalm-param list $identifier + * @phpstan-param list $identifier */ public function setIdentifier(array $identifier): void { @@ -1485,10 +1485,10 @@ public function hasField(string $fieldName): bool /** * Gets an array containing all the column names. * - * @psalm-param list|null $fieldNames + * @phpstan-param list|null $fieldNames * * @return mixed[] - * @psalm-return list + * @phpstan-return list */ public function getColumnNames(array|null $fieldNames = null): array { @@ -1502,7 +1502,7 @@ public function getColumnNames(array|null $fieldNames = null): array /** * Returns an array with all the identifier column names. * - * @psalm-return list + * @phpstan-return list */ public function getIdentifierColumnNames(): array { @@ -1529,7 +1529,7 @@ public function getIdentifierColumnNames(): array /** * Sets the type of Id generator to use for the mapped class. * - * @psalm-param self::GENERATOR_TYPE_* $generatorType + * @phpstan-param self::GENERATOR_TYPE_* $generatorType */ public function setIdGeneratorType(int $generatorType): void { @@ -1582,7 +1582,7 @@ public function isIdGeneratorIdentity(): bool /** * Checks whether the class uses a sequence for id generation. * - * @psalm-assert-if-true !null $this->sequenceGeneratorDefinition + * @phpstan-assert-if-true !null $this->sequenceGeneratorDefinition */ public function isIdGeneratorSequence(): bool { @@ -1638,7 +1638,7 @@ public function getTemporaryIdTableName(): string /** * Sets the mapped subclasses of this class. * - * @psalm-param list $subclasses The names of all mapped subclasses. + * @phpstan-param list $subclasses The names of all mapped subclasses. */ public function setSubclasses(array $subclasses): void { @@ -1653,7 +1653,7 @@ public function setSubclasses(array $subclasses): void * Assumes that the class names in the passed array are in the order: * directParent -> directParentParent -> directParentParentParent ... -> root. * - * @psalm-param list $classNames + * @phpstan-param list $classNames */ public function setParentClasses(array $classNames): void { @@ -1667,7 +1667,7 @@ public function setParentClasses(array $classNames): void /** * Sets the inheritance type used by the class and its subclasses. * - * @psalm-param self::INHERITANCE_TYPE_* $type + * @phpstan-param self::INHERITANCE_TYPE_* $type * * @throws MappingException */ @@ -1683,7 +1683,7 @@ public function setInheritanceType(int $type): void /** * Sets the association to override association mapping of property for an entity relationship. * - * @psalm-param array{joinColumns?: array, inversedBy?: ?string, joinTable?: array, fetch?: ?string, cascade?: string[]} $overrideMapping + * @phpstan-param array{joinColumns?: array, inversedBy?: ?string, joinTable?: array, fetch?: ?string, cascade?: string[]} $overrideMapping * * @throws MappingException */ @@ -1741,7 +1741,7 @@ public function setAssociationOverride(string $fieldName, array $overrideMapping /** * Sets the override for a mapped field. * - * @psalm-param array $overrideMapping + * @phpstan-param array $overrideMapping * * @throws MappingException */ @@ -1836,7 +1836,7 @@ public function setTableName(string $tableName): void * * If a key is omitted, the current value is kept. * - * @psalm-param array $table The table description. + * @phpstan-param array $table The table description. */ public function setPrimaryTable(array $table): void { @@ -1888,7 +1888,7 @@ private function isInheritanceType(int $type): bool /** * Adds a mapped field to the class. * - * @psalm-param array $mapping The field mapping. + * @phpstan-param array $mapping The field mapping. * * @throws MappingException */ @@ -1956,7 +1956,7 @@ public function mapOneToOne(array $mapping): void /** * Adds a one-to-many mapping. * - * @psalm-param array $mapping The mapping. + * @phpstan-param array $mapping The mapping. */ public function mapOneToMany(array $mapping): void { @@ -1970,7 +1970,7 @@ public function mapOneToMany(array $mapping): void /** * Adds a many-to-one mapping. * - * @psalm-param array $mapping The mapping. + * @phpstan-param array $mapping The mapping. */ public function mapManyToOne(array $mapping): void { @@ -1984,7 +1984,7 @@ public function mapManyToOne(array $mapping): void /** * Adds a many-to-many mapping. * - * @psalm-param array $mapping The mapping. + * @phpstan-param array $mapping The mapping. */ public function mapManyToMany(array $mapping): void { @@ -2015,7 +2015,7 @@ protected function _storeAssociationMapping(AssociationMapping $assocMapping): v * Registers a custom repository class for the entity class. * * @param string|null $repositoryClassName The class name of the custom mapper. - * @psalm-param class-string|null $repositoryClassName + * @phpstan-param class-string|null $repositoryClassName */ public function setCustomRepositoryClass(string|null $repositoryClassName): void { @@ -2055,7 +2055,7 @@ public function hasLifecycleCallbacks(string $lifecycleEvent): bool * Gets the registered lifecycle callbacks for an event. * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function getLifecycleCallbacks(string $event): array { @@ -2082,7 +2082,7 @@ public function addLifecycleCallback(string $callback, string $event): void * Sets the lifecycle callbacks for entities of this class. * Any previously registered callbacks are overwritten. * - * @psalm-param array> $callbacks + * @phpstan-param array> $callbacks */ public function setLifecycleCallbacks(array $callbacks): void { @@ -2128,7 +2128,7 @@ public function addEntityListener(string $eventName, string $class, string $meth * @see getDiscriminatorColumn() * * @param DiscriminatorColumnMapping|mixed[]|null $columnDef - * @psalm-param DiscriminatorColumnMapping|array{ + * @phpstan-param DiscriminatorColumnMapping|array{ * name: string|null, * fieldName?: string|null, * type?: string|null, @@ -2350,7 +2350,7 @@ public function setIdGenerator(AbstractIdGenerator $generator): void /** * Sets definition. * - * @psalm-param array $definition + * @phpstan-param array $definition */ public function setCustomGeneratorDefinition(array $definition): void { @@ -2370,7 +2370,7 @@ public function setCustomGeneratorDefinition(array $definition): void * ) * * - * @psalm-param array{sequenceName?: string, allocationSize?: int|string, initialValue?: int|string, quoted?: mixed} $definition + * @phpstan-param array{sequenceName?: string, allocationSize?: int|string, initialValue?: int|string, quoted?: mixed} $definition * * @throws MappingException */ @@ -2403,7 +2403,7 @@ public function setSequenceGeneratorDefinition(array $definition): void * Sets the version field mapping used for versioning. Sets the default * value to use depending on the column type. * - * @psalm-param array $mapping The version field mapping array. + * @phpstan-param array $mapping The version field mapping array. * * @throws MappingException */ @@ -2472,7 +2472,7 @@ public function getAssociationNames(): array /** * {@inheritDoc} * - * @psalm-return class-string + * @phpstan-return class-string * * @throws InvalidArgumentException */ @@ -2517,7 +2517,7 @@ public function getAssociationMappedByTargetField(string $assocName): string * @param C $className * * @return string|null null if and only if the input value is null - * @psalm-return (C is class-string ? class-string : (C is string ? string : null)) + * @phpstan-return (C is class-string ? class-string : (C is string ? string : null)) * * @template C of string|null */ @@ -2549,7 +2549,7 @@ public function getMetadataValue(string $name): mixed /** * Map Embedded Class * - * @psalm-param array{ + * @phpstan-param array{ * fieldName: string, * class?: class-string, * declaredField?: string, @@ -2658,7 +2658,7 @@ public function getSequencePrefix(AbstractPlatform $platform): string return $sequencePrefix; } - /** @psalm-param class-string $class */ + /** @phpstan-param class-string $class */ private function getAccessibleProperty(ReflectionService $reflService, string $class, string $field): ReflectionProperty|null { $reflectionProperty = $reflService->getAccessibleProperty($class, $field); diff --git a/src/Mapping/ClassMetadataFactory.php b/src/Mapping/ClassMetadataFactory.php index db0a8cf5500..b29f20c67b1 100644 --- a/src/Mapping/ClassMetadataFactory.php +++ b/src/Mapping/ClassMetadataFactory.php @@ -612,7 +612,7 @@ private function completeIdGeneratorMapping(ClassMetadata $class): void } } - /** @psalm-return ClassMetadata::GENERATOR_TYPE_* */ + /** @phpstan-return ClassMetadata::GENERATOR_TYPE_* */ private function determineIdGeneratorStrategy(AbstractPlatform $platform): int { assert($this->em !== null); diff --git a/src/Mapping/Column.php b/src/Mapping/Column.php index 68121e67ece..e044f5e3144 100644 --- a/src/Mapping/Column.php +++ b/src/Mapping/Column.php @@ -15,7 +15,7 @@ final class Column implements MappingAttribute * @param int|null $scale The scale for a decimal (exact numeric) column (Applies only for decimal column). * @param class-string|null $enumType * @param array $options - * @psalm-param 'NEVER'|'INSERT'|'ALWAYS'|null $generated + * @phpstan-param 'NEVER'|'INSERT'|'ALWAYS'|null $generated */ public function __construct( public readonly string|null $name = null, diff --git a/src/Mapping/DefaultTypedFieldMapper.php b/src/Mapping/DefaultTypedFieldMapper.php index 40b37b8c426..5f77e8f910d 100644 --- a/src/Mapping/DefaultTypedFieldMapper.php +++ b/src/Mapping/DefaultTypedFieldMapper.php @@ -20,7 +20,7 @@ use function enum_exists; use function is_a; -/** @psalm-type ScalarName = 'array'|'bool'|'float'|'int'|'string' */ +/** @phpstan-type ScalarName = 'array'|'bool'|'float'|'int'|'string' */ final class DefaultTypedFieldMapper implements TypedFieldMapper { /** @var array|string> $typedFieldMappings */ diff --git a/src/Mapping/DiscriminatorColumnMapping.php b/src/Mapping/DiscriminatorColumnMapping.php index 4ccb71c4b36..a96d22dbcbb 100644 --- a/src/Mapping/DiscriminatorColumnMapping.php +++ b/src/Mapping/DiscriminatorColumnMapping.php @@ -35,7 +35,7 @@ public function __construct( } /** - * @psalm-param array{ + * @phpstan-param array{ * type: string, * fieldName: string, * name: string, diff --git a/src/Mapping/Driver/AttributeDriver.php b/src/Mapping/Driver/AttributeDriver.php index da125fc394d..63ed6d89fa3 100644 --- a/src/Mapping/Driver/AttributeDriver.php +++ b/src/Mapping/Driver/AttributeDriver.php @@ -629,7 +629,7 @@ private function getGeneratedMode(string $generatedMode): int * Parses the given method. * * @return list - * @psalm-return list + * @phpstan-return list */ private function getMethodCallbacks(ReflectionMethod $method): array { @@ -677,7 +677,7 @@ private function getMethodCallbacks(ReflectionMethod $method): array * Parse the given JoinColumn as array * * @return mixed[] - * @psalm-return array{ + * @phpstan-return array{ * name: string|null, * unique: bool, * nullable: bool, @@ -709,7 +709,7 @@ private function joinColumnToArray(Mapping\JoinColumn|Mapping\InverseJoinColumn * Parse the given Column as array * * @return mixed[] - * @psalm-return array{ + * @phpstan-return array{ * fieldName: string, * type: mixed, * scale: int, diff --git a/src/Mapping/Driver/AttributeReader.php b/src/Mapping/Driver/AttributeReader.php index 2de622a07d9..fb8a4002b19 100644 --- a/src/Mapping/Driver/AttributeReader.php +++ b/src/Mapping/Driver/AttributeReader.php @@ -24,7 +24,7 @@ final class AttributeReader private array $isRepeatableAttribute = []; /** - * @psalm-return class-string-map> + * @phpstan-return class-string-map> * * @template T of MappingAttribute */ diff --git a/src/Mapping/Driver/DatabaseDriver.php b/src/Mapping/Driver/DatabaseDriver.php index d012c0a85bd..fd5ff5fc8e8 100644 --- a/src/Mapping/Driver/DatabaseDriver.php +++ b/src/Mapping/Driver/DatabaseDriver.php @@ -61,7 +61,7 @@ class DatabaseDriver implements MappingDriver /** @var array */ private array $classToTableNames = []; - /** @psalm-var array */ + /** @phpstan-var array */ private array $manyToManyTables = []; /** @var mixed[] */ @@ -126,8 +126,8 @@ public function setFieldNameForColumn(string $tableName, string $columnName, str * * @param Table[] $entityTables * @param Table[] $manyToManyTables - * @psalm-param list $entityTables - * @psalm-param list
$manyToManyTables + * @phpstan-param list
$entityTables + * @phpstan-param list
$manyToManyTables */ public function setTables(array $entityTables, array $manyToManyTables): void { @@ -366,7 +366,7 @@ private function buildFieldMappings(ClassMetadata $metadata): void * Build field mapping from a schema column definition * * @return mixed[] - * @psalm-return array{ + * @phpstan-return array{ * fieldName: string, * columnName: string, * type: string, diff --git a/src/Mapping/Driver/XmlDriver.php b/src/Mapping/Driver/XmlDriver.php index e11b6b61d6f..28b0f92f397 100644 --- a/src/Mapping/Driver/XmlDriver.php +++ b/src/Mapping/Driver/XmlDriver.php @@ -410,7 +410,6 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad if (isset($oneToManyElement->{'order-by'})) { $orderBy = []; foreach ($oneToManyElement->{'order-by'}->{'order-by-field'} ?? [] as $orderByField) { - /** @psalm-suppress DeprecatedConstant */ $orderBy[(string) $orderByField['name']] = isset($orderByField['direction']) ? (string) $orderByField['direction'] // @phpstan-ignore classConstant.deprecated @@ -540,7 +539,6 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad if (isset($manyToManyElement->{'order-by'})) { $orderBy = []; foreach ($manyToManyElement->{'order-by'}->{'order-by-field'} ?? [] as $orderByField) { - /** @psalm-suppress DeprecatedConstant */ $orderBy[(string) $orderByField['name']] = isset($orderByField['direction']) ? (string) $orderByField['direction'] // @phpstan-ignore classConstant.deprecated @@ -668,7 +666,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad * Parses (nested) option elements. * * @return mixed[] The options array. - * @psalm-return array|bool|string> + * @phpstan-return array|bool|string> */ private function parseOptions(SimpleXMLElement|null $options): array { @@ -703,7 +701,7 @@ private function parseOptions(SimpleXMLElement|null $options): array * @param SimpleXMLElement $joinColumnElement The XML element. * * @return mixed[] The mapping array. - * @psalm-return array{ + * @phpstan-return array{ * name: string, * referencedColumnName: string, * unique?: bool, @@ -747,7 +745,7 @@ private function joinColumnToArray(SimpleXMLElement $joinColumnElement): array * Parses the given field as array. * * @return mixed[] - * @psalm-return array{ + * @phpstan-return array{ * fieldName: string, * type?: string, * columnName?: string, @@ -833,7 +831,7 @@ private function columnToArray(SimpleXMLElement $fieldMapping): array * Parse / Normalize the cache configuration * * @return mixed[] - * @psalm-return array{usage: int|null, region?: string} + * @phpstan-return array{usage: int|null, region?: string} */ private function cacheToArray(SimpleXMLElement $cacheMapping): array { @@ -860,7 +858,7 @@ private function cacheToArray(SimpleXMLElement $cacheMapping): array * @param SimpleXMLElement $cascadeElement The cascade element. * * @return string[] The list of cascade options. - * @psalm-return list + * @phpstan-return list */ private function getCascadeMappings(SimpleXMLElement $cascadeElement): array { diff --git a/src/Mapping/EmbeddedClassMapping.php b/src/Mapping/EmbeddedClassMapping.php index 8fd02c9232c..85e2e6e94a0 100644 --- a/src/Mapping/EmbeddedClassMapping.php +++ b/src/Mapping/EmbeddedClassMapping.php @@ -48,7 +48,7 @@ public function __construct(public string $class) } /** - * @psalm-param array{ + * @phpstan-param array{ * class: class-string, * columnPrefix?: false|string|null, * declaredField?: string|null, diff --git a/src/Mapping/Entity.php b/src/Mapping/Entity.php index 0e27913fc58..6466aa065d0 100644 --- a/src/Mapping/Entity.php +++ b/src/Mapping/Entity.php @@ -11,7 +11,7 @@ #[Attribute(Attribute::TARGET_CLASS)] final class Entity implements MappingAttribute { - /** @psalm-param class-string>|null $repositoryClass */ + /** @phpstan-param class-string>|null $repositoryClass */ public function __construct( public readonly string|null $repositoryClass = null, public readonly bool $readOnly = false, diff --git a/src/Mapping/FieldMapping.php b/src/Mapping/FieldMapping.php index 4c09196fd8b..928497f776c 100644 --- a/src/Mapping/FieldMapping.php +++ b/src/Mapping/FieldMapping.php @@ -26,7 +26,7 @@ final class FieldMapping implements ArrayAccess public bool|null $notInsertable = null; public bool|null $notUpdatable = null; public string|null $columnDefinition = null; - /** @psalm-var ClassMetadata::GENERATED_*|null */ + /** @phpstan-var ClassMetadata::GENERATED_*|null */ public int|null $generated = null; /** @var class-string|null */ public string|null $enumType = null; @@ -85,7 +85,7 @@ public function __construct( /** * @param array $mappingArray - * @psalm-param array{ + * @phpstan-param array{ * type: string, * fieldName: string, * columnName: string, diff --git a/src/Mapping/GeneratedValue.php b/src/Mapping/GeneratedValue.php index aca5f4b14cb..385b2c0eb0a 100644 --- a/src/Mapping/GeneratedValue.php +++ b/src/Mapping/GeneratedValue.php @@ -9,7 +9,7 @@ #[Attribute(Attribute::TARGET_PROPERTY)] final class GeneratedValue implements MappingAttribute { - /** @psalm-param 'AUTO'|'SEQUENCE'|'IDENTITY'|'NONE'|'CUSTOM' $strategy */ + /** @phpstan-param 'AUTO'|'SEQUENCE'|'IDENTITY'|'NONE'|'CUSTOM' $strategy */ public function __construct( public readonly string $strategy = 'AUTO', ) { diff --git a/src/Mapping/InheritanceType.php b/src/Mapping/InheritanceType.php index c042ee79b6f..b33afd8608e 100644 --- a/src/Mapping/InheritanceType.php +++ b/src/Mapping/InheritanceType.php @@ -9,7 +9,7 @@ #[Attribute(Attribute::TARGET_CLASS)] final class InheritanceType implements MappingAttribute { - /** @psalm-param 'NONE'|'JOINED'|'SINGLE_TABLE' $value */ + /** @phpstan-param 'NONE'|'JOINED'|'SINGLE_TABLE' $value */ public function __construct( public readonly string $value, ) { diff --git a/src/Mapping/JoinColumnMapping.php b/src/Mapping/JoinColumnMapping.php index 172c25699c9..cb54b196a99 100644 --- a/src/Mapping/JoinColumnMapping.php +++ b/src/Mapping/JoinColumnMapping.php @@ -31,7 +31,7 @@ public function __construct( /** * @param array $mappingArray - * @psalm-param array{ + * @phpstan-param array{ * name: string, * referencedColumnName: string, * unique?: bool|null, diff --git a/src/Mapping/JoinTableMapping.php b/src/Mapping/JoinTableMapping.php index c8b49681e51..29d3a698b98 100644 --- a/src/Mapping/JoinTableMapping.php +++ b/src/Mapping/JoinTableMapping.php @@ -33,7 +33,7 @@ public function __construct(public string $name) /** * @param mixed[] $mappingArray - * @psalm-param array{ + * @phpstan-param array{ * name: string, * quoted?: bool|null, * joinColumns?: mixed[], diff --git a/src/Mapping/ManyToMany.php b/src/Mapping/ManyToMany.php index d90a762fa6d..60d2e761a7e 100644 --- a/src/Mapping/ManyToMany.php +++ b/src/Mapping/ManyToMany.php @@ -12,7 +12,7 @@ final class ManyToMany implements MappingAttribute /** * @param class-string $targetEntity * @param string[]|null $cascade - * @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch + * @phpstan-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch */ public function __construct( public readonly string $targetEntity, diff --git a/src/Mapping/ManyToManyOwningSideMapping.php b/src/Mapping/ManyToManyOwningSideMapping.php index b09d56c7e30..d8abaedaeef 100644 --- a/src/Mapping/ManyToManyOwningSideMapping.php +++ b/src/Mapping/ManyToManyOwningSideMapping.php @@ -37,7 +37,7 @@ public function toArray(): array /** * @param mixed[] $mappingArray - * @psalm-param array{ + * @phpstan-param array{ * fieldName: string, * sourceEntity: class-string, * targetEntity: class-string, diff --git a/src/Mapping/ManyToOne.php b/src/Mapping/ManyToOne.php index 8fccff3e45d..b02d9333ff3 100644 --- a/src/Mapping/ManyToOne.php +++ b/src/Mapping/ManyToOne.php @@ -12,7 +12,7 @@ final class ManyToOne implements MappingAttribute /** * @param class-string|null $targetEntity * @param string[]|null $cascade - * @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch + * @phpstan-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch */ public function __construct( public readonly string|null $targetEntity = null, diff --git a/src/Mapping/OneToMany.php b/src/Mapping/OneToMany.php index d71c4f93416..ac73e6e0947 100644 --- a/src/Mapping/OneToMany.php +++ b/src/Mapping/OneToMany.php @@ -12,7 +12,7 @@ final class OneToMany implements MappingAttribute /** * @param class-string|null $targetEntity * @param string[]|null $cascade - * @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch + * @phpstan-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch */ public function __construct( public readonly string|null $targetEntity = null, diff --git a/src/Mapping/OneToManyAssociationMapping.php b/src/Mapping/OneToManyAssociationMapping.php index 786e9812774..139c1d9ef05 100644 --- a/src/Mapping/OneToManyAssociationMapping.php +++ b/src/Mapping/OneToManyAssociationMapping.php @@ -8,7 +8,7 @@ final class OneToManyAssociationMapping extends ToManyInverseSideMapping { /** * @param mixed[] $mappingArray - * @psalm-param array{ + * @phpstan-param array{ * fieldName: string, * sourceEntity: class-string, * targetEntity: class-string, @@ -41,7 +41,7 @@ public static function fromMappingArray(array $mappingArray): static /** * @param mixed[] $mappingArray - * @psalm-param array{ + * @phpstan-param array{ * fieldName: string, * sourceEntity: class-string, * targetEntity: class-string, diff --git a/src/Mapping/OneToOne.php b/src/Mapping/OneToOne.php index 1ddf21c8fe6..80c2392acae 100644 --- a/src/Mapping/OneToOne.php +++ b/src/Mapping/OneToOne.php @@ -12,7 +12,7 @@ final class OneToOne implements MappingAttribute /** * @param class-string|null $targetEntity * @param array|null $cascade - * @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch + * @phpstan-param 'LAZY'|'EAGER'|'EXTRA_LAZY' $fetch */ public function __construct( public readonly string|null $targetEntity = null, diff --git a/src/Mapping/QuoteStrategy.php b/src/Mapping/QuoteStrategy.php index 9eb3e536355..7b78d12a81b 100644 --- a/src/Mapping/QuoteStrategy.php +++ b/src/Mapping/QuoteStrategy.php @@ -52,7 +52,7 @@ public function getReferencedJoinColumnName( /** * Gets the (possibly quoted) identifier column names for safe use in an SQL statement. * - * @psalm-return list + * @phpstan-return list */ public function getIdentifierColumnNames(ClassMetadata $class, AbstractPlatform $platform): array; diff --git a/src/Mapping/ReflectionEmbeddedProperty.php b/src/Mapping/ReflectionEmbeddedProperty.php index da3d09749b4..27aabadec25 100644 --- a/src/Mapping/ReflectionEmbeddedProperty.php +++ b/src/Mapping/ReflectionEmbeddedProperty.php @@ -23,7 +23,7 @@ final class ReflectionEmbeddedProperty extends ReflectionProperty /** * @param ReflectionProperty $parentProperty reflection property of the class where the embedded object has to be put * @param ReflectionProperty $childProperty reflection property of the embedded object - * @psalm-param class-string $embeddedClass + * @phpstan-param class-string $embeddedClass */ public function __construct( private readonly ReflectionProperty $parentProperty, diff --git a/src/Mapping/ToManyAssociationMapping.php b/src/Mapping/ToManyAssociationMapping.php index 2e4969c47c6..fb1fdf3fe86 100644 --- a/src/Mapping/ToManyAssociationMapping.php +++ b/src/Mapping/ToManyAssociationMapping.php @@ -6,7 +6,7 @@ interface ToManyAssociationMapping { - /** @psalm-assert-if-true string $this->indexBy() */ + /** @phpstan-assert-if-true string $this->indexBy() */ public function isIndexed(): bool; public function indexBy(): string; diff --git a/src/Mapping/ToManyAssociationMappingImplementation.php b/src/Mapping/ToManyAssociationMappingImplementation.php index 306880dd511..d2ad7595372 100644 --- a/src/Mapping/ToManyAssociationMappingImplementation.php +++ b/src/Mapping/ToManyAssociationMappingImplementation.php @@ -32,7 +32,7 @@ final public function orderBy(): array return $this->orderBy; } - /** @psalm-assert-if-true !null $this->indexBy */ + /** @phpstan-assert-if-true !null $this->indexBy */ final public function isIndexed(): bool { return $this->indexBy !== null; diff --git a/src/Mapping/ToOneInverseSideMapping.php b/src/Mapping/ToOneInverseSideMapping.php index 5be89e6db53..64a23019432 100644 --- a/src/Mapping/ToOneInverseSideMapping.php +++ b/src/Mapping/ToOneInverseSideMapping.php @@ -9,7 +9,7 @@ abstract class ToOneInverseSideMapping extends InverseSideMapping /** * @param mixed[] $mappingArray * @param class-string $name - * @psalm-param array{ + * @phpstan-param array{ * fieldName: string, * sourceEntity: class-string, * targetEntity: class-string, diff --git a/src/Mapping/ToOneOwningSideMapping.php b/src/Mapping/ToOneOwningSideMapping.php index cb85afbde10..ed3d596f801 100644 --- a/src/Mapping/ToOneOwningSideMapping.php +++ b/src/Mapping/ToOneOwningSideMapping.php @@ -27,7 +27,7 @@ abstract class ToOneOwningSideMapping extends OwningSideMapping implements ToOne /** * @param array $mappingArray - * @psalm-param array{ + * @phpstan-param array{ * fieldName: string, * sourceEntity: class-string, * targetEntity: class-string, @@ -74,7 +74,7 @@ public static function fromMappingArray(array $mappingArray): static /** * @param mixed[] $mappingArray * @param class-string $name - * @psalm-param array{ + * @phpstan-param array{ * fieldName: string, * sourceEntity: class-string, * targetEntity: class-string, diff --git a/src/PersistentCollection.php b/src/PersistentCollection.php index 876a92a261a..e83e246d7de 100644 --- a/src/PersistentCollection.php +++ b/src/PersistentCollection.php @@ -35,8 +35,8 @@ * Similarly, if you remove entities from a collection that is part of a one-many * mapping this will only result in the nulling out of the foreign keys on flush. * - * @psalm-template TKey of array-key - * @psalm-template T + * @phpstan-template TKey of array-key + * @phpstan-template T * @template-extends AbstractLazyCollection * @template-implements Selectable */ @@ -46,7 +46,7 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec * A snapshot of the collection at the moment it was fetched from the database. * This is used to create a diff of the collection at commit time. * - * @psalm-var array + * @phpstan-var array */ private array $snapshot = []; @@ -80,7 +80,7 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec * * @param EntityManagerInterface $em The EntityManager the collection will be associated with. * @param ClassMetadata $typeClass The class descriptor of the entity type of this collection. - * @psalm-param Collection&Selectable $collection The collection elements. + * @phpstan-param Collection&Selectable $collection The collection elements. */ public function __construct( private EntityManagerInterface|null $em, @@ -202,7 +202,7 @@ public function takeSnapshot(): void * INTERNAL: * Returns the last snapshot of the elements in the collection. * - * @psalm-return array The last snapshot of the elements. + * @phpstan-return array The last snapshot of the elements. */ public function getSnapshot(): array { @@ -492,7 +492,7 @@ public function clear(): void * with circular references. This solution seems simpler and works well. * * @return string[] - * @psalm-return array{0: string, 1: string} + * @phpstan-return array{0: string, 1: string} */ public function __sleep(): array { @@ -526,7 +526,7 @@ public function first() * selected slice and NOT change the elements contained in the collection slice is called on. * * @return mixed[] - * @psalm-return array + * @phpstan-return array */ public function slice(int $offset, int|null $length = null): array { @@ -568,7 +568,7 @@ public function __clone() * Selects all elements from a selectable that match the expression and * return a new collection containing these elements. * - * @psalm-return Collection + * @phpstan-return Collection * * @throws RuntimeException */ diff --git a/src/Persisters/Collection/ManyToManyPersister.php b/src/Persisters/Collection/ManyToManyPersister.php index 7cf993d5997..893e0644e61 100644 --- a/src/Persisters/Collection/ManyToManyPersister.php +++ b/src/Persisters/Collection/ManyToManyPersister.php @@ -292,7 +292,7 @@ public function loadCriteria(PersistentCollection $collection, Criteria $criteri * @return string[] ordered tuple: * - JOIN condition to add to the SQL * - WHERE condition to add to the SQL - * @psalm-return array{0: string, 1: string} + * @phpstan-return array{0: string, 1: string} */ public function getFilterSql(AssociationMapping $mapping): array { @@ -340,7 +340,7 @@ protected function generateFilterConditionSQL(ClassMetadata $targetEntity, strin * Generate ON condition * * @return string[] - * @psalm-return list + * @phpstan-return list */ protected function getOnConditionSQL(AssociationMapping $mapping): array { @@ -412,7 +412,7 @@ protected function getDeleteSQLParameters(PersistentCollection $collection): arr * * @return string[]|string[][] ordered tuple containing the SQL to be executed and an array * of types for bound parameters - * @psalm-return array{0: string, 1: list} + * @phpstan-return array{0: string, 1: list} */ protected function getDeleteRowSQL(PersistentCollection $collection): array { @@ -447,7 +447,7 @@ protected function getDeleteRowSQL(PersistentCollection $collection): array * Internal note: Order of the parameters must be the same as the order of the columns in getDeleteRowSql. * * @return mixed[] - * @psalm-return list + * @phpstan-return list */ protected function getDeleteRowSQLParameters(PersistentCollection $collection, object $element): array { @@ -459,7 +459,7 @@ protected function getDeleteRowSQLParameters(PersistentCollection $collection, o * * @return string[]|string[][] ordered tuple containing the SQL to be executed and an array * of types for bound parameters - * @psalm-return array{0: string, 1: list} + * @phpstan-return array{0: string, 1: list} */ protected function getInsertRowSQL(PersistentCollection $collection): array { @@ -496,7 +496,7 @@ protected function getInsertRowSQL(PersistentCollection $collection): array * Internal note: Order of the parameters must be the same as the order of the columns in getInsertRowSql. * * @return mixed[] - * @psalm-return list + * @phpstan-return list */ protected function getInsertRowSQLParameters(PersistentCollection $collection, object $element): array { @@ -508,7 +508,7 @@ protected function getInsertRowSQLParameters(PersistentCollection $collection, o * of the join table columns as specified in ManyToManyMapping#joinTableColumns. * * @return mixed[] - * @psalm-return list + * @phpstan-return list */ private function collectJoinTableColumnParameters( PersistentCollection $collection, @@ -557,7 +557,7 @@ private function collectJoinTableColumnParameters( * - where clauses to be added for filtering * - parameters to be bound for filtering * - types of the parameters to be bound for filtering - * @psalm-return array{0: string, 1: list, 2: list, 3: list} + * @phpstan-return array{0: string, 1: list, 2: list, 3: list} */ private function getJoinTableRestrictionsWithKey( PersistentCollection $collection, @@ -647,7 +647,7 @@ private function getJoinTableRestrictionsWithKey( * - where clauses to be added for filtering * - parameters to be bound for filtering * - types of the parameters to be bound for filtering - * @psalm-return array{0: string, 1: list, 2: list, 3: list} + * @phpstan-return array{0: string, 1: list, 2: list, 3: list} */ private function getJoinTableRestrictions( PersistentCollection $collection, diff --git a/src/Persisters/Entity/BasicEntityPersister.php b/src/Persisters/Entity/BasicEntityPersister.php index 843cc0b21f3..91b2eaa8832 100644 --- a/src/Persisters/Entity/BasicEntityPersister.php +++ b/src/Persisters/Entity/BasicEntityPersister.php @@ -128,7 +128,7 @@ class BasicEntityPersister implements EntityPersister /** * Queued inserts. * - * @psalm-var array + * @phpstan-var array */ protected array $queuedInserts = []; @@ -342,7 +342,7 @@ protected function fetchVersionAndNotUpsertableValues(ClassMetadata $versionedCl * @param mixed[] $id * * @return list - * @psalm-return list + * @phpstan-return list */ final protected function extractIdentifierTypes(array $id, ClassMetadata $versionedClass): array { @@ -586,7 +586,7 @@ public function delete(object $entity): bool * @param bool $isInsert Whether the data to be prepared refers to an insert statement. * * @return mixed[][] The prepared data. - * @psalm-return array> + * @phpstan-return array> */ protected function prepareUpdateData(object $entity, bool $isInsert = false): array { @@ -705,7 +705,7 @@ protected function prepareUpdateData(object $entity, bool $isInsert = false): ar * @param object $entity The entity for which to prepare the data. * * @return mixed[][] The prepared data for the tables to update. - * @psalm-return array + * @phpstan-return array */ protected function prepareInsertData(object $entity): array { @@ -1166,7 +1166,7 @@ public function getCountSQL(array|Criteria $criteria = []): string /** * Gets the ORDER BY SQL snippet for ordered collections. * - * @psalm-param array $orderBy + * @phpstan-param array $orderBy * * @throws InvalidOrientation * @throws InvalidFindByCall @@ -1448,7 +1448,7 @@ public function getInsertSQL(): string * Subclasses should override this method to alter or change the list of * columns placed in the INSERT statements used by the persister. * - * @psalm-return list + * @phpstan-return list */ protected function getInsertColumnList(): array { @@ -1563,7 +1563,7 @@ public function lock(array $criteria, LockMode|int $lockMode): void /** * Gets the FROM and optionally JOIN conditions to lock the entity managed by this persister. * - * @psalm-param LockMode::* $lockMode + * @phpstan-param LockMode::* $lockMode */ protected function getLockTablesSql(LockMode|int $lockMode): string { @@ -1665,7 +1665,7 @@ public function getSelectConditionStatementSQL( * Builds the left-hand-side of a where condition statement. * * @return string[] - * @psalm-return list + * @phpstan-return list * * @throws InvalidFindByCall * @throws UnrecognizedField @@ -1740,7 +1740,7 @@ private function getSelectConditionStatementColumnSQL( * Subclasses are supposed to override this method if they intend to change * or alter the criteria by which entities are selected. * - * @psalm-param array $criteria + * @phpstan-param array $criteria */ protected function getSelectConditionSQL(array $criteria, AssociationMapping|null $assoc = null): string { @@ -1864,7 +1864,7 @@ public function expandParameters(array $criteria): array * - class to which the field belongs to * * @return mixed[][] - * @psalm-return array{0: array, 1: list} + * @phpstan-return array{0: array, 1: list} */ private function expandToManyParameters(array $criteria): array { @@ -1887,7 +1887,7 @@ private function expandToManyParameters(array $criteria): array * Infers field types to be used by parameter type casting. * * @return list - * @psalm-return list + * @phpstan-return list * * @throws QueryException */ @@ -1929,7 +1929,7 @@ private function getTypes(string $field, mixed $value, ClassMetadata $class): ar return $types; } - /** @psalm-return ArrayParameterType::* */ + /** @phpstan-return ArrayParameterType::* */ private function getArrayBindingType(ParameterType|int|string $type): ArrayParameterType|int { if (! $type instanceof ParameterType) { @@ -1966,7 +1966,7 @@ private function getValues(mixed $value): array /** * Retrieves an individual parameter value. * - * @psalm-return list + * @phpstan-return list */ private function getIndividualValue(mixed $value): array { @@ -2097,7 +2097,7 @@ protected function switchPersisterContext(int|null $offset, int|null $limit): vo /** * @return string[] - * @psalm-return list + * @phpstan-return list */ protected function getClassIdentifiersTypes(ClassMetadata $class): array { diff --git a/src/Persisters/Entity/EntityPersister.php b/src/Persisters/Entity/EntityPersister.php index ad1c81147ce..1c4da2f4c04 100644 --- a/src/Persisters/Entity/EntityPersister.php +++ b/src/Persisters/Entity/EntityPersister.php @@ -47,8 +47,8 @@ public function getInsertSQL(): string; * * @param mixed[]|Criteria $criteria * @param mixed[]|null $orderBy - * @psalm-param AssociationMapping|null $assoc - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param AssociationMapping|null $assoc + * @phpstan-param LockMode::*|null $lockMode */ public function getSelectSQL( array|Criteria $criteria, @@ -71,14 +71,14 @@ public function getCountSQL(array|Criteria $criteria = []): string; * * @param string[] $criteria * - * @psalm-return array{list, list} + * @phpstan-return array{list, list} */ public function expandParameters(array $criteria): array; /** * Expands Criteria Parameters by walking the expressions and grabbing all parameters and types from it. * - * @psalm-return array{list, list} + * @phpstan-return array{list, list} */ public function expandCriteriaParameters(Criteria $criteria): array; @@ -126,7 +126,7 @@ public function delete(object $entity): bool; * * @param mixed[]|Criteria $criteria * - * @psalm-return 0|positive-int + * @phpstan-return 0|positive-int */ public function count(array|Criteria $criteria = []): int; @@ -153,10 +153,10 @@ public function getOwningTable(string $fieldName): string; * for loading the entity. * @param int|null $limit Limit number of results. * @param string[]|null $orderBy Criteria to order by. - * @psalm-param array $criteria - * @psalm-param array $hints - * @psalm-param LockMode::*|null $lockMode - * @psalm-param array|null $orderBy + * @phpstan-param array $criteria + * @phpstan-param array $hints + * @phpstan-param LockMode::*|null $lockMode + * @phpstan-param array|null $orderBy * * @return object|null The loaded and managed entity instance or NULL if the entity can not be found. * @@ -176,7 +176,7 @@ public function load( * Loads an entity by identifier. * * @param object|null $entity The entity to load the data into. If not specified, a new entity is created. - * @psalm-param array $identifier The entity identifier. + * @phpstan-param array $identifier The entity identifier. * * @return object|null The loaded and managed entity instance or NULL if the entity can not be found. * @@ -190,7 +190,7 @@ public function loadById(array $identifier, object|null $entity = null): object| * * @param AssociationMapping $assoc The association to load. * @param object $sourceEntity The entity that owns the association (not necessarily the "owning side"). - * @psalm-param array $identifier The identifier of the entity to load. Must be provided if + * @phpstan-param array $identifier The identifier of the entity to load. Must be provided if * the association to load represents the owning side, otherwise * the identifier is derived from the $sourceEntity. * @@ -206,10 +206,10 @@ public function loadOneToOneEntity(AssociationMapping $assoc, object $sourceEnti * @param LockMode|int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants * or NULL if no specific lock mode should be used * for refreshing the managed entity. - * @psalm-param array $id The identifier of the entity as an + * @phpstan-param array $id The identifier of the entity as an * associative array from column or * field names to values. - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param LockMode::*|null $lockMode */ public function refresh(array $id, object $entity, LockMode|int|null $lockMode = null): void; @@ -223,8 +223,8 @@ public function loadCriteria(Criteria $criteria): array; /** * Loads a list of entities by a list of field criteria. * - * @psalm-param array|null $orderBy - * @psalm-param array $criteria + * @phpstan-param array|null $orderBy + * @phpstan-param array $criteria * * @return mixed[] */ @@ -276,8 +276,8 @@ public function loadOneToManyCollection( /** * Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode. * - * @psalm-param array $criteria - * @psalm-param LockMode::* $lockMode + * @phpstan-param array $criteria + * @phpstan-param LockMode::* $lockMode */ public function lock(array $criteria, LockMode|int $lockMode): void; diff --git a/src/Persisters/Entity/JoinedSubclassPersister.php b/src/Persisters/Entity/JoinedSubclassPersister.php index 76719a2c275..67c277be811 100644 --- a/src/Persisters/Entity/JoinedSubclassPersister.php +++ b/src/Persisters/Entity/JoinedSubclassPersister.php @@ -35,14 +35,14 @@ class JoinedSubclassPersister extends AbstractEntityInheritancePersister * Map that maps column names to the table names that own them. * This is mainly a temporary cache, used during a single request. * - * @psalm-var array + * @phpstan-var array */ private array $owningTableMap = []; /** * Map of table to quoted table names. * - * @psalm-var array + * @phpstan-var array */ private array $quotedTableMap = []; diff --git a/src/Persisters/SqlValueVisitor.php b/src/Persisters/SqlValueVisitor.php index 7f987ad9815..b346ec94472 100644 --- a/src/Persisters/SqlValueVisitor.php +++ b/src/Persisters/SqlValueVisitor.php @@ -63,7 +63,7 @@ public function walkValue(Value $value) * Returns the Parameters and Types necessary for matching the last visited expression. * * @return mixed[][] - * @psalm-return array{0: array, 1: array>} + * @phpstan-return array{0: array, 1: array>} */ public function getParamsAndTypes(): array { diff --git a/src/Proxy/Autoloader.php b/src/Proxy/Autoloader.php index 1013e735d32..a16d6fb3600 100644 --- a/src/Proxy/Autoloader.php +++ b/src/Proxy/Autoloader.php @@ -28,7 +28,7 @@ final class Autoloader * 2. Remove namespace separators from remaining class name. * 3. Return PHP filename from proxy-dir with the result from 2. * - * @psalm-param class-string $className + * @phpstan-param class-string $className * * @throws NotAProxyClass */ diff --git a/src/Query.php b/src/Query.php index b97d4d93667..72262398217 100644 --- a/src/Query.php +++ b/src/Query.php @@ -347,7 +347,7 @@ private function evictEntityCacheRegion(): void * @param array> $paramMappings * * @return mixed[][] - * @psalm-return array{0: list, 1: array} + * @phpstan-return array{0: list, 1: array} * * @throws Query\QueryException */ @@ -398,7 +398,7 @@ private function processParameterMappings(array $paramMappings): array /** * @return mixed[] tuple of (value, type) - * @psalm-return array{0: mixed, 1: mixed} + * @phpstan-return array{0: mixed, 1: mixed} */ private function resolveParameterValue(Parameter $parameter): array { @@ -531,7 +531,7 @@ public function getDQL(): string|null * @see AbstractQuery::STATE_DIRTY * * @return int The query state. - * @psalm-return self::STATE_* The query state. + * @phpstan-return self::STATE_* The query state. */ public function getState(): int { diff --git a/src/Query/AST/Functions/FunctionNode.php b/src/Query/AST/Functions/FunctionNode.php index 4cc549e7cd4..e49ddba6b3b 100644 --- a/src/Query/AST/Functions/FunctionNode.php +++ b/src/Query/AST/Functions/FunctionNode.php @@ -13,7 +13,7 @@ * * @link www.doctrine-project.org * - * @psalm-consistent-constructor + * @phpstan-consistent-constructor */ abstract class FunctionNode extends Node { diff --git a/src/Query/AST/Phase2OptimizableConditional.php b/src/Query/AST/Phase2OptimizableConditional.php index 276f8f8d945..d838f123784 100644 --- a/src/Query/AST/Phase2OptimizableConditional.php +++ b/src/Query/AST/Phase2OptimizableConditional.php @@ -9,8 +9,6 @@ * 2 optimization. * * @internal - * - * @psalm-inheritors ConditionalPrimary|ConditionalFactor|ConditionalTerm */ interface Phase2OptimizableConditional { diff --git a/src/Query/Exec/SingleSelectSqlFinalizer.php b/src/Query/Exec/SingleSelectSqlFinalizer.php index ac31c0cde36..bbaab2b6360 100644 --- a/src/Query/Exec/SingleSelectSqlFinalizer.php +++ b/src/Query/Exec/SingleSelectSqlFinalizer.php @@ -28,8 +28,6 @@ public function __construct(private string $sql) * This method exists temporarily to support old SqlWalker interfaces. * * @internal - * - * @psalm-internal Doctrine\ORM */ public function finalizeSql(Query $query): string { diff --git a/src/Query/Expr/Base.php b/src/Query/Expr/Base.php index e0f257277df..7dc579679a4 100644 --- a/src/Query/Expr/Base.php +++ b/src/Query/Expr/Base.php @@ -44,7 +44,7 @@ public function __construct(mixed $args = []) /** * @param string[]|object[]|string|object $args - * @psalm-param list|string|object $args + * @phpstan-param list|string|object $args * * @return $this */ diff --git a/src/Query/Filter/SQLFilter.php b/src/Query/Filter/SQLFilter.php index 29f37756eb3..d5a7998631d 100644 --- a/src/Query/Filter/SQLFilter.php +++ b/src/Query/Filter/SQLFilter.php @@ -29,7 +29,7 @@ abstract class SQLFilter implements Stringable /** * Parameters for the filter. * - * @psalm-var array + * @phpstan-var array */ private array $parameters = []; diff --git a/src/Query/FilterCollection.php b/src/Query/FilterCollection.php index 3d3c576d7c5..8971a79c90d 100644 --- a/src/Query/FilterCollection.php +++ b/src/Query/FilterCollection.php @@ -45,7 +45,7 @@ class FilterCollection * Instances of suspended filters. * * @var SQLFilter[] - * @psalm-var array + * @phpstan-var array */ private array $suspendedFilters = []; @@ -76,7 +76,7 @@ public function getEnabledFilters(): array * Gets all the suspended filters. * * @return SQLFilter[] The suspended filters. - * @psalm-return array + * @phpstan-return array */ public function getSuspendedFilters(): array { diff --git a/src/Query/Parser.php b/src/Query/Parser.php index bcfad85c422..51b7bc5e984 100644 --- a/src/Query/Parser.php +++ b/src/Query/Parser.php @@ -139,7 +139,7 @@ final class Parser /** * Map of declared query components in the parsed query. * - * @psalm-var array + * @phpstan-var array */ private array $queryComponents = []; @@ -504,7 +504,7 @@ private function peekBeyondClosingParenthesis(bool $resetPeek = true): Token|nul /** * Checks if the given token indicates a mathematical operator. * - * @psalm-param DqlToken|null $token + * @phpstan-param DqlToken|null $token */ private function isMathOperator(Token|null $token): bool { @@ -3361,9 +3361,12 @@ public function CustomFunctionsReturningNumerics(): AST\Functions\FunctionNode assert($functionClass !== null); - $function = is_string($functionClass) - ? new $functionClass($functionName) - : $functionClass($functionName); + if (is_string($functionClass)) { + $function = new $functionClass($functionName); + assert($function instanceof AST\Functions\FunctionNode); + } else { + $function = $functionClass($functionName); + } $function->parse($this); diff --git a/src/Query/ParserResult.php b/src/Query/ParserResult.php index 7539e999ac3..34225e046e4 100644 --- a/src/Query/ParserResult.php +++ b/src/Query/ParserResult.php @@ -37,7 +37,7 @@ class ParserResult /** * The mappings of DQL parameter names/positions to SQL parameter positions. * - * @psalm-var array> + * @phpstan-var array> */ private array $parameterMappings = []; @@ -125,7 +125,7 @@ public function addParameterMapping(string|int $dqlPosition, int $sqlPosition): /** * Gets all DQL to SQL parameter mappings. * - * @psalm-return array> The parameter mappings. + * @phpstan-return array> The parameter mappings. */ public function getParameterMappings(): array { @@ -138,7 +138,7 @@ public function getParameterMappings(): array * @param string|int $dqlPosition The name or position of the DQL parameter. * * @return int[] The positions of the corresponding SQL parameters. - * @psalm-return list + * @phpstan-return list */ public function getSqlParameterPositions(string|int $dqlPosition): array { diff --git a/src/Query/ResultSetMapping.php b/src/Query/ResultSetMapping.php index 920461b53d4..abb158afe4a 100644 --- a/src/Query/ResultSetMapping.php +++ b/src/Query/ResultSetMapping.php @@ -46,7 +46,7 @@ class ResultSetMapping * Maps alias names to related association field names. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $relationMap = []; @@ -54,7 +54,7 @@ class ResultSetMapping * Maps alias names to parent alias names. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $parentAliasMap = []; @@ -62,7 +62,7 @@ class ResultSetMapping * Maps column names in the result set to field names for each class. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $fieldMappings = []; @@ -70,7 +70,7 @@ class ResultSetMapping * Maps column names in the result set to the alias/field name to use in the mapped result. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $scalarMappings = []; @@ -78,7 +78,7 @@ class ResultSetMapping * Maps scalar columns to enums * * @ignore - * @psalm-var array + * @phpstan-var array */ public $enumMappings = []; @@ -86,7 +86,7 @@ class ResultSetMapping * Maps column names in the result set to the alias/field type to use in the mapped result. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $typeMappings = []; @@ -94,7 +94,7 @@ class ResultSetMapping * Maps entities in the result set to the alias name to use in the mapped result. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $entityMappings = []; @@ -102,7 +102,7 @@ class ResultSetMapping * Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $metaMappings = []; @@ -110,7 +110,7 @@ class ResultSetMapping * Maps column names in the result set to the alias they belong to. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $columnOwnerMap = []; @@ -118,7 +118,7 @@ class ResultSetMapping * List of columns in the result set that are used as discriminator columns. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $discriminatorColumns = []; @@ -126,7 +126,7 @@ class ResultSetMapping * Maps alias names to field names that should be used for indexing. * * @ignore - * @psalm-var array + * @phpstan-var array */ public array $indexByMap = []; @@ -141,14 +141,14 @@ class ResultSetMapping /** * This is necessary to hydrate derivate foreign keys correctly. * - * @psalm-var array> + * @phpstan-var array> */ public array $isIdentifierColumn = []; /** * Maps column names in the result set to field names for each new object expression. * - * @psalm-var array> + * @phpstan-var array> */ public array $newObjectMappings = []; @@ -162,14 +162,14 @@ class ResultSetMapping /** * Maps metadata parameter names to the metadata attribute. * - * @psalm-var array + * @phpstan-var array */ public array $metadataParameterMapping = []; /** * Contains query parameter names to be resolved as discriminator values * - * @psalm-var array + * @phpstan-var array */ public array $discriminatorParameters = []; diff --git a/src/Query/ResultSetMappingBuilder.php b/src/Query/ResultSetMappingBuilder.php index f74763c138a..b88b4e44c9a 100644 --- a/src/Query/ResultSetMappingBuilder.php +++ b/src/Query/ResultSetMappingBuilder.php @@ -104,7 +104,7 @@ public function addJoinedEntityFromClassMetadata( * Adds all fields of the given class to the result set mapping (columns and meta fields). * * @param string[] $columnAliasMap - * @psalm-param array $columnAliasMap + * @phpstan-param array $columnAliasMap * * @throws InvalidArgumentException */ @@ -174,9 +174,9 @@ private function isInheritanceSupported(ClassMetadata $classMetadata): bool /** * Gets column alias for a given column. * - * @psalm-param array $customRenameColumns + * @phpstan-param array $customRenameColumns * - * @psalm-assert self::COLUMN_RENAMING_* $mode + * @phpstan-assert self::COLUMN_RENAMING_* $mode */ private function getColumnAlias(string $columnName, int $mode, array $customRenameColumns): string { @@ -194,8 +194,8 @@ private function getColumnAlias(string $columnName, int $mode, array $customRena * This depends on the renaming mode selected by the user. * * @param class-string $className - * @psalm-param self::COLUMN_RENAMING_* $mode - * @psalm-param array $customRenameColumns + * @phpstan-param self::COLUMN_RENAMING_* $mode + * @phpstan-param array $customRenameColumns * * @return string[] */ diff --git a/src/Query/SqlWalker.php b/src/Query/SqlWalker.php index 8164ae13bb8..7cb510c7452 100644 --- a/src/Query/SqlWalker.php +++ b/src/Query/SqlWalker.php @@ -45,8 +45,8 @@ /** * The SqlWalker walks over a DQL AST and constructs the corresponding SQL. * - * @psalm-import-type QueryComponent from Parser - * @psalm-consistent-constructor + * @phpstan-import-type QueryComponent from Parser + * @phpstan-consistent-constructor */ class SqlWalker { @@ -100,7 +100,7 @@ class SqlWalker /** * Map from result variable names to their SQL column alias names. * - * @psalm-var array> + * @phpstan-var array> */ private array $scalarResultAliasMap = []; @@ -121,14 +121,14 @@ class SqlWalker /** * A list of classes that appear in non-scalar SelectExpressions. * - * @psalm-var array + * @phpstan-var array */ private array $selectedClasses = []; /** * The DQL alias of the root class of the currently traversed query. * - * @psalm-var list + * @phpstan-var list */ private array $rootAliases = []; @@ -191,7 +191,7 @@ public function getEntityManager(): EntityManagerInterface * @param string $dqlAlias The DQL alias. * * @return mixed[] - * @psalm-return QueryComponent + * @phpstan-return QueryComponent */ public function getQueryComponent(string $dqlAlias): array { @@ -246,7 +246,6 @@ public function getExecutor(AST\SelectStatement|AST\UpdateStatement|AST\DeleteSt }; } - /** @psalm-internal Doctrine\ORM */ protected function createUpdateStatementExecutor(AST\UpdateStatement $AST): Exec\AbstractSqlExecutor { $primaryClass = $this->em->getClassMetadata($AST->updateClause->abstractSchemaName); @@ -256,7 +255,6 @@ protected function createUpdateStatementExecutor(AST\UpdateStatement $AST): Exec : new Exec\SingleTableDeleteUpdateExecutor($AST, $this); } - /** @psalm-internal Doctrine\ORM */ protected function createDeleteStatementExecutor(AST\DeleteStatement $AST): Exec\AbstractSqlExecutor { $primaryClass = $this->em->getClassMetadata($AST->deleteClause->abstractSchemaName); @@ -398,7 +396,7 @@ private function generateOrderedCollectionOrderByItems(): string /** * Generates a discriminator column SQL condition for the class with the given DQL alias. * - * @psalm-param list $dqlAliases List of root DQL aliases to inspect for discriminator restrictions. + * @phpstan-param list $dqlAliases List of root DQL aliases to inspect for discriminator restrictions. */ private function generateDiscriminatorColumnConditionSQL(array $dqlAliases): string { diff --git a/src/Query/TreeWalker.php b/src/Query/TreeWalker.php index 6c215773d4f..6d0afa46c32 100644 --- a/src/Query/TreeWalker.php +++ b/src/Query/TreeWalker.php @@ -9,7 +9,7 @@ /** * Interface for walkers of DQL ASTs (abstract syntax trees). * - * @psalm-import-type QueryComponent from Parser + * @phpstan-import-type QueryComponent from Parser */ interface TreeWalker { diff --git a/src/Query/TreeWalkerAdapter.php b/src/Query/TreeWalkerAdapter.php index a7948db5c69..14b367f1099 100644 --- a/src/Query/TreeWalkerAdapter.php +++ b/src/Query/TreeWalkerAdapter.php @@ -16,7 +16,7 @@ * An adapter implementation of the TreeWalker interface. The methods in this class * are empty. This class exists as convenience for creating tree walkers. * - * @psalm-import-type QueryComponent from Parser + * @phpstan-import-type QueryComponent from Parser */ abstract class TreeWalkerAdapter implements TreeWalker { diff --git a/src/Query/TreeWalkerChain.php b/src/Query/TreeWalkerChain.php index 7b40ea17788..8e27ea70fa1 100644 --- a/src/Query/TreeWalkerChain.php +++ b/src/Query/TreeWalkerChain.php @@ -12,7 +12,7 @@ * Only the last walker in the chain can emit output. Any previous walkers can modify * the AST to influence the final output produced by the last walker. * - * @psalm-import-type QueryComponent from Parser + * @phpstan-import-type QueryComponent from Parser */ class TreeWalkerChain implements TreeWalker { diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index 3bb60a2bcca..9ce4b196158 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -46,7 +46,7 @@ class QueryBuilder implements Stringable /** * The array of DQL parts collected. * - * @psalm-var array + * @phpstan-var array */ private array $dqlParts = [ 'distinct' => false, @@ -87,7 +87,7 @@ class QueryBuilder implements Stringable /** * Keeps root entity alias names for join entities. * - * @psalm-var array + * @phpstan-var array */ private array $joinRootAliases = []; @@ -350,7 +350,7 @@ public function getRootAlias(): string * * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function getRootAliases(): array { @@ -387,7 +387,7 @@ public function getRootAliases(): array * * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function getAllAliases(): array { @@ -1237,7 +1237,7 @@ public function getDQLPart(string $queryPartName): mixed /** * Gets all query parts. * - * @psalm-return array $dqlParts + * @phpstan-return array $dqlParts */ public function getDQLParts(): array { @@ -1297,7 +1297,7 @@ private function getDQLForSelect(): string return $dql; } - /** @psalm-param array $options */ + /** @phpstan-param array $options */ private function getReducedDQLQueryPart(string $queryPartName, array $options = []): string { $queryPart = $this->getDQLPart($queryPartName); @@ -1315,7 +1315,7 @@ private function getReducedDQLQueryPart(string $queryPartName, array $options = * Resets DQL parts. * * @param string[]|null $parts - * @psalm-param list|null $parts + * @phpstan-param list|null $parts * * @return $this */ diff --git a/src/Tools/Console/Command/MappingDescribeCommand.php b/src/Tools/Console/Command/MappingDescribeCommand.php index 26b9b4f382b..a0c69535346 100644 --- a/src/Tools/Console/Command/MappingDescribeCommand.php +++ b/src/Tools/Console/Command/MappingDescribeCommand.php @@ -229,7 +229,7 @@ private function formatValue(mixed $value): string * @param mixed $value A Value to show * * @return string[] - * @psalm-return array{0: string, 1: string} + * @phpstan-return array{0: string, 1: string} */ private function formatField(string $label, mixed $value): array { @@ -243,10 +243,10 @@ private function formatField(string $label, mixed $value): array /** * Format the association mappings * - * @psalm-param array $propertyMappings + * @phpstan-param array $propertyMappings * * @return string[][] - * @psalm-return list + * @phpstan-return list */ private function formatMappings(array $propertyMappings): array { @@ -266,10 +266,10 @@ private function formatMappings(array $propertyMappings): array /** * Format the entity listeners * - * @psalm-param list $entityListeners + * @phpstan-param list $entityListeners * * @return string[] - * @psalm-return array{0: string, 1: string} + * @phpstan-return array{0: string, 1: string} */ private function formatEntityListeners(array $entityListeners): array { diff --git a/src/Tools/Console/EntityManagerProvider/UnknownManagerException.php b/src/Tools/Console/EntityManagerProvider/UnknownManagerException.php index 583d90908a9..46e842ce976 100644 --- a/src/Tools/Console/EntityManagerProvider/UnknownManagerException.php +++ b/src/Tools/Console/EntityManagerProvider/UnknownManagerException.php @@ -11,7 +11,7 @@ final class UnknownManagerException extends OutOfBoundsException { - /** @psalm-param list $knownManagers */ + /** @phpstan-param list $knownManagers */ public static function unknownManager(string $unknownManager, array $knownManagers = []): self { return new self(sprintf( diff --git a/src/Tools/Pagination/CountOutputWalker.php b/src/Tools/Pagination/CountOutputWalker.php index 35f7d051ecf..b42123907f4 100644 --- a/src/Tools/Pagination/CountOutputWalker.php +++ b/src/Tools/Pagination/CountOutputWalker.php @@ -35,7 +35,7 @@ * are able to cache subqueries. By keeping the ORDER BY clause intact, the limitSubQuery * that will most likely be executed next can be read from the native SQL cache. * - * @psalm-import-type QueryComponent from Parser + * @phpstan-import-type QueryComponent from Parser */ class CountOutputWalker extends SqlOutputWalker { diff --git a/src/Tools/Pagination/LimitSubqueryOutputWalker.php b/src/Tools/Pagination/LimitSubqueryOutputWalker.php index 5cb65e7a993..b57b2e29408 100644 --- a/src/Tools/Pagination/LimitSubqueryOutputWalker.php +++ b/src/Tools/Pagination/LimitSubqueryOutputWalker.php @@ -52,7 +52,7 @@ * Works with composite keys but cannot deal with queries that have multiple * root entities (e.g. `SELECT f, b from Foo, Bar`) * - * @psalm-import-type QueryComponent from Parser + * @phpstan-import-type QueryComponent from Parser */ class LimitSubqueryOutputWalker extends SqlOutputWalker { @@ -406,7 +406,7 @@ private function recreateInnerSql( /** * @return string[][] - * @psalm-return array{0: list, 1: list} + * @phpstan-return array{0: list, 1: list} */ private function generateSqlAliasReplacements(): array { diff --git a/src/Tools/SchemaTool.php b/src/Tools/SchemaTool.php index e0a24d9459d..e022c846172 100644 --- a/src/Tools/SchemaTool.php +++ b/src/Tools/SchemaTool.php @@ -67,7 +67,7 @@ public function __construct(private readonly EntityManagerInterface $em) /** * Creates the database schema for the given array of ClassMetadata instances. * - * @psalm-param list $classes + * @phpstan-param list $classes * * @throws ToolsException */ @@ -89,7 +89,7 @@ public function createSchema(array $classes): void * Gets the list of DDL statements that are required to create the database schema for * the given list of ClassMetadata instances. * - * @psalm-param list $classes + * @phpstan-param list $classes * * @return list The SQL statements needed to create the schema for the classes. */ @@ -103,7 +103,7 @@ public function getCreateSchemaSql(array $classes): array /** * Detects instances of ClassMetadata that don't need to be processed in the SchemaTool context. * - * @psalm-param array $processedClasses + * @phpstan-param array $processedClasses */ private function processingNotRequired( ClassMetadata $class, @@ -164,7 +164,7 @@ private function getIndexColumns(ClassMetadata $class, array $indexData): array /** * Creates a Schema instance from a given set of metadata classes. * - * @psalm-param list $classes + * @phpstan-param list $classes * * @throws NotSupported */ @@ -434,7 +434,7 @@ private function gatherColumns(ClassMetadata $class, Table $table): void * Creates a column definition as required by the DBAL from an ORM field mapping definition. * * @param ClassMetadata $class The class that owns the field mapping. - * @psalm-param FieldMapping $mapping The field mapping. + * @phpstan-param FieldMapping $mapping The field mapping. */ private function gatherColumn( ClassMetadata $class, @@ -502,11 +502,11 @@ private function gatherColumn( * Gathers the SQL for properly setting up the relations of the given class. * This includes the SQL for foreign key constraints and join tables. * - * @psalm-param array * }> $addedFks - * @psalm-param array $blacklistedFks + * @phpstan-param array $blacklistedFks * * @throws NotSupported */ @@ -586,7 +586,7 @@ private function gatherRelationsSql( * * TODO: Is there any way to make this code more pleasing? * - * @psalm-return array{ClassMetadata, string}|null + * @phpstan-return array{ClassMetadata, string}|null */ private function getDefiningClass(ClassMetadata $class, string $referencedColumnName): array|null { @@ -623,7 +623,7 @@ private function getDefiningClass(ClassMetadata $class, string $referencedColumn * foreignTableName: string, * foreignColumns: list * }> $addedFks - * @psalm-param array $blacklistedFks + * @phpstan-param array $blacklistedFks * * @throws MissingColumnException */ @@ -819,7 +819,7 @@ public function getDropDatabaseSQL(): array /** * Gets SQL to drop the tables defined by the passed classes. * - * @psalm-param list $classes + * @phpstan-param list $classes * * @return list */ diff --git a/src/Tools/SchemaValidator.php b/src/Tools/SchemaValidator.php index fdfc00390c8..f602f69b4d4 100644 --- a/src/Tools/SchemaValidator.php +++ b/src/Tools/SchemaValidator.php @@ -82,7 +82,7 @@ public function __construct( * 2. Check if "mappedBy" and "inversedBy" are consistent to each other. * 3. Check if "referencedColumnName" attributes are really pointing to primary key columns. * - * @psalm-return array> + * @phpstan-return array> */ public function validateMapping(): array { @@ -104,7 +104,7 @@ public function validateMapping(): array * Validates a single class of the current. * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function validateClass(ClassMetadata $class): array { diff --git a/src/UnitOfWork.php b/src/UnitOfWork.php index 81a4c05c9f0..99fa107fc5b 100644 --- a/src/UnitOfWork.php +++ b/src/UnitOfWork.php @@ -139,7 +139,7 @@ class UnitOfWork implements PropertyChangedListener * A value will only really be copied if the value in the entity is modified * by the user. * - * @psalm-var array> + * @phpstan-var array> */ private array $originalEntityData = []; @@ -147,7 +147,7 @@ class UnitOfWork implements PropertyChangedListener * Map of entity changes. Keys are object ids (spl_object_id). * Filled at the beginning of a commit of the UnitOfWork and cleaned at the end. * - * @psalm-var array> + * @phpstan-var array> */ private array $entityChangeSets = []; @@ -155,7 +155,7 @@ class UnitOfWork implements PropertyChangedListener * The (cached) states of any known entities. * Keys are object ids (spl_object_id). * - * @psalm-var array + * @phpstan-var array */ private array $entityStates = []; @@ -171,28 +171,28 @@ class UnitOfWork implements PropertyChangedListener /** * A list of all pending entity insertions. * - * @psalm-var array + * @phpstan-var array */ private array $entityInsertions = []; /** * A list of all pending entity updates. * - * @psalm-var array + * @phpstan-var array */ private array $entityUpdates = []; /** * Any pending extra updates that have been scheduled by persisters. * - * @psalm-var array}> + * @phpstan-var array}> */ private array $extraUpdates = []; /** * A list of all pending entity deletions. * - * @psalm-var array + * @phpstan-var array */ private array $entityDeletions = []; @@ -212,14 +212,14 @@ class UnitOfWork implements PropertyChangedListener /** * All pending collection deletions. * - * @psalm-var array> + * @phpstan-var array> */ private array $collectionDeletions = []; /** * All pending collection updates. * - * @psalm-var array> + * @phpstan-var array> */ private array $collectionUpdates = []; @@ -228,7 +228,7 @@ class UnitOfWork implements PropertyChangedListener * At the end of the UnitOfWork all these collections will make new snapshots * of their data. * - * @psalm-var array> + * @phpstan-var array> */ private array $visitedCollections = []; @@ -239,21 +239,21 @@ class UnitOfWork implements PropertyChangedListener * Indexed by Collection object ID, which also serves as the key in self::$visitedCollections; * values are the key names that need to be removed. * - * @psalm-var array> + * @phpstan-var array> */ private array $pendingCollectionElementRemovals = []; /** * The entity persister instances used to persist entity instances. * - * @psalm-var array + * @phpstan-var array */ private array $persisters = []; /** * The collection persister instances used to persist collections. * - * @psalm-var array + * @phpstan-var array */ private array $collectionPersisters = []; @@ -275,7 +275,7 @@ class UnitOfWork implements PropertyChangedListener /** * Orphaned entities that are scheduled for removal. * - * @psalm-var array + * @phpstan-var array */ private array $orphanRemovals = []; @@ -517,7 +517,7 @@ private function executeExtraUpdates(): void * Gets the changeset for an entity. * * @return mixed[][] - * @psalm-return array + * @phpstan-return array */ public function & getEntityChangeSet(object $entity): array { @@ -558,8 +558,8 @@ public function & getEntityChangeSet(object $entity): array * * @param ClassMetadata $class The class descriptor of the entity. * @param object $entity The entity for which to compute the changes. - * @psalm-param ClassMetadata $class - * @psalm-param T $entity + * @phpstan-param ClassMetadata $class + * @phpstan-param T $entity * * @template T of object * @@ -958,8 +958,8 @@ private function hasMissingIdsWhichAreForeignKeys(ClassMetadata $class, array $i * * @param ClassMetadata $class The class descriptor of the entity. * @param object $entity The entity for which to (re)calculate the change set. - * @psalm-param ClassMetadata $class - * @psalm-param T $entity + * @phpstan-param ClassMetadata $class + * @phpstan-param T $entity * * @throws ORMInvalidArgumentException If the passed entity is not MANAGED. * @@ -1599,7 +1599,7 @@ public function getIdHashByEntity(object $entity): string * This parameter can be set to improve performance of entity state detection * by potentially avoiding a database lookup if the distinction between NEW and DETACHED * is either known or does not matter for the caller of the method. - * @psalm-param self::STATE_*|null $assume + * @phpstan-param self::STATE_*|null $assume * * @psalm-return self::STATE_* */ @@ -2973,7 +2973,7 @@ public function propertyChanged(object $sender, string $propertyName, mixed $old /** * Gets the currently scheduled entity insertions in this UnitOfWork. * - * @psalm-return array + * @phpstan-return array */ public function getScheduledEntityInsertions(): array { @@ -2983,7 +2983,7 @@ public function getScheduledEntityInsertions(): array /** * Gets the currently scheduled entity updates in this UnitOfWork. * - * @psalm-return array + * @phpstan-return array */ public function getScheduledEntityUpdates(): array { @@ -2993,7 +2993,7 @@ public function getScheduledEntityUpdates(): array /** * Gets the currently scheduled entity deletions in this UnitOfWork. * - * @psalm-return array + * @phpstan-return array */ public function getScheduledEntityDeletions(): array { @@ -3003,7 +3003,7 @@ public function getScheduledEntityDeletions(): array /** * Gets the currently scheduled complete collection deletions * - * @psalm-return array> + * @phpstan-return array> */ public function getScheduledCollectionDeletions(): array { @@ -3013,7 +3013,7 @@ public function getScheduledCollectionDeletions(): array /** * Gets the currently scheduled collection inserts, updates and deletes. * - * @psalm-return array> + * @phpstan-return array> */ public function getScheduledCollectionUpdates(): array { diff --git a/src/Utility/HierarchyDiscriminatorResolver.php b/src/Utility/HierarchyDiscriminatorResolver.php index b682125d02e..0949f7b12b8 100644 --- a/src/Utility/HierarchyDiscriminatorResolver.php +++ b/src/Utility/HierarchyDiscriminatorResolver.php @@ -19,7 +19,7 @@ private function __construct() * it extracts all the discriminators from the child classes and returns them * * @return null[] - * @psalm-return array + * @phpstan-return array */ public static function resolveDiscriminatorsForClass( ClassMetadata $rootClassMetadata, diff --git a/src/Utility/IdentifierFlattener.php b/src/Utility/IdentifierFlattener.php index 3792d334bba..2f16e56e4ac 100644 --- a/src/Utility/IdentifierFlattener.php +++ b/src/Utility/IdentifierFlattener.php @@ -40,7 +40,7 @@ public function __construct( * @param mixed[] $id * * @return mixed[] - * @psalm-return array + * @phpstan-return array */ public function flattenIdentifier(ClassMetadata $class, array $id): array { diff --git a/tests/Tests/Models/CMS/CmsAddressListener.php b/tests/Tests/Models/CMS/CmsAddressListener.php index ce50a28cd03..e06019e541f 100644 --- a/tests/Tests/Models/CMS/CmsAddressListener.php +++ b/tests/Tests/Models/CMS/CmsAddressListener.php @@ -10,7 +10,7 @@ class CmsAddressListener { - /** @psalm-var array>> */ + /** @phpstan-var array>> */ public $calls; public function prePersist(): void diff --git a/tests/Tests/Models/CMS/CmsGroup.php b/tests/Tests/Models/CMS/CmsGroup.php index d419b46ba41..89febf8fa2c 100644 --- a/tests/Tests/Models/CMS/CmsGroup.php +++ b/tests/Tests/Models/CMS/CmsGroup.php @@ -55,7 +55,7 @@ public function addUser(CmsUser $user): void $this->users[] = $user; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getUsers(): Collection { return $this->users; diff --git a/tests/Tests/Models/CMS/CmsTag.php b/tests/Tests/Models/CMS/CmsTag.php index aef3dc132c8..2c20a6c2fa5 100644 --- a/tests/Tests/Models/CMS/CmsTag.php +++ b/tests/Tests/Models/CMS/CmsTag.php @@ -48,7 +48,7 @@ public function addUser(CmsUser $user): void $this->users[] = $user; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getUsers(): Collection { return $this->users; diff --git a/tests/Tests/Models/CMS/CmsUser.php b/tests/Tests/Models/CMS/CmsUser.php index c0fa4bb76b5..b462bacdc25 100644 --- a/tests/Tests/Models/CMS/CmsUser.php +++ b/tests/Tests/Models/CMS/CmsUser.php @@ -115,7 +115,7 @@ public function addPhonenumber(CmsPhonenumber $phone): void $phone->setUser($this); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getPhonenumbers(): Collection { return $this->phonenumbers; @@ -133,7 +133,7 @@ public function addGroup(CmsGroup $group): void $group->addUser($this); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getGroups(): Collection { return $this->groups; diff --git a/tests/Tests/Models/Cache/Attraction.php b/tests/Tests/Models/Cache/Attraction.php index 385dc65adcb..6229088e3c4 100644 --- a/tests/Tests/Models/Cache/Attraction.php +++ b/tests/Tests/Models/Cache/Attraction.php @@ -77,7 +77,7 @@ public function setCity(City $city): void $this->city = $city; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getInfos(): Collection { return $this->infos; diff --git a/tests/Tests/Models/Cache/City.php b/tests/Tests/Models/Cache/City.php index edeec5e77a4..89b2f88dcb9 100644 --- a/tests/Tests/Models/Cache/City.php +++ b/tests/Tests/Models/Cache/City.php @@ -77,7 +77,7 @@ public function addTravel(Travel $travel): void $this->travels[] = $travel; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getTravels(): Collection { return $this->travels; @@ -88,7 +88,7 @@ public function addAttraction(Attraction $attraction): void $this->attractions[] = $attraction; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getAttractions(): Collection { return $this->attractions; diff --git a/tests/Tests/Models/Cache/State.php b/tests/Tests/Models/Cache/State.php index d72fbacadfb..cb565d41da2 100644 --- a/tests/Tests/Models/Cache/State.php +++ b/tests/Tests/Models/Cache/State.php @@ -73,13 +73,13 @@ public function setCountry(Country $country): void $this->country = $country; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getCities(): Collection { return $this->cities; } - /** @psalm-param Collection $cities */ + /** @phpstan-param Collection $cities */ public function setCities(Collection $cities): void { $this->cities = $cities; diff --git a/tests/Tests/Models/Cache/Travel.php b/tests/Tests/Models/Cache/Travel.php index 784c8ba0b8f..2f1c21ae23e 100644 --- a/tests/Tests/Models/Cache/Travel.php +++ b/tests/Tests/Models/Cache/Travel.php @@ -67,7 +67,7 @@ public function setTraveler(Traveler $traveler): void $this->traveler = $traveler; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getVisitedCities(): Collection { return $this->visitedCities; diff --git a/tests/Tests/Models/Cache/Traveler.php b/tests/Tests/Models/Cache/Traveler.php index a1f5363785c..ec6256817f4 100644 --- a/tests/Tests/Models/Cache/Traveler.php +++ b/tests/Tests/Models/Cache/Traveler.php @@ -73,7 +73,7 @@ public function setProfile(TravelerProfile $profile): void $this->profile = $profile; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getTravels(): Collection { return $this->travels; diff --git a/tests/Tests/Models/Company/CompanyContract.php b/tests/Tests/Models/Company/CompanyContract.php index e52e9e99b5b..dee315fb4fd 100644 --- a/tests/Tests/Models/Company/CompanyContract.php +++ b/tests/Tests/Models/Company/CompanyContract.php @@ -72,7 +72,7 @@ public function setSalesPerson(CompanyEmployee $salesPerson): void $this->salesPerson = $salesPerson; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getEngineers(): Collection { return $this->engineers; diff --git a/tests/Tests/Models/Company/CompanyContractListener.php b/tests/Tests/Models/Company/CompanyContractListener.php index f3f433fc9b6..ea6f37919ac 100644 --- a/tests/Tests/Models/Company/CompanyContractListener.php +++ b/tests/Tests/Models/Company/CompanyContractListener.php @@ -10,28 +10,28 @@ class CompanyContractListener { - /** @psalm-var list> */ + /** @phpstan-var list> */ public $postPersistCalls; - /** @psalm-var list> */ + /** @phpstan-var list> */ public $prePersistCalls; - /** @psalm-var list> */ + /** @phpstan-var list> */ public $postUpdateCalls; - /** @psalm-var list> */ + /** @phpstan-var list> */ public $preUpdateCalls; - /** @psalm-var list> */ + /** @phpstan-var list> */ public $postRemoveCalls; - /** @psalm-var list> */ + /** @phpstan-var list> */ public $preRemoveCalls; - /** @psalm-var list> */ + /** @phpstan-var list> */ public $preFlushCalls; - /** @psalm-var list> */ + /** @phpstan-var list> */ public $postLoadCalls; #[ORM\PostPersist] diff --git a/tests/Tests/Models/Company/CompanyFlexContract.php b/tests/Tests/Models/Company/CompanyFlexContract.php index 88bdc59b5a7..2a30d789d72 100644 --- a/tests/Tests/Models/Company/CompanyFlexContract.php +++ b/tests/Tests/Models/Company/CompanyFlexContract.php @@ -54,7 +54,7 @@ public function setPricePerHour(int $pricePerHour): void $this->pricePerHour = $pricePerHour; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getManagers(): Collection { return $this->managers; diff --git a/tests/Tests/Models/Company/CompanyFlexUltraContractListener.php b/tests/Tests/Models/Company/CompanyFlexUltraContractListener.php index e83b68e2a68..70bc525c523 100644 --- a/tests/Tests/Models/Company/CompanyFlexUltraContractListener.php +++ b/tests/Tests/Models/Company/CompanyFlexUltraContractListener.php @@ -11,7 +11,7 @@ class CompanyFlexUltraContractListener { - /** @psalm-var list */ + /** @phpstan-var list */ public $prePersistCalls; #[ORM\PrePersist] diff --git a/tests/Tests/Models/Company/CompanyOrganization.php b/tests/Tests/Models/Company/CompanyOrganization.php index 3e6de6f5037..dcb774524eb 100644 --- a/tests/Tests/Models/Company/CompanyOrganization.php +++ b/tests/Tests/Models/Company/CompanyOrganization.php @@ -32,7 +32,7 @@ public function getId(): int return $this->id; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getEvents(): Collection { return $this->events; diff --git a/tests/Tests/Models/Company/CompanyPerson.php b/tests/Tests/Models/Company/CompanyPerson.php index ad4082a4ea3..aa5a90efe34 100644 --- a/tests/Tests/Models/Company/CompanyPerson.php +++ b/tests/Tests/Models/Company/CompanyPerson.php @@ -75,7 +75,7 @@ public function getSpouse(): CompanyPerson|null return $this->spouse; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getFriends(): Collection { return $this->friends; diff --git a/tests/Tests/Models/CustomType/CustomTypeParent.php b/tests/Tests/Models/CustomType/CustomTypeParent.php index 50107740a2c..5f770b2b58c 100644 --- a/tests/Tests/Models/CustomType/CustomTypeParent.php +++ b/tests/Tests/Models/CustomType/CustomTypeParent.php @@ -58,7 +58,7 @@ public function addMyFriend(CustomTypeParent $friend): void $friend->addFriendWithMe($this); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getMyFriends(): Collection { return $this->myFriends; @@ -69,7 +69,7 @@ public function addFriendWithMe(CustomTypeParent $friend): void $this->getFriendsWithMe()->add($friend); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getFriendsWithMe() { return $this->friendsWithMe; diff --git a/tests/Tests/Models/DDC3579/DDC3579Group.php b/tests/Tests/Models/DDC3579/DDC3579Group.php index 2a3a27edc5d..b46910adab1 100644 --- a/tests/Tests/Models/DDC3579/DDC3579Group.php +++ b/tests/Tests/Models/DDC3579/DDC3579Group.php @@ -46,7 +46,7 @@ public function addAdmin(DDC3579Admin $admin): void $this->admins[] = $admin; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getAdmins(): Collection { return $this->admins; diff --git a/tests/Tests/Models/DDC964/DDC964Group.php b/tests/Tests/Models/DDC964/DDC964Group.php index b25c5a0f10b..3bc7df42e1e 100644 --- a/tests/Tests/Models/DDC964/DDC964Group.php +++ b/tests/Tests/Models/DDC964/DDC964Group.php @@ -45,7 +45,7 @@ public function addUser(DDC964User $user): void $this->users[] = $user; } - /** @psalm-return ArrayCollection */ + /** @phpstan-return ArrayCollection */ public function getUsers(): ArrayCollection { return $this->users; diff --git a/tests/Tests/Models/DDC964/DDC964User.php b/tests/Tests/Models/DDC964/DDC964User.php index 9adcca23dd6..254ac7241e6 100644 --- a/tests/Tests/Models/DDC964/DDC964User.php +++ b/tests/Tests/Models/DDC964/DDC964User.php @@ -66,7 +66,7 @@ public function addGroup(DDC964Group $group): void $group->addUser($this); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getGroups(): ArrayCollection { return $this->groups; diff --git a/tests/Tests/Models/ECommerce/ECommerceCart.php b/tests/Tests/Models/ECommerce/ECommerceCart.php index 206a409deeb..f6c804ba64e 100644 --- a/tests/Tests/Models/ECommerce/ECommerceCart.php +++ b/tests/Tests/Models/ECommerce/ECommerceCart.php @@ -86,7 +86,7 @@ public function getCustomer(): ECommerceCustomer|null return $this->customer; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getProducts(): Collection { return $this->products; diff --git a/tests/Tests/Models/ECommerce/ECommerceCategory.php b/tests/Tests/Models/ECommerce/ECommerceCategory.php index db64b563f6d..89f9a291e86 100644 --- a/tests/Tests/Models/ECommerce/ECommerceCategory.php +++ b/tests/Tests/Models/ECommerce/ECommerceCategory.php @@ -81,7 +81,7 @@ public function removeProduct(ECommerceProduct $product): void } } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getProducts(): Collection { return $this->products; @@ -92,7 +92,7 @@ private function setParent(ECommerceCategory $parent): void $this->parent = $parent; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getChildren(): Collection { return $this->children; diff --git a/tests/Tests/Models/ECommerce/ECommerceProduct.php b/tests/Tests/Models/ECommerce/ECommerceProduct.php index 8978ab0fad4..627809f5f7f 100644 --- a/tests/Tests/Models/ECommerce/ECommerceProduct.php +++ b/tests/Tests/Models/ECommerce/ECommerceProduct.php @@ -106,7 +106,7 @@ public function removeShipping(): void $this->shipping = null; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getFeatures(): Collection { return $this->features; @@ -150,19 +150,19 @@ public function removeCategory(ECommerceCategory $category): void } } - /** @psalm-param Collection $categories */ + /** @phpstan-param Collection $categories */ public function setCategories(Collection $categories): void { $this->categories = $categories; } - /** @psalm-return Collection $categories */ + /** @phpstan-return Collection $categories */ public function getCategories(): Collection { return $this->categories; } - /** @psalm-return Collection $categories */ + /** @phpstan-return Collection $categories */ public function getRelated(): Collection { return $this->related; diff --git a/tests/Tests/Models/Enums/FaultySwitch.php b/tests/Tests/Models/Enums/FaultySwitch.php index 7f01b239966..dcb01d446cb 100644 --- a/tests/Tests/Models/Enums/FaultySwitch.php +++ b/tests/Tests/Models/Enums/FaultySwitch.php @@ -14,8 +14,6 @@ class FaultySwitch /** * The following line is ignored on psalm and phpstan so that we can test * that the mapping is throwing an exception when a non-backed enum is used. - * - * @psalm-suppress InvalidArgument */ #[Column(enumType: SwitchStatus::class)] public SwitchStatus $status; diff --git a/tests/Tests/Models/GH7141/GH7141Article.php b/tests/Tests/Models/GH7141/GH7141Article.php index 0e5d448d518..f0811314484 100644 --- a/tests/Tests/Models/GH7141/GH7141Article.php +++ b/tests/Tests/Models/GH7141/GH7141Article.php @@ -9,7 +9,7 @@ class GH7141Article { - /** @psalm-var Collection */ + /** @phpstan-var Collection */ private $tags; public function __construct() diff --git a/tests/Tests/Models/GH7316/GH7316Article.php b/tests/Tests/Models/GH7316/GH7316Article.php index 5a582c31b2d..9440c4f63a0 100644 --- a/tests/Tests/Models/GH7316/GH7316Article.php +++ b/tests/Tests/Models/GH7316/GH7316Article.php @@ -9,7 +9,7 @@ class GH7316Article { - /** @psalm-var Collection */ + /** @phpstan-var Collection */ private $tags; public function __construct() diff --git a/tests/Tests/Models/Legacy/LegacyCar.php b/tests/Tests/Models/Legacy/LegacyCar.php index 5297d6a2e66..db1fa5f4088 100644 --- a/tests/Tests/Models/Legacy/LegacyCar.php +++ b/tests/Tests/Models/Legacy/LegacyCar.php @@ -40,7 +40,7 @@ public function addUser(LegacyUser $user): void $this->users[] = $user; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getUsers(): Collection { return $this->users; diff --git a/tests/Tests/Models/Legacy/LegacyUser.php b/tests/Tests/Models/Legacy/LegacyUser.php index e43bc6828bc..452e653a13c 100644 --- a/tests/Tests/Models/Legacy/LegacyUser.php +++ b/tests/Tests/Models/Legacy/LegacyUser.php @@ -78,7 +78,7 @@ public function addReference(LegacyUserReference $reference): void $this->references[] = $reference; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function references(): Collection { return $this->references; @@ -90,7 +90,7 @@ public function addCar(LegacyCar $car): void $car->addUser($this); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getCars(): Collection { return $this->cars; diff --git a/tests/Tests/Models/ManyToManyPersister/ChildClass.php b/tests/Tests/Models/ManyToManyPersister/ChildClass.php index b92cb70ccb5..30fb904c02b 100644 --- a/tests/Tests/Models/ManyToManyPersister/ChildClass.php +++ b/tests/Tests/Models/ManyToManyPersister/ChildClass.php @@ -22,7 +22,7 @@ class ChildClass { /** * @var Collection|ParentClass[] - * @psalm-var Collection + * @phpstan-var Collection */ #[JoinTable(name: 'parent_child')] #[JoinColumn(name: 'child_id1', referencedColumnName: 'id1')] diff --git a/tests/Tests/Models/ManyToManyPersister/ParentClass.php b/tests/Tests/Models/ManyToManyPersister/ParentClass.php index f39cb68a494..bcba7da0fdb 100644 --- a/tests/Tests/Models/ManyToManyPersister/ParentClass.php +++ b/tests/Tests/Models/ManyToManyPersister/ParentClass.php @@ -18,7 +18,7 @@ class ParentClass { /** * @var Collection|ChildClass[] - * @psalm-var Collection + * @phpstan-var Collection */ #[ManyToMany(targetEntity: ChildClass::class, mappedBy: 'parents', orphanRemoval: true, cascade: ['persist'])] public $children; diff --git a/tests/Tests/Models/Navigation/NavPointOfInterest.php b/tests/Tests/Models/Navigation/NavPointOfInterest.php index 711b09514a5..d5135ab887e 100644 --- a/tests/Tests/Models/Navigation/NavPointOfInterest.php +++ b/tests/Tests/Models/Navigation/NavPointOfInterest.php @@ -74,7 +74,7 @@ public function addVisitor(NavUser $user): void $this->visitors[] = $user; } - /** @psalm-var Collection */ + /** @phpstan-var Collection */ public function getVisitors(): Collection { return $this->visitors; diff --git a/tests/Tests/Models/Quote/User.php b/tests/Tests/Models/Quote/User.php index f58912337c8..26eb6df80b5 100644 --- a/tests/Tests/Models/Quote/User.php +++ b/tests/Tests/Models/Quote/User.php @@ -53,7 +53,7 @@ public function __construct() $this->groups = new ArrayCollection(); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getPhones(): Collection { return $this->phones; @@ -64,7 +64,7 @@ public function getAddress(): Address|null return $this->address; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getGroups(): Collection { return $this->groups; diff --git a/tests/Tests/ORM/Cache/RegionTestCase.php b/tests/Tests/ORM/Cache/RegionTestCase.php index 72102c4b462..5145cac6e44 100644 --- a/tests/Tests/ORM/Cache/RegionTestCase.php +++ b/tests/Tests/ORM/Cache/RegionTestCase.php @@ -31,10 +31,10 @@ protected function setUp(): void $this->region = $this->createRegion(); } - /** @psalm-return TRegion */ + /** @phpstan-return TRegion */ abstract protected function createRegion(): Region; - /** @psalm-return list */ + /** @phpstan-return list */ public static function dataProviderCacheValues(): array { return [ diff --git a/tests/Tests/ORM/Functional/CascadeRemoveOrderTest.php b/tests/Tests/ORM/Functional/CascadeRemoveOrderTest.php index d64b398fa82..007ab1cea21 100644 --- a/tests/Tests/ORM/Functional/CascadeRemoveOrderTest.php +++ b/tests/Tests/ORM/Functional/CascadeRemoveOrderTest.php @@ -111,7 +111,7 @@ public function addOneToManyG(CascadeRemoveOrderEntityG $eG): void $this->oneToManyG->add($eG); } - /** @psalm-return array */ + /** @phpstan-return array */ public function getOneToManyGs(): array { return $this->oneToManyG->toArray(); diff --git a/tests/Tests/ORM/Functional/ClassTableInheritanceSecondTest.php b/tests/Tests/ORM/Functional/ClassTableInheritanceSecondTest.php index 06e5ac71241..a25fc010ea1 100644 --- a/tests/Tests/ORM/Functional/ClassTableInheritanceSecondTest.php +++ b/tests/Tests/ORM/Functional/ClassTableInheritanceSecondTest.php @@ -189,7 +189,7 @@ public function addCTIChild(CTIChild $child): void $this->ctiChildren->add($child); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getCTIChildren(): Collection { return $this->ctiChildren; diff --git a/tests/Tests/ORM/Functional/DatabaseDriverTestCase.php b/tests/Tests/ORM/Functional/DatabaseDriverTestCase.php index abbf26c3ed6..bf004f7972e 100644 --- a/tests/Tests/ORM/Functional/DatabaseDriverTestCase.php +++ b/tests/Tests/ORM/Functional/DatabaseDriverTestCase.php @@ -20,7 +20,7 @@ */ abstract class DatabaseDriverTestCase extends OrmFunctionalTestCase { - /** @psalm-return array */ + /** @phpstan-return array */ protected function convertToClassMetadata(array $entityTables, array $manyTables = []): array { $sm = $this->createSchemaManager(); diff --git a/tests/Tests/ORM/Functional/EntityRepositoryTest.php b/tests/Tests/ORM/Functional/EntityRepositoryTest.php index 38d78823e28..4ea391669f5 100644 --- a/tests/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Tests/ORM/Functional/EntityRepositoryTest.php @@ -86,7 +86,7 @@ public function loadFixture(): int return $user1Id; } - /** @psalm-return array{int, int} */ + /** @phpstan-return array{int, int} */ public function loadAssociatedFixture(): array { $address = new CmsAddress(); @@ -109,7 +109,7 @@ public function loadAssociatedFixture(): array return [$user->id, $address->id]; } - /** @psalm-return list */ + /** @phpstan-return list */ public function loadFixtureUserEmail(): array { $user1 = new CmsUser(); diff --git a/tests/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php b/tests/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php index df2f8f2d72b..a2f48df25e5 100644 --- a/tests/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php +++ b/tests/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php @@ -102,7 +102,7 @@ private function createLoadingFixture(): void $this->_em->clear(); } - /** @psalm-return list */ + /** @phpstan-return list */ protected function findProducts(): array { $query = $this->_em->createQuery('SELECT p, c FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p LEFT JOIN p.categories c ORDER BY p.id, c.id'); @@ -118,7 +118,7 @@ protected function findProducts(): array return $result; } - /** @psalm-return list */ + /** @phpstan-return list */ protected function findCategories(): array { $query = $this->_em->createQuery('SELECT c, p FROM Doctrine\Tests\Models\ECommerce\ECommerceCategory c LEFT JOIN c.products p ORDER BY c.id, p.id'); @@ -137,7 +137,7 @@ protected function findCategories(): array return $result; } - /** @psalm-param list */ + /** @phpstan-param list */ public function assertLazyLoadFromInverseSide(array $products): void { [$firstProduct, $secondProduct] = $products; @@ -173,7 +173,7 @@ public function assertLazyLoadFromInverseSide(array $products): void $this->assertCollectionEquals($firstCategoryProducts, $secondCategoryProducts); } - /** @psalm-param list */ + /** @phpstan-param list */ public function assertLazyLoadFromOwningSide(array $categories): void { [$firstCategory, $secondCategory] = $categories; diff --git a/tests/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php b/tests/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php index 2717fb66ada..927af3d3e13 100644 --- a/tests/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php +++ b/tests/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php @@ -100,7 +100,7 @@ public function testLazyLoadsOwningSide(): void $this->assertLoadingOfOwningSide($products); } - /** @psalm-param list $products */ + /** @phpstan-param list $products */ public function assertLoadingOfOwningSide(array $products): void { [$firstProduct, $secondProduct] = $products; @@ -135,7 +135,7 @@ protected function createLoadingFixture(): void $this->_em->clear(); } - /** @psalm-return list */ + /** @phpstan-return list */ protected function findProducts(): array { $query = $this->_em->createQuery('SELECT p, r FROM Doctrine\Tests\Models\ECommerce\ECommerceProduct p LEFT JOIN p.related r ORDER BY p.id, r.id'); diff --git a/tests/Tests/ORM/Functional/NewOperatorTest.php b/tests/Tests/ORM/Functional/NewOperatorTest.php index 5a742c1b3a9..2394b6fd880 100644 --- a/tests/Tests/ORM/Functional/NewOperatorTest.php +++ b/tests/Tests/ORM/Functional/NewOperatorTest.php @@ -39,7 +39,7 @@ protected function setUp(): void $this->loadFixtures(); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideDataForHydrationMode(): array { return [ diff --git a/tests/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php b/tests/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php index 8d2af327e61..cefef0e15da 100644 --- a/tests/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php +++ b/tests/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php @@ -16,7 +16,7 @@ */ class OneToManyUnidirectionalAssociationTest extends OrmFunctionalTestCase { - /** @psalm-var array */ + /** @phpstan-var array */ protected $locations = []; protected function setUp(): void diff --git a/tests/Tests/ORM/Functional/OrderedCollectionTest.php b/tests/Tests/ORM/Functional/OrderedCollectionTest.php index 96413145536..72179ee19a4 100644 --- a/tests/Tests/ORM/Functional/OrderedCollectionTest.php +++ b/tests/Tests/ORM/Functional/OrderedCollectionTest.php @@ -13,7 +13,7 @@ class OrderedCollectionTest extends OrmFunctionalTestCase { - /** @psalm-var array */ + /** @phpstan-var array */ protected $locations = []; protected function setUp(): void diff --git a/tests/Tests/ORM/Functional/PaginationTest.php b/tests/Tests/ORM/Functional/PaginationTest.php index db89c353d45..af7b83394ce 100644 --- a/tests/Tests/ORM/Functional/PaginationTest.php +++ b/tests/Tests/ORM/Functional/PaginationTest.php @@ -766,7 +766,7 @@ public function populate(): void $this->_em->flush(); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function useOutputWalkers(): array { return [ @@ -775,7 +775,7 @@ public static function useOutputWalkers(): array ]; } - /** @psalm-return list */ + /** @phpstan-return list */ public static function fetchJoinCollection(): array { return [ @@ -784,7 +784,7 @@ public static function fetchJoinCollection(): array ]; } - /** @psalm-return list */ + /** @phpstan-return list */ public static function useOutputWalkersAndFetchJoinCollection(): array { return [ diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1080Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1080Test.php index fd319b59772..12458bec9ba 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1080Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1080Test.php @@ -111,7 +111,7 @@ public function getFooTitle(): string return $this->fooTitle; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getFooBars(): Collection { return $this->fooBars; @@ -166,7 +166,7 @@ public function getBarTitle(): string return $this->barTitle; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getFooBars(): Collection { return $this->fooBars; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1452Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1452Test.php index 2d44baf3383..51c97952730 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1452Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1452Test.php @@ -113,7 +113,7 @@ public function __construct() $this->entitiesB = new ArrayCollection(); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getEntitiesB(): Collection { return $this->entitiesB; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1595Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1595Test.php index 8a757b4ba73..6b0fc55d003 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1595Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1595Test.php @@ -98,7 +98,7 @@ class DDC1595InheritedEntity1 extends DDC1595BaseInheritance #[ManyToMany(targetEntity: 'DDC1595InheritedEntity2', fetch: 'EXTRA_LAZY')] protected $entities; - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getEntities(): Collection { return $this->entities; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1884Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1884Test.php index 360ac2bf519..b5b76a5b125 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1884Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1884Test.php @@ -55,7 +55,7 @@ protected function setUp(): void } /** - * @psalm-return array{Car, Car, Car, Car} + * @phpstan-return array{Car, Car, Car, Car} * * @var class-string $class */ @@ -86,7 +86,7 @@ private function createCars(string $class): array } /** - * @psalm-return array{Driver, Driver} + * @phpstan-return array{Driver, Driver} * * @var class-string $class */ diff --git a/tests/Tests/ORM/Functional/Ticket/DDC2012Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2012Test.php index 12f6d34e9e9..7ee54efba23 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2012Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2012Test.php @@ -108,7 +108,7 @@ class DDC2012TsVectorType extends Type { public const MYTYPE = 'tsvector'; - /** @psalm-var array> */ + /** @phpstan-var array> */ public static $calls = []; /** diff --git a/tests/Tests/ORM/Functional/Ticket/DDC211Test.php b/tests/Tests/ORM/Functional/Ticket/DDC211Test.php index 3d6de065d12..e1bbc4f9575 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC211Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC211Test.php @@ -84,7 +84,7 @@ public function setName(string $name): void $this->name = $name; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getGroups(): Collection { return $this->groups; @@ -119,7 +119,7 @@ public function setName(string $name): void $this->name = $name; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getUsers(): Collection { return $this->users; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC2252Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2252Test.php index 0e21c835be3..68b732d779a 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2252Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2252Test.php @@ -24,13 +24,13 @@ #[Group('DDC-2252')] class DDC2252Test extends OrmFunctionalTestCase { - /** @psalm-var DDC2252User */ + /** @phpstan-var DDC2252User */ private $user; - /** @psalm-var DDC2252MerchantAccount */ + /** @phpstan-var DDC2252MerchantAccount */ private $merchant; - /** @psalm-var DDC2252Membership */ + /** @phpstan-var DDC2252Membership */ private $membership; /** @psalm-var list */ @@ -176,7 +176,7 @@ public function getUid(): int return $this->uid; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getMemberships(): Collection { return $this->memberships; @@ -219,7 +219,7 @@ public function addPrivilege(DDC2252Privilege $privilege): void $this->privileges[] = $privilege; } - /** @psalm-var Collection */ + /** @phpstan-var Collection */ public function getPrivileges(): Collection { return $this->privileges; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC2494Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2494Test.php index a83be2af1f3..81661be3855 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2494Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2494Test.php @@ -105,7 +105,7 @@ public function getTemp(): int return $this->temp; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getCampaigns(): Collection { return $this->campaigns; @@ -142,7 +142,7 @@ public function getCurrency(): DDC2494Currency class DDC2494TinyIntType extends Type { - /** @psalm-var array> */ + /** @phpstan-var array> */ public static $calls = []; /** diff --git a/tests/Tests/ORM/Functional/Ticket/DDC3033Test.php b/tests/Tests/ORM/Functional/Ticket/DDC3033Test.php index e91198319a1..f1224536c69 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC3033Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC3033Test.php @@ -70,7 +70,7 @@ public function testIssue(): void #[HasLifecycleCallbacks] class DDC3033Product { - /** @psalm-var array */ + /** @phpstan-var array */ public $changeSet = []; /** @var int $id */ diff --git a/tests/Tests/ORM/Functional/Ticket/DDC3785Test.php b/tests/Tests/ORM/Functional/Ticket/DDC3785Test.php index 609e9ad7f2e..3e101c3eb66 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC3785Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC3785Test.php @@ -94,7 +94,7 @@ public function getId(): DDC3785AssetId return $this->id; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getAttributes() { return $this->attributes; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC440Test.php b/tests/Tests/ORM/Functional/Ticket/DDC440Test.php index b6b1e8bb542..d161d103e3c 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC440Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC440Test.php @@ -178,7 +178,7 @@ public function addPhone(DDC440Phone $value): void $value->setClient($this, false); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getPhones(): Collection { return $this->phones; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC531Test.php b/tests/Tests/ORM/Functional/Ticket/DDC531Test.php index adb3cbcf35a..c9a6052f196 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC531Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC531Test.php @@ -84,7 +84,7 @@ public function getParent(): DDC531Item return $this->parent; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getChildren(): Collection { return $this->children; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC599Test.php b/tests/Tests/ORM/Functional/Ticket/DDC599Test.php index 5d2adee5bfb..13b2529d32a 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC599Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC599Test.php @@ -103,7 +103,7 @@ public function __construct() $this->children = new ArrayCollection(); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getChildren(): Collection { return $this->children; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC69Test.php b/tests/Tests/ORM/Functional/Ticket/DDC69Test.php index 113da8cae2a..7ce3ec1131e 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC69Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC69Test.php @@ -158,7 +158,7 @@ public function removeRelation(Relation $relation): void } } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getRelations(): Collection { return $this->relations; @@ -303,7 +303,7 @@ public function removeRelation(Relation $relation): void } } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getRelations(): Collection { return $this->relations; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC719Test.php b/tests/Tests/ORM/Functional/Ticket/DDC719Test.php index b73545995ba..d05537622ab 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC719Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC719Test.php @@ -127,19 +127,19 @@ public function setDescription(string $description): void $this->description = $description; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getChildren(): Collection { return $this->children; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getParents(): Collection { return $this->parents; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getChannels(): Collection { return $this->channels; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC735Test.php b/tests/Tests/ORM/Functional/Ticket/DDC735Test.php index 3d69e12f8e0..aa6650fe808 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC735Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC735Test.php @@ -73,7 +73,7 @@ public function __construct() $this->reviews = new ArrayCollection(); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getReviews(): Collection { return $this->reviews; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC809Test.php b/tests/Tests/ORM/Functional/Ticket/DDC809Test.php index d36e2f520f3..9e75b13f550 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC809Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC809Test.php @@ -80,7 +80,7 @@ class DDC809Variant #[ManyToMany(targetEntity: 'DDC809SpecificationValue', inversedBy: 'Variants')] protected $specificationValues; - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getSpecificationValues(): Collection { return $this->specificationValues; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC881Test.php b/tests/Tests/ORM/Functional/Ticket/DDC881Test.php index a2e1b2c0751..0680ff70e44 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC881Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC881Test.php @@ -163,7 +163,7 @@ public function setPhoneNumber(string $phoneNumber): void $this->phonenumber = $phoneNumber; } - /** @psalm-var Collection */ + /** @phpstan-var Collection */ public function getCalls(): Collection { return $this->calls; diff --git a/tests/Tests/ORM/Functional/Ticket/GH7062Test.php b/tests/Tests/ORM/Functional/Ticket/GH7062Test.php index d16c204ba07..b8de944a086 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH7062Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH7062Test.php @@ -100,7 +100,7 @@ class GH7062Ranking { /** * @var Collection|GH7062RankingPosition[] - * @psalm-var Collection + * @phpstan-var Collection */ #[OneToMany(targetEntity: GH7062RankingPosition::class, mappedBy: 'ranking', cascade: ['all'])] public $positions; diff --git a/tests/Tests/ORM/Functional/Ticket/GH7767Test.php b/tests/Tests/ORM/Functional/Ticket/GH7767Test.php index f60cfac092a..760da61d61a 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH7767Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH7767Test.php @@ -85,7 +85,7 @@ public function addChild(int $position): void $this->children[] = new GH7767ChildEntity($this, $position); } - /** @psalm-return Collection&Selectable */ + /** @phpstan-return Collection&Selectable */ public function getChildren(): Collection { return $this->children; diff --git a/tests/Tests/ORM/Functional/Ticket/GH7836Test.php b/tests/Tests/ORM/Functional/Ticket/GH7836Test.php index 0aef74541bf..1cdaea018a1 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH7836Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH7836Test.php @@ -116,7 +116,7 @@ public function addChild(int $position, string $name): void $this->children[] = new GH7836ChildEntity($this, $position, $name); } - /** @psalm-return Collection&Selectable */ + /** @phpstan-return Collection&Selectable */ public function getChildren(): Collection { return $this->children; diff --git a/tests/Tests/ORM/Functional/Ticket/GH9109Test.php b/tests/Tests/ORM/Functional/Ticket/GH9109Test.php index 8bae1d8cc61..3f52f281a92 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH9109Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH9109Test.php @@ -125,7 +125,7 @@ public function getTitle(): string return $this->title; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getBuyers(): Collection { return $this->buyers; diff --git a/tests/Tests/ORM/Functional/ValueObjectsTest.php b/tests/Tests/ORM/Functional/ValueObjectsTest.php index 3186e71d357..ad77a29b29f 100644 --- a/tests/Tests/ORM/Functional/ValueObjectsTest.php +++ b/tests/Tests/ORM/Functional/ValueObjectsTest.php @@ -346,7 +346,7 @@ public function testThrowsExceptionOnInfiniteEmbeddableNesting( $this->createSchemaForModels(__NAMESPACE__ . '\\' . $embeddableClassName); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function getInfiniteEmbeddableNestingData(): array { return [ diff --git a/tests/Tests/ORM/Hydration/ObjectHydratorTest.php b/tests/Tests/ORM/Hydration/ObjectHydratorTest.php index 0a1f369bd1f..0ed99480558 100644 --- a/tests/Tests/ORM/Hydration/ObjectHydratorTest.php +++ b/tests/Tests/ORM/Hydration/ObjectHydratorTest.php @@ -47,7 +47,7 @@ public static function provideDataForUserEntityResult(): array ]; } - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideDataForMultipleRootEntityResult(): array { return [ @@ -58,7 +58,7 @@ public static function provideDataForMultipleRootEntityResult(): array ]; } - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideDataForProductEntityResult(): array { return [ diff --git a/tests/Tests/ORM/Internal/HydrationCompleteHandlerTest.php b/tests/Tests/ORM/Internal/HydrationCompleteHandlerTest.php index 51cf37e0494..2bdeab19498 100644 --- a/tests/Tests/ORM/Internal/HydrationCompleteHandlerTest.php +++ b/tests/Tests/ORM/Internal/HydrationCompleteHandlerTest.php @@ -145,7 +145,7 @@ public function testSkipsDeferredPostLoadOfMetadataWithNoInvokedListeners(): voi $this->handler->hydrationComplete(); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function invocationFlagProvider(): array { return [ diff --git a/tests/Tests/ORM/Mapping/XmlMappingDriverTest.php b/tests/Tests/ORM/Mapping/XmlMappingDriverTest.php index 5426da45c91..474c623f352 100644 --- a/tests/Tests/ORM/Mapping/XmlMappingDriverTest.php +++ b/tests/Tests/ORM/Mapping/XmlMappingDriverTest.php @@ -176,7 +176,7 @@ public function testValidateXmlSchema( $this->assertEquals($metadata->getAssociationNames(), $associationNames); } - /** @psalm-return []array{0: class-string, 1: string, 2: list, 3: list} */ + /** @phpstan-return []array{0: class-string, 1: string, 2: list, 3: list} */ public static function dataValidSchema(): array { return [ diff --git a/tests/Tests/ORM/Query/LanguageRecognitionTest.php b/tests/Tests/ORM/Query/LanguageRecognitionTest.php index 31181de1a44..02b42fb5ba6 100644 --- a/tests/Tests/ORM/Query/LanguageRecognitionTest.php +++ b/tests/Tests/ORM/Query/LanguageRecognitionTest.php @@ -43,7 +43,7 @@ public function assertInvalidDQL(string $dql): void $this->parseDql($dql); } - /** @psalm-param array $hints */ + /** @phpstan-param array $hints */ public function parseDql(string $dql, array $hints = []): ParserResult { $query = $this->entityManager->createQuery($dql); @@ -92,7 +92,7 @@ public function testRejectsInvalidDQL(string $dql): void $this->parseDql($dql); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function invalidDQL(): array { return [ diff --git a/tests/Tests/ORM/Query/LexerTest.php b/tests/Tests/ORM/Query/LexerTest.php index 9ddd2811a27..bfce16ab7b7 100644 --- a/tests/Tests/ORM/Query/LexerTest.php +++ b/tests/Tests/ORM/Query/LexerTest.php @@ -184,7 +184,7 @@ public function testScannerTokenizesASimpleQueryCorrectly(): void self::assertFalse($lexer->moveNext()); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideTokens(): array { return [ diff --git a/tests/Tests/ORM/Query/ParserTest.php b/tests/Tests/ORM/Query/ParserTest.php index 430177b1fcc..c260455d712 100644 --- a/tests/Tests/ORM/Query/ParserTest.php +++ b/tests/Tests/ORM/Query/ParserTest.php @@ -62,7 +62,7 @@ public function testMatchFailure(TokenType $expectedToken, string $inputString): $parser->match($expectedToken); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function validMatches(): array { /* @@ -83,7 +83,7 @@ public static function validMatches(): array ]; } - /** @psalm-return list */ + /** @phpstan-return list */ public static function invalidMatches(): array { return [ diff --git a/tests/Tests/ORM/Query/QueryExpressionVisitorTest.php b/tests/Tests/ORM/Query/QueryExpressionVisitorTest.php index 54cc54d5546..9ece94b5d2a 100644 --- a/tests/Tests/ORM/Query/QueryExpressionVisitorTest.php +++ b/tests/Tests/ORM/Query/QueryExpressionVisitorTest.php @@ -36,7 +36,7 @@ public function testWalkComparison(CriteriaComparison $criteriaExpr, QueryBuilde } /** - * @psalm-return listgetHint(Query::HINT_LOCK_MODE)); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideLockModes(): array { return [ @@ -238,7 +238,7 @@ public function testExplicitCollectionParameters(): void self::assertEquals($cities, $parameter->getValue()); } - /** @psalm-return Generator */ + /** @phpstan-return Generator */ public static function provideProcessParameterValueIterable(): Generator { $baseArray = [ diff --git a/tests/Tests/ORM/Query/SelectSqlGenerationTest.php b/tests/Tests/ORM/Query/SelectSqlGenerationTest.php index 6b7d9585462..02c4921c54f 100644 --- a/tests/Tests/ORM/Query/SelectSqlGenerationTest.php +++ b/tests/Tests/ORM/Query/SelectSqlGenerationTest.php @@ -2128,7 +2128,7 @@ public function testHavingRegressionUsingVariableWithMathOperatorsExpression($op ); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function mathematicOperatorsProvider(): array { return [['+'], ['-'], ['*'], ['/']]; diff --git a/tests/Tests/ORM/Tools/AttachEntityListenersListenerTest.php b/tests/Tests/ORM/Tools/AttachEntityListenersListenerTest.php index 82068f89aed..26fc5abe8d2 100644 --- a/tests/Tests/ORM/Tools/AttachEntityListenersListenerTest.php +++ b/tests/Tests/ORM/Tools/AttachEntityListenersListenerTest.php @@ -170,7 +170,7 @@ class AttachEntityListenersListenerTestBarEntity class AttachEntityListenersListenerTestListener { - /** @psalm-var array>> */ + /** @phpstan-var array>> */ public $calls; public function prePersist(): void @@ -191,7 +191,7 @@ public function postPersist(): void class AttachEntityListenersListenerTestListener2 { - /** @psalm-var array>> */ + /** @phpstan-var array>> */ public $calls; public function prePersist(): void diff --git a/tests/Tests/ORM/UnitOfWorkTest.php b/tests/Tests/ORM/UnitOfWorkTest.php index 2a421c6687d..238848696c3 100644 --- a/tests/Tests/ORM/UnitOfWorkTest.php +++ b/tests/Tests/ORM/UnitOfWorkTest.php @@ -330,7 +330,7 @@ public function testAddToIdentityMapValidIdentifiers(object $entity, string $idH self::assertSame($entity, $this->_unitOfWork->getByIdHash($idHash, $entity::class)); } - /** @psalm-return array */ + /** @phpstan-return array */ public static function entitiesWithValidIdentifiersProvider(): array { $emptyString = new EntityWithStringIdentifier(); @@ -385,7 +385,7 @@ public function testAddToIdentityMapInvalidIdentifiers(object $entity, array $id $this->_unitOfWork->registerManaged($entity, $identifier, []); } - /** @psalm-return array}> */ + /** @phpstan-return array}> */ public static function entitiesWithInvalidIdentifiersProvider(): array { $firstNullString = new EntityWithCompositeStringIdentifier(); diff --git a/tests/Tests/OrmFunctionalTestCase.php b/tests/Tests/OrmFunctionalTestCase.php index edec9ca261e..f2cf5f81f18 100644 --- a/tests/Tests/OrmFunctionalTestCase.php +++ b/tests/Tests/OrmFunctionalTestCase.php @@ -1068,7 +1068,7 @@ final protected function assertQueryCount(int $expectedCount, string $message = self::assertThat($this->getQueryLog()->queries, new Count($expectedCount), $message); } - /** @psalm-return array{sql: string, params: array|null, types: array|null} */ + /** @phpstan-return array{sql: string, params: array|null, types: array|null} */ final protected function getLastLoggedQuery(int $index = 0): array { $queries = $this->getQueryLog()->queries; diff --git a/tests/Tests/TestUtil.php b/tests/Tests/TestUtil.php index 7c75fcff991..33869c3b174 100644 --- a/tests/Tests/TestUtil.php +++ b/tests/Tests/TestUtil.php @@ -160,7 +160,7 @@ private static function getPrivilegedConnectionParameters(): array return $parameters; } - /** @psalm-return array */ + /** @phpstan-return array */ private static function getTestConnectionParameters(): array { if (! isset($GLOBALS['db_driver'])) {