diff --git a/.github/workflows/static-analysis.yml b/.github/workflows/static-analysis.yml index 6ed391c70ba..dda82aa6a5b 100644 --- a/.github/workflows/static-analysis.yml +++ b/.github/workflows/static-analysis.yml @@ -74,30 +74,3 @@ jobs: run: "vendor/bin/phpstan analyse -c phpstan-persistence2.neon" if: "${{ matrix.dbal-version == 'default' && matrix.persistence-version != 'default'}}" - static-analysis-psalm: - name: "Static Analysis with Psalm" - runs-on: "ubuntu-22.04" - - strategy: - fail-fast: false - - steps: - - name: "Checkout code" - uses: "actions/checkout@v4" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "8.3" - - - name: "Require specific persistence version" - run: "composer require doctrine/persistence ^3.1 --no-update" - - - name: "Install dependencies with Composer" - uses: "ramsey/composer-install@v3" - with: - dependency-versions: "highest" - - - name: "Run a static analysis with vimeo/psalm" - run: "vendor/bin/psalm --show-info=false --stats --output-format=github --threads=$(nproc)" diff --git a/composer.json b/composer.json index 6001689c408..7988d5f17d5 100644 --- a/composer.json +++ b/composer.json @@ -51,8 +51,7 @@ "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^4.4 || ^5.4 || ^6.4 || ^7.0", "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2 || ^7.0", - "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0", - "vimeo/psalm": "4.30.0 || 5.26.1" + "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0 || ^7.0" }, "conflict": { "doctrine/annotations": "<1.13 || >= 3.0" diff --git a/psalm-baseline.xml b/psalm-baseline.xml deleted file mode 100644 index b8655116282..00000000000 --- a/psalm-baseline.xml +++ /dev/null @@ -1,2833 +0,0 @@ - - - - - - - - - - - - - - isEmpty() ? $filteredParameters->first() : null]]> - - - - - - - - - - - - - - _em->getConfiguration()->getResultCacheImpl()]]> - _queryCacheProfile->getResultCacheDriver()]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getConfiguration() - ->getSecondLevelCacheConfiguration() - ->getCacheFactory()]]> - - - - - - - - - - - fileLockRegionDirectory]]> - - - - - - - - getMetadataFactory()]]> - - - associationMappings]]> - - - - - - - - - - - - - identifiers[$assocIndex]]]> - identifiers[$assocIndex]]]> - identifiers[$index]]]> - identifiers[$index]]]> - - - - - - class]]> - class]]> - - - - - - - - - - - - - - - - - - - - - - identifiers]]> - - - getOwner()]]> - getOwner()]]> - - - - - - - - - getOwner()]]> - getOwner()]]> - - - - - getOwner()]]> - - - - - getOwner()]]> - getOwner()]]> - - - - - - - - - - - - - - - class]]> - - - getOwner()]]> - getOwner()]]> - - - getCache()]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - cache]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - time]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - name ? $entity : null]]> - name ? $entity : null]]> - load($sortedId, null, null, [], $lockMode)]]> - loadById($sortedId)]]> - - - - - - - - - - - - - - - - - - getProxyDir()]]> - getProxyNamespace()]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - load($criteria, null, null, [], null, 1, $orderBy)]]> - - - - - &Selectable]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - nextValue]]> - nextValue]]> - - - - - - - - - - - - - associationMappings[$fieldName]['joinColumns'][0]]]> - associationMappings[$fieldName]['joinColumns'][0]['name']]]> - - - - - - associationMappings[$fieldName]['joinColumns']]]> - associationMappings[$fieldName]['joinColumns']]]> - - - - - - - - - - - - - - - - - - - - - - - - - resultPointers[$parent]]]> - - - resultPointers[$parent][key($first)]]]> - resultPointers[$dqlAlias] =& $coll[key($coll)]]]> - - - - - - - - - - - hydrator->hydrateRow()]]> - next()]]> - - - current !== false]]> - - - - - - - - - - - - - - - - - - - - associationMappings[$class->identifier[0]]['joinColumns'][0]]]> - associationMappings[$class->identifier[0]]['joinColumns'][0]['name']]]> - associationMappings[$fieldName]['joinColumns'][0]]]> - associationMappings[$fieldName]['joinColumns'][0]['name']]]> - - - - - reflFields]]> - - - - - - - - - - associationMappings[$class->identifier[0]]['joinColumns']]]> - associationMappings[$fieldName]['joinColumns']]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - table[$indexType][$indexName]]]> - - - - - - - table[$indexType]]]> - - - em]]> - em]]> - - - - - - - - - - - - - - - - - - - - columnNames]]> - columnNames]]> - columnNames]]> - columnNames]]> - - - table]]> - table]]> - - - - - - - - - - - - - - - - - sqlResultSetMappings]]> - - - - reflClass]]> - - - - - - - - - - - - - ]]> - ]]> - - - associationMappings[$fieldName]['joinColumns'][0]['name']]]> - associationMappings[$fieldName]['joinColumns'][0]['referencedColumnName']]]> - associationMappings[$fieldName]['mappedBy']]]> - reflClass]]> - reflFields[$name]]]> - reflFields[$this->identifier[0]]]]> - - - - - - - - - - - - - - - - - - - associationMappings[$fieldName]['joinColumns'][0]]]> - associationMappings[$fieldName]['joinColumns'][0]]]> - associationMappings[$fieldName]['joinColumns'][0]['name']]]> - associationMappings[$fieldName]['joinColumns'][0]['referencedColumnName']]]> - - - reflClass->name]]> - reflClass->name]]> - - - - - - - - - - - - - - - - - - - associationMappings[$assocName]['joinColumns']]]> - associationMappings[$fieldName]['joinColumns']]]> - associationMappings[$fieldName]['joinColumns']]]> - associationMappings[$idProperty]['joinColumns']]]> - associationMappings[$idProperty]['joinColumns']]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - instances]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - associationMappings[$fieldName]['joinColumns']]]> - - - - - - - - - - - - - - - - - - - - $seqGeneratorAnnot->sequenceName, - 'allocationSize' => $seqGeneratorAnnot->allocationSize, - 'initialValue' => $seqGeneratorAnnot->initialValue, - ]]]> - - - - - - - - - - - - - - - - - - - getReflectionClass()]]> - - - name)]]> - - - - - - - - - - - - - - - $seqGeneratorAttribute->sequenceName, - 'allocationSize' => $seqGeneratorAttribute->allocationSize, - 'initialValue' => $seqGeneratorAttribute->initialValue, - ]]]> - - - - - - - - - - - - - - - getReflectionClass()]]> - - - - - - - - - name)]]> - - - - - - - - namespace . $this->classNamesForTables[$tableName]]]> - namespace . $this->inflector->classify(strtolower($tableName))]]> - - - - - - - - - - - - tables[$tableName]]]> - tables[$tableName]]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - table]]> - - - - $usage, - 'region' => $region, - ]]]> - - - - - - - - - - - - - - - - isset($discrColumn['name']) ? (string) $discrColumn['name'] : null, - 'type' => isset($discrColumn['type']) ? (string) $discrColumn['type'] : 'string', - 'length' => isset($discrColumn['length']) ? (int) $discrColumn['length'] : 255, - 'columnDefinition' => isset($discrColumn['columnDefinition']) ? (string) $discrColumn['columnDefinition'] : null, - 'enumType' => isset($discrColumn['enumType']) ? (string) $discrColumn['enumType'] : null, - ]]]> - - - - - - - $usage, - 'region' => $region, - ]]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - embeddedClass]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - - - loadCriteria($criteria))]]> - em->find($this->typeClass->name, $key)]]> - - - ]]> - - - unwrap()->matching($criteria)]]> - - - - - - - - - - backRefFieldName]]> - getMapping()['indexBy']]]> - - - - - - - - getMapping()['indexBy']]]> - getMapping()['orphanRemoval']]]> - getMapping()['orphanRemoval']]]> - - - unwrap(), 'add']]]> - - - - - $collection->getOwner(), $mapping['indexBy'] => $index]]]> - - - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - getOwner()]]> - - - - - - - - - - - - - - - - - - - - - associationMappings]]> - associationMappings]]> - associationMappings]]> - associationMappings]]> - associationMappings]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $collection->getOwner(), - $mapping['indexBy'] => $index, - ]]]> - - - getOwner()]]> - getOwner()]]> - getOwner()]]> - - - - - - associationMappings]]> - - - associationMappings[$mapping['mappedBy']]['joinColumns']]]> - - - - associationMappings[$mapping['mappedBy']]['joinColumns']]]> - - - - - - - - - - - - - getMetadataFactory()]]> - - - true]]]> - true]]]> - true]]]> - - - - - - - - - - - - - - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - associationMappings]]> - associationMappings]]> - associationMappings]]> - class->associationMappings]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - class->associationMappings[$fieldName]['joinColumns']]]> - class->associationMappings[$idField]['joinColumns']]]> - - - currentPersisterContext->sqlTableAliases]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getReflectionProperties()]]> - getMetadataFactory()]]> - getMetadataFactory()]]> - - - - - - proxyFactories]]> - - - isEmbeddedClass]]> - isMappedSuperclass]]> - - - proxyFactories[$className] = $proxyFactory]]> - - - - - - - - - name]]> - name]]> - - - - - - - - - - 4]]> - - - - - - - - - - - - - - - - - - - - - - - getDQL()]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SimpleArithmeticExpression()]]> - - - - - ArithmeticPrimary()]]> - ArithmeticPrimary()]]> - - - - - ArithmeticPrimary()]]> - ArithmeticPrimary()]]> - - - - - ArithmeticPrimary()]]> - ArithmeticPrimary()]]> - - - - - - - - unit->value]]> - - - - - ArithmeticPrimary()]]> - ArithmeticPrimary()]]> - - - - - unit->value]]> - - - - - - - - - - - - - - - - - - - - - simpleArithmeticExpression]]> - - - SimpleArithmeticExpression()]]> - - - - - SimpleArithmeticExpression()]]> - SimpleArithmeticExpression()]]> - - - - - - - - - - - - - associationMappings]]> - associationMappings]]> - - - - - - - - - - - - - SimpleArithmeticExpression()]]> - - - - - SimpleArithmeticExpression()]]> - SimpleArithmeticExpression()]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - simpleStateFieldPathExpression]]> - - - - - - walkIndexBy($this)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _sqlStatements]]> - _sqlStatements]]> - - - _sqlStatements !== null && $this->sqlStatements === null]]> - sqlStatements === null]]> - - - - - - - - - - - _sqlStatements !== null]]> - - - sqlStatements]]> - - - _sqlStatements = &$this->sqlStatements]]> - _sqlStatements = &$this->sqlStatements]]> - - - - - - - - - - - - - - - - - sqlStatements]]> - - - - - - - - - - - - - - - sqlStatements]]> - - - - - - - - - - sqlStatements]]> - - - - - - - - - executeStatement($this->sqlStatements, $params, $types)]]> - - - - - - sqlStatements]]> - - - - - - - - - - - - - - - - - - - - - - - - - - arguments]]> - - - ]]> - - - - - - - - - - conditionType]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - parameters]]> - - - - - - - - - - - - - - - - - - - - queryComponents]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - lexer->getLiteral($token)]]> - lexer->getLiteral($token)]]> - lexer->getLiteral($token)]]> - - - SimpleArithmeticExpression()]]> - - - - query->getDQL()]]> - value]]> - - - lexer->glimpse()->type]]> - value]]> - value]]> - - - - - - - - - - - - parameters)]]> - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - queryComponents[$expression]]]> - - - - - - - - - - - - whereClause]]> - whereClause]]> - whereClause]]> - simpleArithmeticExpression]]> - subselect]]> - - - - - - rangeVariableDeclaration]]> - - - whereClause]]> - - - - - - - - - - - - - - - associationMappings]]> - associationMappings]]> - associationMappings]]> - scalarResultAliasMap]]> - scalarResultAliasMap]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - |false]]> - - - walkers]]> - - - walkers]]> - walkers]]> - - - - - $join]]]> - $join]]]> - - - - - - - isEmpty() ? $filteredParameters->first() : null]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - repositoryList[$repositoryHash]]]> - repositoryList[$repositoryHash] = $this->createRepository($entityManager, $entityName)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - name]]> - - - - - - - - - - - - - - - - - name]]> - - - - - name]]> - - - getConfiguration()->getProxyDir()]]> - - - - - - - - customRepositoryClassName]]> - - - - - - - - - - entityListeners]]> - - - - - - - - - - - executeSchemaCommand($input, $output, new SchemaTool($em), $metadatas, $ui)]]> - - - - - - - - - - - - - - - - getName()]]> - getName()]]> - - - - - - - - getName()]]> - getName()]]> - - - - - - - - - - - - - - - - - - - - - - - - - - getClassToExtend()]]> - getClassToExtend() ?: $metadata->name]]> - getClassToExtend() ?: $metadata->name]]> - - - - - - - - name, '\\')]]> - - - - - - - - - - - - - - - - - lifecycleCallbacks)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _outputDir]]> - - - - - - - - - - - - - - - changeTrackingPolicy]]> - - - - - - - - - - - - - table]]> - - - - - changeTrackingPolicy]]> - asXML()]]> - - - - - - - - - - - - - lifecycleCallbacks)]]> - - - - - changeTrackingPolicy]]> - - - - - - null]]]> - - - - - - - - - &array{entityListeners: array>}]]> - - - - - - - - - - - table]]> - lifecycleCallbacks)]]> - - - - - - - - associationMappings[$property]['joinColumns']]]> - - - - - - - - - - - orderByItems]]> - - - orderByClause]]> - getMaxResults()]]> - - - orderByItems]]> - - - associationMappings[$property]['joinColumns']]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getAssociationMapping($fieldName)['joinColumns']]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - getMetadataFactory()]]> - - - entityChangeSets]]> - entityChangeSets]]> - - - - - - - - - - - - - - - - identityMap[$rootClassName]]]> - - - - - getTypeOfField($class->getSingleIdentifierFieldName())]]> - getOwner()]]> - getOwner()]]> - - - - reflFields]]> - reflFields]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - name]]> - subClasses]]> - - - - - associationMappings[$field]['joinColumns']]]> - - - - - - - - - - - - - - - - - diff --git a/psalm.xml b/psalm.xml deleted file mode 100644 index 19b4e9368ca..00000000000 --- a/psalm.xml +++ /dev/null @@ -1,311 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/AbstractQuery.php b/src/AbstractQuery.php index 731e6b621b9..b931e69ee57 100644 --- a/src/AbstractQuery.php +++ b/src/AbstractQuery.php @@ -90,7 +90,7 @@ abstract class AbstractQuery * The parameter map of this query. * * @var ArrayCollection|Parameter[] - * @psalm-var ArrayCollection + * @phpstan-var ArrayCollection */ protected $parameters; @@ -111,7 +111,7 @@ abstract class AbstractQuery /** * The map of query hints. * - * @psalm-var array + * @phpstan-var array */ protected $_hints = []; @@ -119,7 +119,7 @@ abstract class AbstractQuery * The hydration mode. * * @var string|int - * @psalm-var string|AbstractQuery::HYDRATE_* + * @phpstan-var string|AbstractQuery::HYDRATE_* */ protected $_hydrationMode = self::HYDRATE_OBJECT; @@ -157,7 +157,7 @@ abstract class AbstractQuery * Second level query cache mode. * * @var int|null - * @psalm-var Cache::MODE_*|null + * @phpstan-var Cache::MODE_*|null */ protected $cacheMode; @@ -254,7 +254,7 @@ public function setLifetime($lifetime) /** * @return int|null - * @psalm-return Cache::MODE_*|null + * @phpstan-return Cache::MODE_*|null */ public function getCacheMode() { @@ -263,7 +263,7 @@ public function getCacheMode() /** * @param int $cacheMode - * @psalm-param Cache::MODE_* $cacheMode + * @phpstan-param Cache::MODE_* $cacheMode * * @return $this */ @@ -311,7 +311,7 @@ public function free() * Get all defined parameters. * * @return ArrayCollection The defined query parameters. - * @psalm-return ArrayCollection + * @phpstan-return ArrayCollection */ public function getParameters() { @@ -344,14 +344,14 @@ static function (Query\Parameter $parameter) use ($key): bool { * 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($parameters) { if (is_array($parameters)) { - /** @psalm-var ArrayCollection $parameterCollection */ + /** @phpstan-var ArrayCollection $parameterCollection */ $parameterCollection = new ArrayCollection(); foreach ($parameters as $key => $value) { @@ -844,7 +844,7 @@ public function getQueryCacheProfile() * @param class-string $class * @param string $assocName * @param int $fetchMode - * @psalm-param Mapping\ClassMetadata::FETCH_EAGER|Mapping\ClassMetadata::FETCH_LAZY $fetchMode + * @phpstan-param Mapping\ClassMetadata::FETCH_EAGER|Mapping\ClassMetadata::FETCH_LAZY $fetchMode * * @return $this */ @@ -870,7 +870,7 @@ public function setFetchMode($class, $assocName, $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 */ @@ -885,7 +885,7 @@ public function setHydrationMode($hydrationMode) * Gets the hydration mode currently used by the query. * * @return string|int - * @psalm-return string|AbstractQuery::HYDRATE_* + * @phpstan-return string|AbstractQuery::HYDRATE_* */ public function getHydrationMode() { @@ -898,7 +898,7 @@ public function getHydrationMode() * Alias for execute(null, $hydrationMode = HYDRATE_OBJECT). * * @param string|int $hydrationMode - * @psalm-param string|AbstractQuery::HYDRATE_* $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_* $hydrationMode * * @return mixed */ @@ -947,7 +947,7 @@ public function getScalarResult() * Get exactly one result or null. * * @param string|int|null $hydrationMode - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode * * @return mixed * @@ -985,7 +985,7 @@ public function getOneOrNullResult($hydrationMode = null) * If there is no result, a NoResultException is thrown. * * @param string|int|null $hydrationMode - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode * * @return mixed * @@ -1083,8 +1083,8 @@ public function getHints() * * @param ArrayCollection|mixed[]|null $parameters The query parameters. * @param string|int|null $hydrationMode The hydration mode to use. - * @psalm-param ArrayCollection|array|null $parameters - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode The hydration mode to use. + * @phpstan-param ArrayCollection|array|null $parameters + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode The hydration mode to use. * * @return IterableResult */ @@ -1121,8 +1121,8 @@ public function iterate($parameters = null, $hydrationMode = null) * * @param ArrayCollection|array|mixed[] $parameters The query parameters. * @param string|int|null $hydrationMode The hydration mode to use. - * @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 */ @@ -1158,8 +1158,8 @@ public function toIterable(iterable $parameters = [], $hydrationMode = null): it * * @param ArrayCollection|mixed[]|null $parameters Query parameters. * @param string|int|null $hydrationMode Processing mode to be used during the hydration process. - * @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 * * @return mixed */ @@ -1177,8 +1177,8 @@ public function execute($parameters = null, $hydrationMode = null) * * @param ArrayCollection|mixed[]|null $parameters * @param string|int|null $hydrationMode - * @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 * * @return mixed */ @@ -1259,8 +1259,8 @@ private function getHydrationCache(): CacheItemPoolInterface * * @param ArrayCollection|mixed[]|null $parameters * @param string|int|null $hydrationMode - * @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 * * @return mixed */ @@ -1323,7 +1323,7 @@ private function getTimestampKey(): ?TimestampCacheKey * 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() { diff --git a/src/Cache/CacheFactory.php b/src/Cache/CacheFactory.php index 3d3e5928cef..6d4171e18e9 100644 --- a/src/Cache/CacheFactory.php +++ b/src/Cache/CacheFactory.php @@ -15,7 +15,7 @@ /** * Contract for building second level cache regions components. * - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ interface CacheFactory { diff --git a/src/Cache/DefaultCache.php b/src/Cache/DefaultCache.php index ff9b60ba402..d318dd007d8 100644 --- a/src/Cache/DefaultCache.php +++ b/src/Cache/DefaultCache.php @@ -31,7 +31,7 @@ class DefaultCache implements Cache /** * @var QueryCache[] - * @psalm-var array + * @phpstan-var array */ private $queryCaches = []; diff --git a/src/Cache/DefaultQueryCache.php b/src/Cache/DefaultQueryCache.php index 1c11ebbb8dd..dccb7bfa77e 100644 --- a/src/Cache/DefaultQueryCache.php +++ b/src/Cache/DefaultQueryCache.php @@ -29,7 +29,7 @@ /** * Default query cache implementation. * - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ class DefaultQueryCache implements QueryCache { @@ -331,7 +331,7 @@ public function put(QueryCacheKey $key, ResultSetMapping $rsm, $result, array $h * @param mixed $assocValue * * @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, array $assoc, $assocValue): ?array { @@ -386,7 +386,7 @@ private function storeAssociationCache(QueryCacheKey $key, array $assoc, $assocV * @param object $entity * * @return mixed[]|object|null - * @psalm-return list|object|null + * @phpstan-return list|object|null */ private function getAssociationValue( ResultSetMapping $rsm, @@ -414,10 +414,10 @@ private function getAssociationValue( /** * @param mixed $value - * @psalm-param array $path + * @phpstan-param array $path * * @return mixed[]|object|null - * @psalm-return list|object|null + * @phpstan-return list|object|null */ private function getAssociationPathValue($value, array $path) { diff --git a/src/Cache/Persister/Collection/AbstractCollectionPersister.php b/src/Cache/Persister/Collection/AbstractCollectionPersister.php index 4eb1895bbca..42d6ec8519c 100644 --- a/src/Cache/Persister/Collection/AbstractCollectionPersister.php +++ b/src/Cache/Persister/Collection/AbstractCollectionPersister.php @@ -25,7 +25,7 @@ use function assert; use function count; -/** @psalm-import-type AssociationMapping from ClassMetadata */ +/** @phpstan-import-type AssociationMapping from ClassMetadata */ abstract class AbstractCollectionPersister implements CachedCollectionPersister { /** @var UnitOfWork */ diff --git a/src/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php b/src/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php index d8d3a95dcb8..0ec977695e2 100644 --- a/src/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php +++ b/src/Cache/Persister/Collection/ReadWriteCachedCollectionPersister.php @@ -13,7 +13,7 @@ use function spl_object_id; -/** @psalm-import-type AssociationMapping from ClassMetadata */ +/** @phpstan-import-type AssociationMapping from ClassMetadata */ class ReadWriteCachedCollectionPersister extends AbstractCollectionPersister { /** @param AssociationMapping $association The association mapping. */ diff --git a/src/Cache/QueryCacheKey.php b/src/Cache/QueryCacheKey.php index e7004f1fc13..2051e572161 100644 --- a/src/Cache/QueryCacheKey.php +++ b/src/Cache/QueryCacheKey.php @@ -24,7 +24,7 @@ class QueryCacheKey extends CacheKey * * @readonly Public only for performance reasons, it should be considered immutable. * @var int - * @psalm-var Cache::MODE_* + * @phpstan-var Cache::MODE_* */ public $cacheMode; @@ -34,7 +34,7 @@ class QueryCacheKey extends CacheKey */ public $timestampKey; - /** @psalm-param Cache::MODE_* $cacheMode */ + /** @phpstan-param Cache::MODE_* $cacheMode */ public function __construct( string $cacheId, int $lifetime = 0, diff --git a/src/Cache/Region/FileLockRegion.php b/src/Cache/Region/FileLockRegion.php index fe50f88998b..8da30325c2b 100644 --- a/src/Cache/Region/FileLockRegion.php +++ b/src/Cache/Region/FileLockRegion.php @@ -43,7 +43,7 @@ class FileLockRegion implements ConcurrentRegion /** @var string */ private $directory; - /** @psalm-var numeric-string */ + /** @phpstan-var numeric-string */ private $lockLifetime; /** diff --git a/src/Configuration.php b/src/Configuration.php index 7e05c461d8f..86b2f08387c 100644 --- a/src/Configuration.php +++ b/src/Configuration.php @@ -70,16 +70,16 @@ class Configuration extends \Doctrine\DBAL\Configuration /** @var mixed[] */ protected $_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; @@ -172,7 +172,7 @@ public function setMetadataDriverImpl(MappingDriver $driverImpl) * * @param string|string[] $paths * @param bool $useSimpleAnnotationReader - * @psalm-param string|list $paths + * @phpstan-param string|list $paths * * @return AnnotationDriver */ @@ -279,7 +279,7 @@ public function getEntityNamespace($entityNamespaceAlias) /** * Sets the entity alias map. * - * @psalm-param array $entityNamespaces + * @phpstan-param array $entityNamespaces * * @return void */ @@ -291,7 +291,7 @@ public function setEntityNamespaces(array $entityNamespaces) /** * Retrieves the list of registered entity namespace aliases. * - * @psalm-return array + * @phpstan-return array */ public function getEntityNamespaces() { @@ -551,7 +551,7 @@ public function addNamedNativeQuery($name, $sql, Query\ResultSetMapping $rsm) * @param string $name The name of the query. * * @return mixed[] - * @psalm-return array{string, ResultSetMapping} A tuple with the first element being the SQL string and the second + * @phpstan-return array{string, ResultSetMapping} A tuple with the first element being the SQL string and the second * element being the ResultSetMapping. * * @throws NamedNativeQueryNotFound @@ -620,7 +620,7 @@ public function ensureProductionSettings() * * @param string $name Function name. * @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 * * @return void */ @@ -635,7 +635,7 @@ public function addCustomStringFunction($name, $className) * @param string $name * * @return string|callable|null - * @psalm-return class-string|callable(string):FunctionNode|null + * @phpstan-return class-string|callable(string):FunctionNode|null */ public function getCustomStringFunction($name) { @@ -652,7 +652,7 @@ public function getCustomStringFunction($name) * * 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. * * @return void @@ -673,7 +673,7 @@ public function setCustomStringFunctions(array $functions) * * @param string $name Function name. * @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 * * @return void */ @@ -725,7 +725,7 @@ public function setCustomNumericFunctions(array $functions) * * @param string $name Function name. * @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 * * @return void */ @@ -757,7 +757,7 @@ public function getCustomDatetimeFunction($name) * 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 * * @return void */ @@ -1038,7 +1038,7 @@ public function getSecondLevelCacheConfiguration() /** * Returns query hints, which will be applied to every query in application * - * @psalm-return array + * @phpstan-return array */ public function getDefaultQueryHints() { @@ -1048,7 +1048,7 @@ public function getDefaultQueryHints() /** * Sets array of query hints, which will be applied to every query in application * - * @psalm-param array $defaultQueryHints + * @phpstan-param array $defaultQueryHints * * @return void */ diff --git a/src/Decorator/EntityManagerDecorator.php b/src/Decorator/EntityManagerDecorator.php index 179d5386dd9..6c37a19c392 100644 --- a/src/Decorator/EntityManagerDecorator.php +++ b/src/Decorator/EntityManagerDecorator.php @@ -52,7 +52,7 @@ public function getExpressionBuilder() * * @param class-string $className * - * @psalm-return EntityRepository + * @phpstan-return EntityRepository * * @template T of object */ diff --git a/src/EntityManager.php b/src/EntityManager.php index 4ca0569956f..d31efee7a70 100644 --- a/src/EntityManager.php +++ b/src/EntityManager.php @@ -424,7 +424,7 @@ public function flush($entity = null) * during the search. * @param int|null $lockVersion The version of the entity to find when using * optimistic locking. - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param LockMode::*|null $lockMode * * @return T|null The entity instance or NULL if the entity can not be found. * @@ -710,7 +710,7 @@ public function remove($entity) * overriding any local changes that have not yet been persisted. * * @param object $entity The entity to refresh - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param LockMode::*|null $lockMode * * @return void * @@ -786,7 +786,7 @@ public function merge($entity) /** * {@inheritDoc} * - * @psalm-return never + * @phpstan-return never */ public function copy($entity, $deep = false) { @@ -983,7 +983,7 @@ public function isUninitializedObject($obj): bool * @param mixed[]|Connection $connection An array with the connection parameters or an existing Connection instance. * @param Configuration $config The Configuration instance to use. * @param EventManager|null $eventManager The EventManager instance to use. - * @psalm-param array|Connection $connection + * @phpstan-param array|Connection $connection * * @return EntityManager The created EntityManager. * @@ -1014,7 +1014,7 @@ public static function create($connection, Configuration $config, ?EventManager * @param mixed[]|Connection $connection An array with the connection parameters or an existing Connection instance. * @param Configuration $config The Configuration instance to use. * @param EventManager|null $eventManager The EventManager instance to use. - * @psalm-param array|Connection $connection + * @phpstan-param array|Connection $connection * * @return Connection * @@ -1081,7 +1081,7 @@ public function hasFilters() } /** - * @psalm-param LockMode::* $lockMode + * @phpstan-param LockMode::* $lockMode * * @throws OptimisticLockException * @throws TransactionRequiredException diff --git a/src/EntityManagerInterface.php b/src/EntityManagerInterface.php index 5155d1a2a06..588075960ae 100644 --- a/src/EntityManagerInterface.php +++ b/src/EntityManagerInterface.php @@ -238,7 +238,7 @@ public function copy($entity, $deep = false); * @param object $entity * @param int $lockMode * @param int|DateTimeInterface|null $lockVersion - * @psalm-param LockMode::* $lockMode + * @phpstan-param LockMode::* $lockMode * * @return void * @@ -284,7 +284,7 @@ public function getUnitOfWork(); * @deprecated * * @param string|int $hydrationMode - * @psalm-param string|AbstractQuery::HYDRATE_* $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_* $hydrationMode * * @return AbstractHydrator */ @@ -294,7 +294,7 @@ public function getHydrator($hydrationMode); * Create a new instance for the given hydration mode. * * @param string|int $hydrationMode - * @psalm-param string|AbstractQuery::HYDRATE_* $hydrationMode + * @phpstan-param string|AbstractQuery::HYDRATE_* $hydrationMode * * @return AbstractHydrator * @@ -336,9 +336,9 @@ public function hasFilters(); * @param string|class-string $className * * @return Mapping\ClassMetadata - * @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($className); } diff --git a/src/EntityRepository.php b/src/EntityRepository.php index b6db64f22d7..f6ab954ebf7 100644 --- a/src/EntityRepository.php +++ b/src/EntityRepository.php @@ -57,14 +57,14 @@ class EntityRepository implements ObjectRepository, Selectable * @internal This property will be private in 3.0, call {@see getClassMetadata()} instead. * * @var ClassMetadata - * @psalm-var ClassMetadata + * @phpstan-var ClassMetadata */ protected $_class; /** @var Inflector|null */ private static $inflector; - /** @psalm-param ClassMetadata $class */ + /** @phpstan-param ClassMetadata $class */ public function __construct(EntityManagerInterface $em, ClassMetadata $class) { $this->_entityName = $class->name; @@ -186,10 +186,10 @@ public function clear() * or NULL if no specific lock mode should be used * during the search. * @param int|null $lockVersion The lock version. - * @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($id, $lockMode = null, $lockVersion = null) { @@ -199,7 +199,7 @@ public function find($id, $lockMode = null, $lockVersion = null) /** * Finds all entities in the repository. * - * @psalm-return list The entities. + * @phpstan-return list The entities. */ public function findAll() { @@ -211,11 +211,11 @@ public function findAll() * * @param int|null $limit * @param int|null $offset - * @psalm-param array $criteria - * @psalm-param array|null $orderBy + * @phpstan-param array $criteria + * @phpstan-param array|null $orderBy * * @return object[] The objects. - * @psalm-return list + * @phpstan-return list */ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { @@ -227,11 +227,11 @@ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $ /** * 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 * * @return object|null The entity instance or NULL if the entity can not be found. - * @psalm-return ?T + * @phpstan-return ?T */ public function findOneBy(array $criteria, ?array $orderBy = null) { @@ -243,7 +243,7 @@ public function findOneBy(array $criteria, ?array $orderBy = null) /** * 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. * @@ -259,7 +259,7 @@ public function count(array $criteria) * * @param string $method * @param mixed[] $arguments - * @psalm-param list $arguments + * @phpstan-param list $arguments * * @return mixed The returned value from the resolved method. * @@ -308,7 +308,7 @@ protected function getEntityManager() /** * @return ClassMetadata - * @psalm-return ClassMetadata + * @phpstan-return ClassMetadata */ protected function getClassMetadata() { @@ -320,7 +320,7 @@ protected function getClassMetadata() * return a new collection containing these elements. * * @return AbstractLazyCollection - * @psalm-return AbstractLazyCollection&Selectable + * @phpstan-return AbstractLazyCollection&Selectable */ public function matching(Criteria $criteria) { @@ -334,7 +334,7 @@ public function matching(Criteria $criteria) * * @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 * * @return mixed * diff --git a/src/Event/ListenersInvoker.php b/src/Event/ListenersInvoker.php index dacf0dcea31..ce7e0e683b1 100644 --- a/src/Event/ListenersInvoker.php +++ b/src/Event/ListenersInvoker.php @@ -43,7 +43,7 @@ public function __construct(EntityManagerInterface $em) * @param string $eventName The entity lifecycle event. * * @return int Bitmask of subscribed event systems. - * @psalm-return int-mask-of + * @phpstan-return int-mask-of */ public function getSubscribedSystems(ClassMetadata $metadata, $eventName) { @@ -72,7 +72,7 @@ public function getSubscribedSystems(ClassMetadata $metadata, $eventName) * @param object $entity The Entity on which the event occurred. * @param EventArgs $event The Event args. * @param int $invoke Bitmask to invoke listeners. - * @psalm-param int-mask-of $invoke + * @phpstan-param int-mask-of $invoke * * @return void */ diff --git a/src/Event/PreUpdateEventArgs.php b/src/Event/PreUpdateEventArgs.php index 153f69cbfb1..4cd239459e2 100644 --- a/src/Event/PreUpdateEventArgs.php +++ b/src/Event/PreUpdateEventArgs.php @@ -24,7 +24,7 @@ class PreUpdateEventArgs extends LifecycleEventArgs /** * @param object $entity * @param mixed[][] $changeSet - * @psalm-param array $changeSet + * @phpstan-param array $changeSet */ public function __construct($entity, EntityManagerInterface $em, array &$changeSet) { @@ -38,7 +38,7 @@ public function __construct($entity, EntityManagerInterface $em, array &$changeS * Retrieves entity changeset. * * @return mixed[][] - * @psalm-return array + * @phpstan-return array */ public function getEntityChangeSet() { diff --git a/src/Internal/CriteriaOrderings.php b/src/Internal/CriteriaOrderings.php index af02ca2b77e..37284b76049 100644 --- a/src/Internal/CriteriaOrderings.php +++ b/src/Internal/CriteriaOrderings.php @@ -16,8 +16,6 @@ trait CriteriaOrderings { /** * @return array - * - * @psalm-suppress DeprecatedMethod We need to call the deprecated API if the new one does not exist yet. */ private static function getCriteriaOrderings(Criteria $criteria): array { diff --git a/src/Internal/Hydration/AbstractHydrator.php b/src/Internal/Hydration/AbstractHydrator.php index d7071cf7f68..acfd69a62d8 100644 --- a/src/Internal/Hydration/AbstractHydrator.php +++ b/src/Internal/Hydration/AbstractHydrator.php @@ -112,7 +112,7 @@ public function __construct(EntityManagerInterface $em) * * @param Result|ResultStatement $stmt * @param ResultSetMapping $resultSetMapping - * @psalm-param array $hints + * @phpstan-param array $hints * * @return IterableResult */ @@ -142,7 +142,7 @@ public function iterate($stmt, $resultSetMapping, array $hints = []) * Initiates a row-by-row hydration. * * @param Result|ResultStatement $stmt - * @psalm-param array $hints + * @phpstan-param array $hints * * @return Generator * @@ -233,7 +233,7 @@ final protected function resultSetMapping(): ResultSetMapping * * @param Result|ResultStatement $stmt * @param ResultSetMapping $resultSetMapping - * @psalm-param array $hints + * @phpstan-param array $hints * * @return mixed[] */ @@ -390,14 +390,14 @@ abstract protected function hydrateAllData(); * 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(&$data) { @@ -533,7 +533,7 @@ protected function gatherScalarRowData(&$data) * @param string $key Column name * * @return mixed[]|null - * @psalm-return array|null + * @phpstan-return array|null */ protected function hydrateColumnInfo($key) { @@ -630,7 +630,7 @@ protected function hydrateColumnInfo($key) /** * @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 6c3a6594cf8..738adc68f44 100644 --- a/src/Internal/Hydration/ObjectHydrator.php +++ b/src/Internal/Hydration/ObjectHydrator.php @@ -219,7 +219,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. * * @return object * @@ -274,7 +274,7 @@ private function getEntity(array $data, string $dqlAlias) /** * @param class-string $className - * @psalm-param array $data + * @phpstan-param array $data * * @return mixed */ diff --git a/src/Mapping/AssociationOverride.php b/src/Mapping/AssociationOverride.php index c4fc48c3435..4697f842299 100644 --- a/src/Mapping/AssociationOverride.php +++ b/src/Mapping/AssociationOverride.php @@ -57,7 +57,7 @@ final class AssociationOverride implements MappingAttribute * The fetching strategy to use for the association. * * @var string|null - * @psalm-var 'LAZY'|'EAGER'|'EXTRA_LAZY'|null + * @phpstan-var 'LAZY'|'EAGER'|'EXTRA_LAZY'|null * @readonly * @Enum({"LAZY", "EAGER", "EXTRA_LAZY"}) */ @@ -66,7 +66,7 @@ final class AssociationOverride implements MappingAttribute /** * @param JoinColumn|array $joinColumns * @param JoinColumn|array $inverseJoinColumns - * @psalm-param 'LAZY'|'EAGER'|'EXTRA_LAZY'|null $fetch + * @phpstan-param 'LAZY'|'EAGER'|'EXTRA_LAZY'|null $fetch */ public function __construct( string $name, diff --git a/src/Mapping/Builder/ClassMetadataBuilder.php b/src/Mapping/Builder/ClassMetadataBuilder.php index 182a106bda3..29675aa22a9 100644 --- a/src/Mapping/Builder/ClassMetadataBuilder.php +++ b/src/Mapping/Builder/ClassMetadataBuilder.php @@ -135,7 +135,7 @@ public function setTable($name) * Adds Index. * * @param string $name - * @psalm-param list $columns + * @phpstan-param list $columns * * @return $this */ @@ -154,7 +154,7 @@ public function addIndex(array $columns, $name) * Adds Unique Constraint. * * @param string $name - * @psalm-param list $columns + * @phpstan-param list $columns * * @return $this */ @@ -301,7 +301,7 @@ public function addLifecycleEvent($methodName, $event) * * @param string $name * @param string $type - * @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 daf323bc36d..0ddfc2399ad 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 76f0fca0571..635982f75aa 100644 --- a/src/Mapping/Cache.php +++ b/src/Mapping/Cache.php @@ -22,14 +22,14 @@ final class Cache implements MappingAttribute * * @Enum({"READ_ONLY", "NONSTRICT_READ_WRITE", "READ_WRITE"}) * @var string - * @psalm-var 'READ_ONLY'|'NONSTRICT_READ_WRITE'|'READ_WRITE' + * @phpstan-var 'READ_ONLY'|'NONSTRICT_READ_WRITE'|'READ_WRITE' */ public $usage = 'READ_ONLY'; /** @var string|null Cache region name. */ public $region; - /** @psalm-param 'READ_ONLY'|'NONSTRICT_READ_WRITE'|'READ_WRITE' $usage */ + /** @phpstan-param 'READ_ONLY'|'NONSTRICT_READ_WRITE'|'READ_WRITE' $usage */ public function __construct(string $usage = 'READ_ONLY', ?string $region = null) { $this->usage = $usage; diff --git a/src/Mapping/ChangeTrackingPolicy.php b/src/Mapping/ChangeTrackingPolicy.php index 854a82f4e6f..271023a6752 100644 --- a/src/Mapping/ChangeTrackingPolicy.php +++ b/src/Mapping/ChangeTrackingPolicy.php @@ -19,13 +19,13 @@ final class ChangeTrackingPolicy implements MappingAttribute * The change tracking policy. * * @var string - * @psalm-var 'DEFERRED_IMPLICIT'|'DEFERRED_EXPLICIT'|'NOTIFY' + * @phpstan-var 'DEFERRED_IMPLICIT'|'DEFERRED_EXPLICIT'|'NOTIFY' * @readonly * @Enum({"DEFERRED_IMPLICIT", "DEFERRED_EXPLICIT", "NOTIFY"}) */ public $value; - /** @psalm-param 'DEFERRED_IMPLICIT'|'DEFERRED_EXPLICIT'|'NOTIFY' $value */ + /** @phpstan-param 'DEFERRED_IMPLICIT'|'DEFERRED_EXPLICIT'|'NOTIFY' $value */ public function __construct(string $value) { $this->value = $value; diff --git a/src/Mapping/ClassMetadata.php b/src/Mapping/ClassMetadata.php index 1de8dad5f9f..cfb6a2f5165 100644 --- a/src/Mapping/ClassMetadata.php +++ b/src/Mapping/ClassMetadata.php @@ -12,7 +12,7 @@ * @todo remove or rename ClassMetadataInfo to ClassMetadata * @template-covariant T of object * @template-extends ClassMetadataInfo - * @psalm-type FieldMapping = array{ + * @phpstan-type FieldMapping = array{ * type: string, * fieldName: string, * columnName: string, @@ -38,7 +38,7 @@ * version?: string, * default?: string|int, * } - * @psalm-type JoinColumnData = array{ + * @phpstan-type JoinColumnData = array{ * name: string, * referencedColumnName: string, * unique?: bool, @@ -48,7 +48,7 @@ * columnDefinition?: string, * nullable?: bool, * } - * @psalm-type AssociationMapping = array{ + * @phpstan-type AssociationMapping = array{ * cache?: array, * cascade: array, * declared?: class-string, @@ -83,7 +83,7 @@ * type: int, * unique?: bool, * } - * @psalm-type DiscriminatorColumnMapping = array{ + * @phpstan-type DiscriminatorColumnMapping = array{ * name: string, * fieldName: string, * type: string, @@ -92,7 +92,7 @@ * enumType?: class-string|null, * options?: array, * } - * @psalm-type EmbeddedClassMapping = array{ + * @phpstan-type EmbeddedClassMapping = array{ * class: class-string, * columnPrefix: string|null, * declaredField: string|null, @@ -109,7 +109,7 @@ class ClassMetadata extends ClassMetadataInfo * @see https://github.com/doctrine/orm/issues/8709 * * @param string $entityName The name of the entity class the new instance is used for. - * @psalm-param class-string $entityName + * @phpstan-param class-string $entityName */ public function __construct($entityName, ?NamingStrategy $namingStrategy = null, ?TypedFieldMapper $typedFieldMapper = null) { diff --git a/src/Mapping/ClassMetadataFactory.php b/src/Mapping/ClassMetadataFactory.php index d739fc7b227..4e48d82b75b 100644 --- a/src/Mapping/ClassMetadataFactory.php +++ b/src/Mapping/ClassMetadataFactory.php @@ -52,9 +52,9 @@ * to a relational database. * * @extends AbstractClassMetadataFactory - * @psalm-import-type AssociationMapping from ClassMetadata - * @psalm-import-type EmbeddedClassMapping from ClassMetadata - * @psalm-import-type FieldMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type EmbeddedClassMapping from ClassMetadata + * @phpstan-import-type FieldMapping from ClassMetadata */ class ClassMetadataFactory extends AbstractClassMetadataFactory { @@ -639,7 +639,7 @@ private function completeIdGeneratorMapping(ClassMetadataInfo $class): void $platform = $this->getTargetPlatform(); // Platforms that do not have native IDENTITY support need a sequence to emulate this behaviour. - /** @psalm-suppress UndefinedClass, InvalidClass */ // @phpstan-ignore method.deprecated + // @phpstan-ignore method.deprecated if (! $platform instanceof MySQLPlatform && ! $platform instanceof SqlitePlatform && ! $platform instanceof SQLServerPlatform && $platform->usesSequenceEmulatedIdentityColumns()) { Deprecation::trigger( 'doctrine/orm', @@ -744,7 +744,7 @@ private function completeIdGeneratorMapping(ClassMetadataInfo $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/ClassMetadataInfo.php b/src/Mapping/ClassMetadataInfo.php index cb17b8983d4..335d9e9ca2e 100644 --- a/src/Mapping/ClassMetadataInfo.php +++ b/src/Mapping/ClassMetadataInfo.php @@ -68,11 +68,11 @@ * * @template-covariant T of object * @template-implements ClassMetadata - * @psalm-import-type AssociationMapping from \Doctrine\ORM\Mapping\ClassMetadata - * @psalm-import-type FieldMapping from \Doctrine\ORM\Mapping\ClassMetadata - * @psalm-import-type EmbeddedClassMapping from \Doctrine\ORM\Mapping\ClassMetadata - * @psalm-import-type JoinColumnData from \Doctrine\ORM\Mapping\ClassMetadata - * @psalm-import-type DiscriminatorColumnMapping from \Doctrine\ORM\Mapping\ClassMetadata + * @phpstan-import-type AssociationMapping from \Doctrine\ORM\Mapping\ClassMetadata + * @phpstan-import-type FieldMapping from \Doctrine\ORM\Mapping\ClassMetadata + * @phpstan-import-type EmbeddedClassMapping from \Doctrine\ORM\Mapping\ClassMetadata + * @phpstan-import-type JoinColumnData from \Doctrine\ORM\Mapping\ClassMetadata + * @phpstan-import-type DiscriminatorColumnMapping from \Doctrine\ORM\Mapping\ClassMetadata */ class ClassMetadataInfo implements ClassMetadata { @@ -370,14 +370,14 @@ class ClassMetadataInfo implements ClassMetadata * declared in another parent entity or mapped superclass. The value is the FQCN * of the topmost non-transient class that contains mapping information for this field. * - * @psalm-var array + * @phpstan-var array */ public $embeddedClasses = []; /** * READ-ONLY: The named queries allowed to be called directly from Repository. * - * @psalm-var array> + * @phpstan-var array> */ public $namedQueries = []; @@ -394,7 +394,7 @@ class ClassMetadataInfo implements ClassMetadata * ) * * - * @psalm-var array> + * @phpstan-var array> */ public $namedNativeQueries = []; @@ -410,7 +410,7 @@ class ClassMetadataInfo implements ClassMetadata * ) * * - * @psalm-var array + * @phpstan-var list */ public $identifier = []; @@ -430,7 +430,7 @@ class ClassMetadataInfo implements ClassMetadata * READ-ONLY: The inheritance mapping type used by the class. * * @var int - * @psalm-var self::INHERITANCE_TYPE_* + * @phpstan-var self::INHERITANCE_TYPE_* */ public $inheritanceType = self::INHERITANCE_TYPE_NONE; @@ -438,7 +438,7 @@ class ClassMetadataInfo implements ClassMetadata * READ-ONLY: The Id generator type used by the class. * * @var int - * @psalm-var self::GENERATOR_TYPE_* + * @phpstan-var self::GENERATOR_TYPE_* */ public $generatorType = self::GENERATOR_TYPE_NONE; @@ -502,7 +502,7 @@ class ClassMetadataInfo implements ClassMetadata * of the topmost non-transient class that contains mapping information for this field. * * @var mixed[] - * @psalm-var array + * @phpstan-var array */ public $fieldMappings = []; @@ -510,7 +510,7 @@ class ClassMetadataInfo implements ClassMetadata * 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 $fieldNames = []; @@ -554,7 +554,7 @@ class ClassMetadataInfo implements ClassMetadata * inheritance mappings. * * @var array - * @psalm-var DiscriminatorColumnMapping|null + * @phpstan-var DiscriminatorColumnMapping|null */ public $discriminatorColumn; @@ -568,7 +568,7 @@ class ClassMetadataInfo implements ClassMetadata * uniqueConstraints => array * * @var mixed[] - * @psalm-var array{ + * @phpstan-var array{ * name: string, * schema?: string, * indexes?: array, @@ -582,14 +582,14 @@ class ClassMetadataInfo implements ClassMetadata /** * READ-ONLY: The registered lifecycle callbacks for entities of this class. * - * @psalm-var array> + * @phpstan-var array> */ public $lifecycleCallbacks = []; /** * READ-ONLY: The registered entity listeners. * - * @psalm-var array> + * @phpstan-var array> */ public $entityListeners = []; @@ -665,7 +665,7 @@ class ClassMetadataInfo implements ClassMetadata * ) * * - * @psalm-var array + * @phpstan-var array */ public $associationMappings = []; @@ -716,7 +716,7 @@ class ClassMetadataInfo implements ClassMetadata * * * @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 $sequenceGeneratorDefinition; @@ -821,7 +821,7 @@ public function __construct($entityName, ?NamingStrategy $namingStrategy = null, * Gets the ReflectionProperties of the mapped class. * * @return ReflectionProperty[]|null[] An array of ReflectionProperty instances. - * @psalm-return array + * @phpstan-return array */ public function getReflectionProperties() { @@ -896,7 +896,7 @@ public function getIdentifierValues($entity) * Populates the entity identifier of an entity. * * @param object $entity - * @psalm-param array $id + * @phpstan-param array $id * * @return void * @@ -1248,7 +1248,7 @@ public function getReflectionClass() } /** - * @psalm-param array{usage?: mixed, region?: mixed} $cache + * @phpstan-param array{usage?: mixed, region?: mixed} $cache * * @return void */ @@ -1267,7 +1267,7 @@ public function enableCache(array $cache) /** * @param string $fieldName - * @psalm-param array{usage?: int, region?: string} $cache + * @phpstan-param array{usage?: int, region?: string} $cache * * @return void */ @@ -1279,10 +1279,10 @@ public function enableAssociationCache($fieldName, array $cache) /** * @param string $fieldName * @param array $cache - * @psalm-param array{usage?: int|null, region?: string|null} $cache + * @phpstan-param array{usage?: int|null, 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($fieldName, array $cache) { @@ -1410,7 +1410,7 @@ public function getColumnName($fieldName) * @param string $fieldName The field name. * * @return mixed[] The field mapping. - * @psalm-return FieldMapping + * @phpstan-return FieldMapping * * @throws MappingException */ @@ -1432,7 +1432,7 @@ public function getFieldMapping($fieldName) * the object model. * * @return mixed[] The mapping. - * @psalm-return AssociationMapping + * @phpstan-return AssociationMapping * * @throws MappingException */ @@ -1448,7 +1448,7 @@ public function getAssociationMapping($fieldName) /** * Gets all association mappings of the class. * - * @psalm-return array + * @phpstan-return array */ public function getAssociationMappings() { @@ -1492,7 +1492,7 @@ public function getNamedQuery($queryName) * Gets all named queries of the class. * * @return mixed[][] - * @psalm-return array> + * @phpstan-return array> */ public function getNamedQueries() { @@ -1507,7 +1507,7 @@ public function getNamedQueries() * @param string $queryName The query name. * * @return mixed[] - * @psalm-return array + * @phpstan-return array * * @throws MappingException */ @@ -1523,7 +1523,7 @@ public function getNamedNativeQuery($queryName) /** * Gets all named native queries of the class. * - * @psalm-return array> + * @phpstan-return array> */ public function getNamedNativeQueries() { @@ -1538,7 +1538,7 @@ public function getNamedNativeQueries() * @param string $name The result set mapping name. * * @return mixed[] - * @psalm-return array{name: string, entities: array, columns: array} + * @phpstan-return array{name: string, entities: array, columns: array} * * @throws MappingException */ @@ -1555,7 +1555,7 @@ public function getSqlResultSetMapping($name) * Gets all sql result set mappings of the class. * * @return mixed[] - * @psalm-return array + * @phpstan-return array */ public function getSqlResultSetMappings() { @@ -1616,7 +1616,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, @@ -1719,10 +1719,10 @@ protected function validateAndCompleteFieldMapping(array $mapping): array * 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 mixed[] The updated mapping. - * @psalm-return AssociationMapping + * @phpstan-return AssociationMapping * * @throws MappingException If something is wrong with the mapping. */ @@ -1849,10 +1849,10 @@ protected function _validateAndCompleteAssociationMapping(array $mapping) /** * Validates & completes a one-to-one association mapping. * - * @psalm-param array $mapping The mapping to validate & complete. + * @phpstan-param array $mapping The mapping to validate & complete. * * @return mixed[] The validated & completed mapping. - * @psalm-return AssociationMapping + * @phpstan-return AssociationMapping * * @throws RuntimeException * @throws MappingException @@ -1947,10 +1947,10 @@ protected function _validateAndCompleteOneToOneMapping(array $mapping) /** * Validates & completes a one-to-many association mapping. * - * @psalm-param array $mapping The mapping to validate and complete. + * @phpstan-param array $mapping The mapping to validate and complete. * * @return mixed[] The validated and completed mapping. - * @psalm-return AssociationMapping + * @phpstan-return AssociationMapping * * @throws MappingException * @throws InvalidArgumentException @@ -1975,10 +1975,10 @@ protected function _validateAndCompleteOneToManyMapping(array $mapping) /** * Validates & completes a many-to-many association mapping. * - * @psalm-param array $mapping The mapping to validate & complete. + * @phpstan-param array $mapping The mapping to validate & complete. * * @return mixed[] The validated & completed mapping. - * @psalm-return AssociationMapping + * @phpstan-return AssociationMapping * * @throws InvalidArgumentException */ @@ -2126,7 +2126,7 @@ public function getSingleIdentifierColumnName() * 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 * * @return void */ @@ -2155,10 +2155,10 @@ public function hasField($fieldName) /** * 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 $fieldNames = null) { @@ -2172,7 +2172,7 @@ public function getColumnNames(?array $fieldNames = null) /** * Returns an array with all the identifier column names. * - * @psalm-return list + * @phpstan-return list */ public function getIdentifierColumnNames() { @@ -2201,7 +2201,7 @@ public function getIdentifierColumnNames() * Sets the type of Id generator to use for the mapped class. * * @param int $generatorType - * @psalm-param self::GENERATOR_TYPE_* $generatorType + * @phpstan-param self::GENERATOR_TYPE_* $generatorType * * @return void */ @@ -2282,7 +2282,7 @@ public function isIdGeneratorIdentity() * * @return bool TRUE if the class uses the SEQUENCE generator, FALSE otherwise. * - * @psalm-assert-if-true !null $this->sequenceGeneratorDefinition + * @phpstan-assert-if-true !null $this->sequenceGeneratorDefinition */ public function isIdGeneratorSequence() { @@ -2403,7 +2403,7 @@ public function getTemporaryIdTableName() /** * 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. * * @return void */ @@ -2437,7 +2437,7 @@ public function setParentClasses(array $classNames) * Sets the inheritance type used by the class and its subclasses. * * @param int $type - * @psalm-param self::INHERITANCE_TYPE_* $type + * @phpstan-param self::INHERITANCE_TYPE_* $type * * @return void * @@ -2456,7 +2456,7 @@ public function setInheritanceType($type) * Sets the association to override association mapping of property for an entity relationship. * * @param string $fieldName - * @psalm-param array $overrideMapping + * @phpstan-param array $overrideMapping * * @return void * @@ -2525,7 +2525,7 @@ public function setAssociationOverride($fieldName, array $overrideMapping) * Sets the override for a mapped field. * * @param string $fieldName - * @psalm-param array $overrideMapping + * @phpstan-param array $overrideMapping * * @return void * @@ -2649,7 +2649,7 @@ public function setTableName($tableName) * * If a key is omitted, the current value is kept. * - * @psalm-param array $table The table description. + * @phpstan-param array $table The table description. * * @return void */ @@ -2716,7 +2716,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. * * @return void * @@ -2739,7 +2739,7 @@ public function mapField(array $mapping) * Adds an association mapping without completing/validating it. * This is mainly used to add inherited association mappings to derived classes. * - * @psalm-param AssociationMapping $mapping + * @phpstan-param AssociationMapping $mapping * * @return void * @@ -2759,7 +2759,7 @@ public function addInheritedAssociationMapping(array $mapping/*, $owningClassNam * Adds a field mapping without completing/validating it. * This is mainly used to add inherited field mappings to derived classes. * - * @psalm-param FieldMapping $fieldMapping + * @phpstan-param FieldMapping $fieldMapping * * @return void */ @@ -2781,7 +2781,7 @@ public function addInheritedFieldMapping(array $fieldMapping) * * @deprecated * - * @psalm-param array $queryMapping + * @phpstan-param array $queryMapping * * @return void * @@ -2826,7 +2826,7 @@ public function addNamedQuery(array $queryMapping) * * @deprecated * - * @psalm-param array $queryMapping + * @phpstan-param array $queryMapping * * @return void * @@ -2877,7 +2877,7 @@ public function addNamedNativeQuery(array $queryMapping) * INTERNAL: * Adds a sql result set mapping to this class. * - * @psalm-param array $resultMapping + * @phpstan-param array $resultMapping * * @return void * @@ -2951,7 +2951,7 @@ public function mapOneToOne(array $mapping) /** * Adds a one-to-many mapping. * - * @psalm-param array $mapping The mapping. + * @phpstan-param array $mapping The mapping. * * @return void */ @@ -2967,7 +2967,7 @@ public function mapOneToMany(array $mapping) /** * Adds a many-to-one mapping. * - * @psalm-param array $mapping The mapping. + * @phpstan-param array $mapping The mapping. * * @return void */ @@ -2984,7 +2984,7 @@ public function mapManyToOne(array $mapping) /** * Adds a many-to-many mapping. * - * @psalm-param array $mapping The mapping. + * @phpstan-param array $mapping The mapping. * * @return void */ @@ -3000,7 +3000,7 @@ public function mapManyToMany(array $mapping) /** * Stores the association mapping. * - * @psalm-param AssociationMapping $assocMapping + * @phpstan-param AssociationMapping $assocMapping * * @return void * @@ -3063,7 +3063,7 @@ public function hasLifecycleCallbacks($lifecycleEvent) * @param string $event * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function getLifecycleCallbacks($event) { @@ -3101,7 +3101,7 @@ public function addLifecycleCallback($callback, $event) * Sets the lifecycle callbacks for entities of this class. * Any previously registered callbacks are overwritten. * - * @psalm-param array> $callbacks + * @phpstan-param array> $callbacks * * @return void */ @@ -3151,7 +3151,7 @@ public function addEntityListener($eventName, $class, $method) * @see getDiscriminatorColumn() * * @param mixed[]|null $columnDef - * @psalm-param array{name: string|null, fieldName?: string, type?: string, length?: int, columnDefinition?: string|null, enumType?: class-string|null, options?: array}|null $columnDef + * @phpstan-param array{name: string|null, fieldName?: string, type?: string, length?: int, columnDefinition?: string|null, enumType?: class-string|null, options?: array}|null $columnDef * * @return void * @@ -3186,7 +3186,7 @@ public function setDiscriminatorColumn($columnDef) /** * @return array - * @psalm-return DiscriminatorColumnMapping + * @phpstan-return DiscriminatorColumnMapping */ final public function getDiscriminatorColumn(): array { @@ -3415,7 +3415,7 @@ public function setIdGenerator($generator) /** * Sets definition. * - * @psalm-param array $definition + * @phpstan-param array $definition * * @return void */ @@ -3437,7 +3437,7 @@ public function setCustomGeneratorDefinition(array $definition) * ) * * - * @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 * * @return void * @@ -3472,7 +3472,7 @@ public function setSequenceGeneratorDefinition(array $definition) * 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. * * @return void * @@ -3584,7 +3584,7 @@ public function getName() * @param AbstractPlatform $platform * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function getQuotedIdentifierColumnNames($platform) { @@ -3698,7 +3698,7 @@ public function getAssociationMappedByTargetField($fieldName) * @param string $targetClass * * @return mixed[][] - * @psalm-return array> + * @phpstan-return array> */ public function getAssociationsByTargetClass($targetClass) { @@ -3748,7 +3748,7 @@ public function getMetadataValue($name) /** * Map Embedded Class * - * @psalm-param array $mapping + * @phpstan-param array $mapping * * @return void * @@ -3867,7 +3867,7 @@ public function getSequencePrefix(AbstractPlatform $platform) return $sequencePrefix; } - /** @psalm-param AssociationMapping $mapping */ + /** @phpstan-param AssociationMapping $mapping */ private function assertMappingOrderBy(array $mapping): void { if (isset($mapping['orderBy']) && ! is_array($mapping['orderBy'])) { diff --git a/src/Mapping/Column.php b/src/Mapping/Column.php index 8e967f0e284..9d38d5ac043 100644 --- a/src/Mapping/Column.php +++ b/src/Mapping/Column.php @@ -95,7 +95,7 @@ final class Column implements MappingAttribute /** * @var string|null * @readonly - * @psalm-var 'NEVER'|'INSERT'|'ALWAYS'|null + * @phpstan-var 'NEVER'|'INSERT'|'ALWAYS'|null * @Enum({"NEVER", "INSERT", "ALWAYS"}) */ public $generated; @@ -103,7 +103,7 @@ final class Column implements MappingAttribute /** * @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( ?string $name = null, diff --git a/src/Mapping/DefaultTypedFieldMapper.php b/src/Mapping/DefaultTypedFieldMapper.php index db7737f58e4..ae10ae106b8 100644 --- a/src/Mapping/DefaultTypedFieldMapper.php +++ b/src/Mapping/DefaultTypedFieldMapper.php @@ -21,7 +21,7 @@ use const PHP_VERSION_ID; -/** @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/Driver/AnnotationDriver.php b/src/Mapping/Driver/AnnotationDriver.php index 26e9130be72..07c50692815 100644 --- a/src/Mapping/Driver/AnnotationDriver.php +++ b/src/Mapping/Driver/AnnotationDriver.php @@ -671,7 +671,7 @@ private function loadRelationShipMapping( * * @param class-string $className * - * @psalm-return ClassMetadata::FETCH_* The fetch mode as defined in ClassMetadata. + * @phpstan-return ClassMetadata::FETCH_* The fetch mode as defined in ClassMetadata. * * @throws MappingException If the fetch mode is not valid. */ @@ -687,7 +687,7 @@ private function getFetchMode(string $className, string $fetchMode): int /** * Attempts to resolve the generated mode. * - * @psalm-return ClassMetadata::GENERATED_* + * @phpstan-return ClassMetadata::GENERATED_* * * @throws MappingException If the fetch mode is not valid. */ @@ -704,7 +704,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 { @@ -752,7 +752,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, @@ -784,7 +784,7 @@ private function joinColumnToArray(Mapping\JoinColumn $joinColumn): array * 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/AttributeDriver.php b/src/Mapping/Driver/AttributeDriver.php index e747eab146a..da494b489a3 100644 --- a/src/Mapping/Driver/AttributeDriver.php +++ b/src/Mapping/Driver/AttributeDriver.php @@ -634,7 +634,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 { @@ -684,7 +684,7 @@ private function getMethodCallbacks(ReflectionMethod $method): array * @param Mapping\JoinColumn|Mapping\InverseJoinColumn $joinColumn * * @return mixed[] - * @psalm-return array{ + * @phpstan-return array{ * name: string|null, * unique: bool, * nullable: bool, @@ -716,7 +716,7 @@ private function joinColumnToArray($joinColumn): array * 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 cc344bd0970..94b96663dff 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 Annotation */ diff --git a/src/Mapping/Driver/DatabaseDriver.php b/src/Mapping/Driver/DatabaseDriver.php index 70f4dd1a156..b2ce8f13f89 100644 --- a/src/Mapping/Driver/DatabaseDriver.php +++ b/src/Mapping/Driver/DatabaseDriver.php @@ -69,7 +69,7 @@ class DatabaseDriver implements MappingDriver /** @var array */ private $classToTableNames = []; - /** @psalm-var array */ + /** @phpstan-var array */ private $manyToManyTables = []; /** @var mixed[] */ @@ -156,8 +156,8 @@ public function setFieldNameForColumn($tableName, $columnName, $fieldName) * * @param Table[] $entityTables * @param Table[] $manyToManyTables - * @psalm-param list $entityTables - * @psalm-param list
$manyToManyTables + * @phpstan-param list
$entityTables + * @phpstan-param list
$manyToManyTables * * @return void */ @@ -400,7 +400,7 @@ private function buildFieldMappings(ClassMetadataInfo $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 8a607676e2d..da475724049 100644 --- a/src/Mapping/Driver/XmlDriver.php +++ b/src/Mapping/Driver/XmlDriver.php @@ -488,7 +488,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 @@ -618,7 +617,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 @@ -746,7 +744,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 $options): array { @@ -781,7 +779,7 @@ private function parseOptions(?SimpleXMLElement $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, @@ -825,7 +823,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, @@ -911,7 +909,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 { @@ -938,7 +936,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/Driver/YamlDriver.php b/src/Mapping/Driver/YamlDriver.php index 97aacb2d1c5..8757f79c0c6 100644 --- a/src/Mapping/Driver/YamlDriver.php +++ b/src/Mapping/Driver/YamlDriver.php @@ -738,7 +738,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad * Constructs a joinColumn mapping array based on the information * found in the given join column element. * - * @psalm-param array{ + * @phpstan-param array{ * referencedColumnName?: mixed, * name?: mixed, * fieldName?: mixed, @@ -749,7 +749,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad * } $joinColumnElement The array join column element. * * @return mixed[] The mapping array. - * @psalm-return array{ + * @phpstan-return array{ * referencedColumnName?: string, * name?: string, * fieldName?: string, @@ -796,7 +796,7 @@ private function joinColumnToArray(array $joinColumnElement): array /** * Parses the given column as array. * - * @psalm-param array{ + * @phpstan-param array{ * type?: string, * column?: string, * precision?: mixed, @@ -813,7 +813,7 @@ private function joinColumnToArray(array $joinColumnElement): array * }|null $column * * @return mixed[] - * @psalm-return array{ + * @phpstan-return array{ * fieldName: string, * type?: string, * columnName?: string, @@ -905,10 +905,10 @@ private function columnToArray(string $fieldName, ?array $column): array * Parse / Normalize the cache configuration * * @param mixed[] $cacheMapping - * @psalm-param array{usage: string|null, region?: mixed} $cacheMapping + * @phpstan-param array{usage: string|null, region?: mixed} $cacheMapping * * @return mixed[] - * @psalm-return array{usage: int|null, region: string|null} + * @phpstan-return array{usage: int|null, region: string|null} */ private function cacheToArray(array $cacheMapping): array { diff --git a/src/Mapping/Entity.php b/src/Mapping/Entity.php index 8f3617a4278..bf39472d723 100644 --- a/src/Mapping/Entity.php +++ b/src/Mapping/Entity.php @@ -29,7 +29,7 @@ final class Entity implements MappingAttribute */ public $readOnly = false; - /** @psalm-param class-string>|null $repositoryClass */ + /** @phpstan-param class-string>|null $repositoryClass */ public function __construct(?string $repositoryClass = null, bool $readOnly = false) { $this->repositoryClass = $repositoryClass; diff --git a/src/Mapping/GeneratedValue.php b/src/Mapping/GeneratedValue.php index a8d9f1dbf0c..9091ab72105 100644 --- a/src/Mapping/GeneratedValue.php +++ b/src/Mapping/GeneratedValue.php @@ -19,13 +19,13 @@ final class GeneratedValue implements MappingAttribute * The type of ID generator. * * @var string - * @psalm-var 'AUTO'|'SEQUENCE'|'IDENTITY'|'NONE'|'CUSTOM' + * @phpstan-var 'AUTO'|'SEQUENCE'|'IDENTITY'|'NONE'|'CUSTOM' * @readonly * @Enum({"AUTO", "SEQUENCE", "TABLE", "IDENTITY", "NONE", "UUID", "CUSTOM"}) */ public $strategy = 'AUTO'; - /** @psalm-param 'AUTO'|'SEQUENCE'|'IDENTITY'|'NONE'|'CUSTOM' $strategy */ + /** @phpstan-param 'AUTO'|'SEQUENCE'|'IDENTITY'|'NONE'|'CUSTOM' $strategy */ public function __construct(string $strategy = 'AUTO') { $this->strategy = $strategy; diff --git a/src/Mapping/InheritanceType.php b/src/Mapping/InheritanceType.php index 87074ecf99b..0c4c8ee8431 100644 --- a/src/Mapping/InheritanceType.php +++ b/src/Mapping/InheritanceType.php @@ -20,13 +20,13 @@ final class InheritanceType implements MappingAttribute * The inheritance type used by the class and its subclasses. * * @var string - * @psalm-var 'NONE'|'JOINED'|'SINGLE_TABLE'|'TABLE_PER_CLASS' + * @phpstan-var 'NONE'|'JOINED'|'SINGLE_TABLE'|'TABLE_PER_CLASS' * @readonly * @Enum({"NONE", "JOINED", "SINGLE_TABLE", "TABLE_PER_CLASS"}) */ public $value; - /** @psalm-param 'NONE'|'JOINED'|'SINGLE_TABLE'|'TABLE_PER_CLASS' $value */ + /** @phpstan-param 'NONE'|'JOINED'|'SINGLE_TABLE'|'TABLE_PER_CLASS' $value */ public function __construct(string $value) { if ($value === 'TABLE_PER_CLASS') { diff --git a/src/Mapping/ManyToMany.php b/src/Mapping/ManyToMany.php index c0f5638cd7f..851e7f89dc0 100644 --- a/src/Mapping/ManyToMany.php +++ b/src/Mapping/ManyToMany.php @@ -44,7 +44,7 @@ final class ManyToMany implements MappingAttribute * The fetching strategy to use for the association. * * @var string - * @psalm-var 'LAZY'|'EAGER'|'EXTRA_LAZY' + * @phpstan-var 'LAZY'|'EAGER'|'EXTRA_LAZY' * @readonly * @Enum({"LAZY", "EAGER", "EXTRA_LAZY"}) */ @@ -65,7 +65,7 @@ final class ManyToMany 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( ?string $targetEntity = null, diff --git a/src/Mapping/ManyToOne.php b/src/Mapping/ManyToOne.php index 3bf155b41c1..1ae62642e4a 100644 --- a/src/Mapping/ManyToOne.php +++ b/src/Mapping/ManyToOne.php @@ -31,7 +31,7 @@ final class ManyToOne implements MappingAttribute * The fetching strategy to use for the association. * * @var string - * @psalm-var 'LAZY'|'EAGER'|'EXTRA_LAZY' + * @phpstan-var 'LAZY'|'EAGER'|'EXTRA_LAZY' * @readonly * @Enum({"LAZY", "EAGER", "EXTRA_LAZY"}) */ @@ -46,7 +46,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( ?string $targetEntity = null, diff --git a/src/Mapping/OneToMany.php b/src/Mapping/OneToMany.php index c3ffa16da27..98ac4c3d7cb 100644 --- a/src/Mapping/OneToMany.php +++ b/src/Mapping/OneToMany.php @@ -37,7 +37,7 @@ final class OneToMany implements MappingAttribute * The fetching strategy to use for the association. * * @var string - * @psalm-var 'LAZY'|'EAGER'|'EXTRA_LAZY' + * @phpstan-var 'LAZY'|'EAGER'|'EXTRA_LAZY' * @readonly * @Enum({"LAZY", "EAGER", "EXTRA_LAZY"}) */ @@ -58,7 +58,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( ?string $mappedBy = null, diff --git a/src/Mapping/OneToOne.php b/src/Mapping/OneToOne.php index 075be0efda2..6318ae53c32 100644 --- a/src/Mapping/OneToOne.php +++ b/src/Mapping/OneToOne.php @@ -43,7 +43,7 @@ final class OneToOne implements MappingAttribute * The fetching strategy to use for the association. * * @var string - * @psalm-var 'LAZY'|'EAGER'|'EXTRA_LAZY' + * @phpstan-var 'LAZY'|'EAGER'|'EXTRA_LAZY' * @readonly * @Enum({"LAZY", "EAGER", "EXTRA_LAZY"}) */ @@ -58,7 +58,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( ?string $mappedBy = null, diff --git a/src/Mapping/QuoteStrategy.php b/src/Mapping/QuoteStrategy.php index b3c8a88f6b9..3fe20709bef 100644 --- a/src/Mapping/QuoteStrategy.php +++ b/src/Mapping/QuoteStrategy.php @@ -9,8 +9,8 @@ /** * A set of rules for determining the column, alias and table quotes. * - * @psalm-import-type AssociationMapping from ClassMetadata - * @psalm-import-type JoinColumnData from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type JoinColumnData from ClassMetadata */ interface QuoteStrategy { @@ -69,7 +69,7 @@ public function getReferencedJoinColumnName(array $joinColumn, ClassMetadata $cl /** * 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); diff --git a/src/Mapping/Reflection/ReflectionPropertiesGetter.php b/src/Mapping/Reflection/ReflectionPropertiesGetter.php index d787030637b..886c7c77478 100644 --- a/src/Mapping/Reflection/ReflectionPropertiesGetter.php +++ b/src/Mapping/Reflection/ReflectionPropertiesGetter.php @@ -59,7 +59,7 @@ public function getProperties($className): array * @param class-string $className * * @return ReflectionClass[] - * @psalm-return list> + * @phpstan-return list> */ private function getHierarchyClasses(string $className): array { @@ -83,7 +83,7 @@ private function getHierarchyClasses(string $className): array /** * @return ReflectionProperty[] - * @psalm-return array + * @phpstan-return array */ private function getClassProperties(ReflectionClass $reflectionClass): array { diff --git a/src/Mapping/UnderscoreNamingStrategy.php b/src/Mapping/UnderscoreNamingStrategy.php index e1c7b13fcfd..c463597c3a9 100644 --- a/src/Mapping/UnderscoreNamingStrategy.php +++ b/src/Mapping/UnderscoreNamingStrategy.php @@ -32,7 +32,7 @@ class UnderscoreNamingStrategy implements NamingStrategy /** * @var string - * @psalm-var non-empty-string + * @phpstan-var non-empty-string */ private $pattern; diff --git a/src/ORMInvalidArgumentException.php b/src/ORMInvalidArgumentException.php index 97ba4384c76..2181d207c28 100644 --- a/src/ORMInvalidArgumentException.php +++ b/src/ORMInvalidArgumentException.php @@ -24,7 +24,7 @@ /** * Contains exception messages for all invalid lifecycle state exceptions inside UnitOfWork * - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ class ORMInvalidArgumentException extends InvalidArgumentException { @@ -83,7 +83,7 @@ public static function readOnlyRequiresManagedEntity($entity) } /** - * @psalm-param non-empty-list $newEntitiesWithAssociations non-empty an array + * @phpstan-param non-empty-list $newEntitiesWithAssociations non-empty an array * of [array $associationMapping, object $entity] pairs * * @return ORMInvalidArgumentException @@ -112,7 +112,7 @@ static function (array $newEntityWithAssociation): string { /** * @param object $entry - * @psalm-param AssociationMapping $associationMapping + * @phpstan-param AssociationMapping $associationMapping * * @return ORMInvalidArgumentException */ @@ -123,7 +123,7 @@ public static function newEntityFoundThroughRelationship(array $associationMappi /** * @param object $entry - * @psalm-param AssociationMapping $assoc + * @phpstan-param AssociationMapping $assoc * * @return ORMInvalidArgumentException */ @@ -300,7 +300,7 @@ private static function objToStr($obj): string /** * @param object $entity - * @psalm-param AssociationMapping $associationMapping + * @phpstan-param AssociationMapping $associationMapping */ private static function newEntityFoundThroughRelationshipMessage(array $associationMapping, $entity): string { diff --git a/src/PersistentCollection.php b/src/PersistentCollection.php index c94bb77496b..20d98b5f455 100644 --- a/src/PersistentCollection.php +++ b/src/PersistentCollection.php @@ -34,11 +34,11 @@ * 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 - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ final class PersistentCollection extends AbstractLazyCollection implements Selectable { @@ -48,7 +48,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 $snapshot = []; @@ -63,7 +63,7 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec * The association mapping the collection belongs to. * This is currently either a OneToManyMapping or a ManyToManyMapping. * - * @psalm-var AssociationMapping|null + * @phpstan-var AssociationMapping|null */ private $association; @@ -102,7 +102,7 @@ final class PersistentCollection extends AbstractLazyCollection implements Selec * * @param EntityManagerInterface $em The EntityManager the collection will be associated with. * @param ClassMetadata $class 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(EntityManagerInterface $em, $class, Collection $collection) { @@ -118,7 +118,7 @@ public function __construct(EntityManagerInterface $em, $class, Collection $coll * describes the association between the owner and the elements of the collection. * * @param object $entity - * @psalm-param AssociationMapping $assoc + * @phpstan-param AssociationMapping $assoc */ public function setOwner($entity, array $assoc): void { @@ -234,7 +234,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 { @@ -276,7 +276,7 @@ public function getInsertDiff(): array /** * INTERNAL: Gets the association mapping of the collection. * - * @psalm-return AssociationMapping + * @phpstan-return AssociationMapping */ public function getMapping(): array { @@ -581,7 +581,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 { @@ -599,7 +599,7 @@ public function __sleep(): array * @param int|null $length * * @return mixed[] - * @psalm-return array + * @phpstan-return array */ public function slice($offset, $length = null): array { @@ -641,7 +641,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 f31110b1407..42bbb5c9410 100644 --- a/src/Persisters/Collection/ManyToManyPersister.php +++ b/src/Persisters/Collection/ManyToManyPersister.php @@ -27,7 +27,7 @@ /** * Persister for many-to-many collections. * - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ class ManyToManyPersister extends AbstractCollectionPersister { @@ -297,12 +297,12 @@ public function loadCriteria(PersistentCollection $collection, Criteria $criteri * JOIN. * * @param mixed[] $mapping Array containing mapping information. - * @psalm-param AssociationMapping $mapping + * @phpstan-param AssociationMapping $mapping * * @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($mapping) { @@ -350,10 +350,10 @@ protected function generateFilterConditionSQL(ClassMetadata $targetEntity, $targ * Generate ON condition * * @param mixed[] $mapping - * @psalm-param AssociationMapping $mapping + * @phpstan-param AssociationMapping $mapping * * @return string[] - * @psalm-return list + * @phpstan-return list */ protected function getOnConditionSQL($mapping) { @@ -427,7 +427,7 @@ protected function getDeleteSQLParameters(PersistentCollection $collection) * * @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) { @@ -463,7 +463,7 @@ protected function getDeleteRowSQL(PersistentCollection $collection) * @param mixed $element * * @return mixed[] - * @psalm-return list + * @phpstan-return list */ protected function getDeleteRowSQLParameters(PersistentCollection $collection, $element) { @@ -475,7 +475,7 @@ protected function getDeleteRowSQLParameters(PersistentCollection $collection, $ * * @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) { @@ -513,7 +513,7 @@ protected function getInsertRowSQL(PersistentCollection $collection) * @param object $element * * @return mixed[] - * @psalm-return list + * @phpstan-return list */ protected function getInsertRowSQLParameters(PersistentCollection $collection, $element) { @@ -527,7 +527,7 @@ protected function getInsertRowSQLParameters(PersistentCollection $collection, $ * @param object $element * * @return mixed[] - * @psalm-return list + * @phpstan-return list */ private function collectJoinTableColumnParameters( PersistentCollection $collection, @@ -575,7 +575,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, @@ -663,7 +663,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 9bd8afd3cc1..a9897f195fe 100644 --- a/src/Persisters/Entity/BasicEntityPersister.php +++ b/src/Persisters/Entity/BasicEntityPersister.php @@ -90,7 +90,7 @@ * Subclasses can be created to provide custom persisting and querying strategies, * i.e. spanning multiple tables. * - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ class BasicEntityPersister implements EntityPersister { @@ -143,7 +143,7 @@ class BasicEntityPersister implements EntityPersister /** * Queued inserts. * - * @psalm-var array + * @phpstan-var array */ protected $queuedInserts = []; @@ -385,7 +385,7 @@ protected function fetchVersionAndNotUpsertableValues($versionedClass, array $id * @param mixed[] $id * * @return int[]|null[]|string[] - * @psalm-return list + * @phpstan-return list */ final protected function extractIdentifierTypes(array $id, ClassMetadata $versionedClass): array { @@ -633,7 +633,7 @@ public function delete($entity) * @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($entity, bool $isInsert = false) { @@ -752,7 +752,7 @@ protected function prepareUpdateData($entity, bool $isInsert = false) * @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($entity) { @@ -1046,7 +1046,7 @@ public function loadManyToManyCollection(array $assoc, $sourceEntity, Persistent /** * @param object $sourceEntity - * @psalm-param array $assoc + * @phpstan-param array $assoc * * @return Result * @@ -1210,7 +1210,7 @@ public function getCountSQL($criteria = []) /** * Gets the ORDER BY SQL snippet for ordered collections. * - * @psalm-param array $orderBy + * @phpstan-param array $orderBy * * @throws InvalidOrientation * @throws InvalidFindByCall @@ -1423,7 +1423,7 @@ protected function getSelectColumnAssociationSQL($field, $assoc, ClassMetadata $ * Gets the SQL join fragment used when selecting entities from a * many-to-many association. * - * @psalm-param AssociationMapping $manyToMany + * @phpstan-param AssociationMapping $manyToMany * * @return string */ @@ -1504,7 +1504,7 @@ public function getInsertSQL() * columns placed in the INSERT statements used by the persister. * * @return string[] The list of columns. - * @psalm-return list + * @phpstan-return list */ protected function getInsertColumnList() { @@ -1636,7 +1636,7 @@ public function lock(array $criteria, $lockMode) * Gets the FROM and optionally JOIN conditions to lock the entity managed by this persister. * * @param int|null $lockMode One of the Doctrine\DBAL\LockMode::* constants. - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param LockMode::*|null $lockMode * * @return string */ @@ -1751,10 +1751,10 @@ public function getSelectConditionStatementSQL($field, $value, $assoc = null, $c /** * Builds the left-hand-side of a where condition statement. * - * @psalm-param AssociationMapping|null $assoc + * @phpstan-param AssociationMapping|null $assoc * * @return string[] - * @psalm-return list + * @phpstan-return list * * @throws InvalidFindByCall * @throws UnrecognizedField @@ -1825,8 +1825,8 @@ private function getSelectConditionStatementColumnSQL( * or alter the criteria by which entities are selected. * * @param AssociationMapping|null $assoc - * @psalm-param array $criteria - * @psalm-param array|null $assoc + * @phpstan-param array $criteria + * @phpstan-param array|null $assoc * * @return string */ @@ -1867,7 +1867,7 @@ public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentC * Builds criteria and execute SQL statement to fetch the one to many entities from. * * @param object $sourceEntity - * @psalm-param AssociationMapping $assoc + * @phpstan-param AssociationMapping $assoc */ private function getOneToManyStatement( array $assoc, @@ -1950,7 +1950,7 @@ public function expandParameters($criteria) * - 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 { @@ -1975,7 +1975,7 @@ private function expandToManyParameters(array $criteria): array * @param mixed $value * * @return int[]|null[]|string[] - * @psalm-return list + * @phpstan-return list * * @throws QueryException */ @@ -2050,7 +2050,7 @@ private function getValues($value): array * * @param mixed $value * - * @psalm-return list + * @phpstan-return list */ private function getIndividualValue($value): array { @@ -2122,7 +2122,7 @@ public function exists($entity, ?Criteria $extraConditions = null) * Generates the appropriate join SQL for the given join column. * * @param array[] $joinColumns The join columns definition of an association. - * @psalm-param array> $joinColumns + * @phpstan-param array> $joinColumns * * @return string LEFT JOIN if one of the columns is nullable, INNER JOIN otherwise. */ @@ -2195,7 +2195,7 @@ protected function switchPersisterContext($offset, $limit) /** * @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 a69fbbdae12..4562feedf73 100644 --- a/src/Persisters/Entity/EntityPersister.php +++ b/src/Persisters/Entity/EntityPersister.php @@ -15,7 +15,7 @@ * Entity persister interface * Define the behavior that should be implemented by all entity persisters. * - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ interface EntityPersister { @@ -54,8 +54,8 @@ public function getInsertSQL(); * @param int|null $limit * @param int|null $offset * @param mixed[]|null $orderBy - * @psalm-param AssociationMapping|null $assoc - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param AssociationMapping|null $assoc + * @phpstan-param LockMode::*|null $lockMode * * @return string */ @@ -75,14 +75,14 @@ public function getCountSQL($criteria = []); * * @param string[] $criteria * - * @psalm-return array{list, list} + * @phpstan-return array{list, list} */ public function expandParameters($criteria); /** * 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); @@ -113,7 +113,7 @@ public function addInsert($entity); * * If no inserts are queued, invoking this method is a NOOP. * - * @psalm-return void|list Returning an array of generated post-insert IDs is deprecated, implementations @@ -181,10 +181,10 @@ public function getOwningTable($fieldName); * 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. * @@ -204,7 +204,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. * @@ -217,10 +217,10 @@ public function loadById(array $identifier, $entity = null); * association from another entity. * * @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. - * @psalm-param AssociationMapping $assoc The association to load. + * @phpstan-param AssociationMapping $assoc The association to load. * * @return object The loaded and managed entity instance or NULL if the entity can not be found. * @@ -235,10 +235,10 @@ public function loadOneToOneEntity(array $assoc, $sourceEntity, array $identifie * @param 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 * * @return void */ @@ -256,8 +256,8 @@ public function loadCriteria(Criteria $criteria); * * @param int|null $limit * @param int|null $offset - * @psalm-param array|null $orderBy - * @psalm-param array $criteria + * @phpstan-param array|null $orderBy + * @phpstan-param array $criteria */ public function loadAll(array $criteria = [], ?array $orderBy = null, $limit = null, $offset = null); @@ -267,7 +267,7 @@ public function loadAll(array $criteria = [], ?array $orderBy = null, $limit = n * @param object $sourceEntity * @param int|null $offset * @param int|null $limit - * @psalm-param AssociationMapping $assoc + * @phpstan-param AssociationMapping $assoc * * @return mixed[] */ @@ -278,7 +278,7 @@ public function getManyToManyCollection(array $assoc, $sourceEntity, $offset = n * * @param object $sourceEntity The entity that owns the collection. * @param PersistentCollection $collection The collection to fill. - * @psalm-param AssociationMapping $assoc The association mapping of the association being loaded. + * @phpstan-param AssociationMapping $assoc The association mapping of the association being loaded. * * @return mixed[] */ @@ -289,7 +289,7 @@ public function loadManyToManyCollection(array $assoc, $sourceEntity, Persistent * * @param object $sourceEntity * @param PersistentCollection $collection The collection to load/fill. - * @psalm-param AssociationMapping $assoc + * @phpstan-param AssociationMapping $assoc * * @return mixed */ @@ -299,8 +299,8 @@ public function loadOneToManyCollection(array $assoc, $sourceEntity, PersistentC * Locks all rows of this entity matching the given criteria with the specified pessimistic lock mode. * * @param int $lockMode One of the Doctrine\DBAL\LockMode::* constants. - * @psalm-param array $criteria - * @psalm-param LockMode::* $lockMode + * @phpstan-param array $criteria + * @phpstan-param LockMode::* $lockMode * * @return void */ @@ -312,7 +312,7 @@ public function lock(array $criteria, $lockMode); * @param object $sourceEntity * @param int|null $offset * @param int|null $limit - * @psalm-param AssociationMapping $assoc + * @phpstan-param AssociationMapping $assoc * * @return mixed[] */ diff --git a/src/Persisters/Entity/JoinedSubclassPersister.php b/src/Persisters/Entity/JoinedSubclassPersister.php index 2b2b842ea4f..bf922e1248c 100644 --- a/src/Persisters/Entity/JoinedSubclassPersister.php +++ b/src/Persisters/Entity/JoinedSubclassPersister.php @@ -34,14 +34,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 $owningTableMap = []; /** * Map of table to quoted table names. * - * @psalm-var array + * @phpstan-var array */ private $quotedTableMap = []; diff --git a/src/Persisters/SqlValueVisitor.php b/src/Persisters/SqlValueVisitor.php index 999746faaa9..b1814a21315 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() { diff --git a/src/Proxy/ProxyFactory.php b/src/Proxy/ProxyFactory.php index aaf51e19fe7..9abe921d381 100644 --- a/src/Proxy/ProxyFactory.php +++ b/src/Proxy/ProxyFactory.php @@ -294,7 +294,7 @@ protected function createProxyDefinition($className) * * @deprecated ProxyFactory::createInitializer() is deprecated and will be removed in version 3.0 of doctrine/orm. * - * @psalm-return Closure(CommonProxy):void + * @phpstan-return Closure(CommonProxy):void * * @throws EntityNotFoundException */ @@ -392,7 +392,7 @@ private function createLazyInitializer(ClassMetadata $classMetadata, EntityPersi * * @deprecated ProxyFactory::createCloner() is deprecated and will be removed in version 3.0 of doctrine/orm. * - * @psalm-return Closure(CommonProxy):void + * @phpstan-return Closure(CommonProxy):void * * @throws EntityNotFoundException */ diff --git a/src/Query.php b/src/Query.php index 48464e52631..41471738e04 100644 --- a/src/Query.php +++ b/src/Query.php @@ -125,7 +125,7 @@ class Query extends AbstractQuery * The current state of this query. * * @var int - * @psalm-var self::STATE_* + * @phpstan-var self::STATE_* */ private $state = self::STATE_DIRTY; @@ -387,7 +387,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 */ @@ -438,7 +438,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 { @@ -637,7 +637,7 @@ public function getDQL(): ?string * @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 { @@ -730,8 +730,8 @@ public function getMaxResults(): ?int * * @param ArrayCollection|mixed[]|null $parameters The query parameters. * @param string|int $hydrationMode The hydration mode to use. - * @psalm-param ArrayCollection|array|null $parameters - * @psalm-param string|AbstractQuery::HYDRATE_*|null $hydrationMode + * @phpstan-param ArrayCollection|array|null $parameters + * @phpstan-param string|AbstractQuery::HYDRATE_*|null $hydrationMode */ public function iterate($parameters = null, $hydrationMode = self::HYDRATE_OBJECT): IterableResult { @@ -774,7 +774,7 @@ public function setHydrationMode($hydrationMode): self * @see \Doctrine\DBAL\LockMode * * @param int $lockMode - * @psalm-param LockMode::* $lockMode + * @phpstan-param LockMode::* $lockMode * * @return $this * diff --git a/src/Query/AST/Functions/ConcatFunction.php b/src/Query/AST/Functions/ConcatFunction.php index f25f0e69668..9e6dd8a8ae2 100644 --- a/src/Query/AST/Functions/ConcatFunction.php +++ b/src/Query/AST/Functions/ConcatFunction.php @@ -22,7 +22,7 @@ class ConcatFunction extends FunctionNode /** @var Node */ public $secondStringPrimary; - /** @psalm-var list */ + /** @phpstan-var list */ public $concatExpressions = []; /** @inheritDoc */ diff --git a/src/Query/AST/Functions/FunctionNode.php b/src/Query/AST/Functions/FunctionNode.php index 034b1764450..d521bd26f76 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/Functions/TrimFunction.php b/src/Query/AST/Functions/TrimFunction.php index 55cb37e8f76..509a6c7cedc 100644 --- a/src/Query/AST/Functions/TrimFunction.php +++ b/src/Query/AST/Functions/TrimFunction.php @@ -83,7 +83,7 @@ public function parse(Parser $parser) $parser->match(TokenType::T_CLOSE_PARENTHESIS); } - /** @psalm-return TrimMode::* */ + /** @phpstan-return TrimMode::* */ private function getTrimMode(): int { if ($this->leading) { diff --git a/src/Query/AST/Join.php b/src/Query/AST/Join.php index 9c595a457ae..cf52082a3fa 100644 --- a/src/Query/AST/Join.php +++ b/src/Query/AST/Join.php @@ -18,7 +18,7 @@ class Join extends Node /** * @var int - * @psalm-var self::JOIN_TYPE_* + * @phpstan-var self::JOIN_TYPE_* */ public $joinType = self::JOIN_TYPE_INNER; @@ -31,7 +31,7 @@ class Join extends Node /** * @param int $joinType * @param Node $joinAssociationDeclaration - * @psalm-param self::JOIN_TYPE_* $joinType + * @phpstan-param self::JOIN_TYPE_* $joinType */ public function __construct($joinType, $joinAssociationDeclaration) { diff --git a/src/Query/AST/Literal.php b/src/Query/AST/Literal.php index 6fdb99a8f64..6931ddada84 100644 --- a/src/Query/AST/Literal.php +++ b/src/Query/AST/Literal.php @@ -12,7 +12,7 @@ class Literal extends Node /** * @var int - * @psalm-var self::* + * @phpstan-var self::* */ public $type; @@ -22,7 +22,7 @@ class Literal extends Node /** * @param int $type * @param mixed $value - * @psalm-param self::* $type + * @phpstan-param self::* $type */ public function __construct($type, $value) { diff --git a/src/Query/AST/PathExpression.php b/src/Query/AST/PathExpression.php index 9e7005d5987..786fef45831 100644 --- a/src/Query/AST/PathExpression.php +++ b/src/Query/AST/PathExpression.php @@ -21,13 +21,13 @@ class PathExpression extends Node /** * @var int|null - * @psalm-var self::TYPE_*|null + * @phpstan-var self::TYPE_*|null */ public $type; /** * @var int - * @psalm-var int-mask-of + * @phpstan-var int-mask-of */ public $expectedType; @@ -41,7 +41,7 @@ class PathExpression extends Node * @param int $expectedType * @param string $identificationVariable * @param string|null $field - * @psalm-param int-mask-of $expectedType + * @phpstan-param int-mask-of $expectedType */ public function __construct($expectedType, $identificationVariable, $field = null) { 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 5180be9e7b2..73e9a0c1547 100644 --- a/src/Query/Exec/SingleSelectSqlFinalizer.php +++ b/src/Query/Exec/SingleSelectSqlFinalizer.php @@ -32,8 +32,6 @@ public function __construct(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.php b/src/Query/Expr.php index 6c29e8061ca..309e7bdb0d1 100644 --- a/src/Query/Expr.php +++ b/src/Query/Expr.php @@ -36,7 +36,7 @@ class Expr * @param Expr\Comparison|Expr\Func|Expr\Andx|Expr\Orx|string $x Optional clause. Defaults to null, * but requires at least one defined * when converting to string. - * @psalm-param Expr\Comparison|Expr\Func|Expr\Andx|Expr\Orx|string ...$x + * @phpstan-param Expr\Comparison|Expr\Func|Expr\Andx|Expr\Orx|string ...$x * * @return Expr\Andx */ @@ -57,7 +57,7 @@ public function andX($x = null) * @param Expr\Comparison|Expr\Func|Expr\Andx|Expr\Orx|string $x Optional clause. Defaults to null, * but requires at least one defined * when converting to string. - * @psalm-param Expr\Comparison|Expr\Func|Expr\Andx|Expr\Orx|string ...$x + * @phpstan-param Expr\Comparison|Expr\Func|Expr\Andx|Expr\Orx|string ...$x * * @return Expr\Orx */ diff --git a/src/Query/Expr/Andx.php b/src/Query/Expr/Andx.php index 229a4567963..eddfa747948 100644 --- a/src/Query/Expr/Andx.php +++ b/src/Query/Expr/Andx.php @@ -22,10 +22,10 @@ class Andx extends Composite self::class, ]; - /** @psalm-var list */ + /** @phpstan-var list */ protected $parts = []; - /** @psalm-return list */ + /** @phpstan-return list */ public function getParts() { return $this->parts; diff --git a/src/Query/Expr/Base.php b/src/Query/Expr/Base.php index bab52dbc432..3b2c49fa076 100644 --- a/src/Query/Expr/Base.php +++ b/src/Query/Expr/Base.php @@ -45,7 +45,7 @@ public function __construct($args = []) /** * @param string[]|object[]|string|object $args - * @psalm-param list|string|object $args + * @phpstan-param list|string|object $args * * @return $this */ @@ -84,7 +84,7 @@ public function add($arg) /** * @return int - * @psalm-return 0|positive-int + * @phpstan-return 0|positive-int */ public function count() { diff --git a/src/Query/Expr/Func.php b/src/Query/Expr/Func.php index ff70b130c39..ec6ee54cc4d 100644 --- a/src/Query/Expr/Func.php +++ b/src/Query/Expr/Func.php @@ -24,7 +24,7 @@ class Func * * @param string $name * @param mixed[]|mixed $arguments - * @psalm-param list|mixed $arguments + * @phpstan-param list|mixed $arguments */ public function __construct($name, $arguments) { @@ -38,7 +38,7 @@ public function getName() return $this->name; } - /** @psalm-return list */ + /** @phpstan-return list */ public function getArguments() { return $this->arguments; diff --git a/src/Query/Expr/GroupBy.php b/src/Query/Expr/GroupBy.php index 178a48b231b..b3a25bfe160 100644 --- a/src/Query/Expr/GroupBy.php +++ b/src/Query/Expr/GroupBy.php @@ -17,10 +17,10 @@ class GroupBy extends Base /** @var string */ protected $postSeparator = ''; - /** @psalm-var list */ + /** @phpstan-var list */ protected $parts = []; - /** @psalm-return list */ + /** @phpstan-return list */ public function getParts() { return $this->parts; diff --git a/src/Query/Expr/Join.php b/src/Query/Expr/Join.php index fa7363d1f1c..eec23670375 100644 --- a/src/Query/Expr/Join.php +++ b/src/Query/Expr/Join.php @@ -21,7 +21,7 @@ class Join /** * @var string - * @psalm-var self::INNER_JOIN|self::LEFT_JOIN + * @phpstan-var self::INNER_JOIN|self::LEFT_JOIN */ protected $joinType; @@ -33,7 +33,7 @@ class Join /** * @var string|null - * @psalm-var self::ON|self::WITH|null + * @phpstan-var self::ON|self::WITH|null */ protected $conditionType; @@ -50,8 +50,8 @@ class Join * @param string|null $conditionType The condition type constant. Either ON or WITH. * @param string|Comparison|Composite|Func|null $condition The condition for the join. * @param string|null $indexBy The index for the join. - * @psalm-param self::INNER_JOIN|self::LEFT_JOIN $joinType - * @psalm-param self::ON|self::WITH|null $conditionType + * @phpstan-param self::INNER_JOIN|self::LEFT_JOIN $joinType + * @phpstan-param self::ON|self::WITH|null $conditionType */ public function __construct($joinType, $join, $alias = null, $conditionType = null, $condition = null, $indexBy = null) { @@ -65,7 +65,7 @@ public function __construct($joinType, $join, $alias = null, $conditionType = nu /** * @return string - * @psalm-return self::INNER_JOIN|self::LEFT_JOIN + * @phpstan-return self::INNER_JOIN|self::LEFT_JOIN */ public function getJoinType() { @@ -86,7 +86,7 @@ public function getAlias() /** * @return string|null - * @psalm-return self::ON|self::WITH|null + * @phpstan-return self::ON|self::WITH|null */ public function getConditionType() { diff --git a/src/Query/Expr/Literal.php b/src/Query/Expr/Literal.php index d3930fcb97d..336567dd254 100644 --- a/src/Query/Expr/Literal.php +++ b/src/Query/Expr/Literal.php @@ -17,10 +17,10 @@ class Literal extends Base /** @var string */ protected $postSeparator = ''; - /** @psalm-var list */ + /** @phpstan-var list */ protected $parts = []; - /** @psalm-return list */ + /** @phpstan-return list */ public function getParts() { return $this->parts; diff --git a/src/Query/Expr/OrderBy.php b/src/Query/Expr/OrderBy.php index dc6cfbd78ee..1c505f6a449 100644 --- a/src/Query/Expr/OrderBy.php +++ b/src/Query/Expr/OrderBy.php @@ -26,7 +26,7 @@ class OrderBy /** @var string[] */ protected $allowedClasses = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $parts = []; /** @@ -54,14 +54,14 @@ public function add($sort, $order = null) /** * @return int - * @psalm-return 0|positive-int + * @phpstan-return 0|positive-int */ public function count() { return count($this->parts); } - /** @psalm-return list */ + /** @phpstan-return list */ public function getParts() { return $this->parts; diff --git a/src/Query/Expr/Orx.php b/src/Query/Expr/Orx.php index 2d3ae0df00d..37493ec62a0 100644 --- a/src/Query/Expr/Orx.php +++ b/src/Query/Expr/Orx.php @@ -22,10 +22,10 @@ class Orx extends Composite self::class, ]; - /** @psalm-var list */ + /** @phpstan-var list */ protected $parts = []; - /** @psalm-return list */ + /** @phpstan-return list */ public function getParts() { return $this->parts; diff --git a/src/Query/Expr/Select.php b/src/Query/Expr/Select.php index a3929fb08ad..0a22900f3b8 100644 --- a/src/Query/Expr/Select.php +++ b/src/Query/Expr/Select.php @@ -20,10 +20,10 @@ class Select extends Base /** @var string[] */ protected $allowedClasses = [Func::class]; - /** @psalm-var list */ + /** @phpstan-var list */ protected $parts = []; - /** @psalm-return list */ + /** @phpstan-return list */ public function getParts() { return $this->parts; diff --git a/src/Query/Filter/SQLFilter.php b/src/Query/Filter/SQLFilter.php index 009619ef37d..d1079096f1e 100644 --- a/src/Query/Filter/SQLFilter.php +++ b/src/Query/Filter/SQLFilter.php @@ -35,7 +35,7 @@ abstract class SQLFilter /** * Parameters for the filter. * - * @psalm-var array + * @phpstan-var array */ private $parameters = []; @@ -190,7 +190,7 @@ final protected function getConnection(): Connection * Gets the SQL query part to add to a query. * * @param string $targetTableAlias - * @psalm-param ClassMetadata $targetEntity + * @phpstan-param ClassMetadata $targetEntity * * @return string The constraint SQL if there is available, empty string otherwise. */ diff --git a/src/Query/FilterCollection.php b/src/Query/FilterCollection.php index d8421baac6a..cfe2bf16dda 100644 --- a/src/Query/FilterCollection.php +++ b/src/Query/FilterCollection.php @@ -47,7 +47,7 @@ class FilterCollection * Instances of enabled filters. * * @var SQLFilter[] - * @psalm-var array + * @phpstan-var array */ private $enabledFilters = []; @@ -55,7 +55,7 @@ class FilterCollection * Instances of suspended filters. * * @var SQLFilter[] - * @psalm-var array + * @phpstan-var array */ private $suspendedFilters = []; @@ -70,7 +70,7 @@ class FilterCollection * The current state of this filter. * * @var int - * @psalm-var self::FILTERS_STATE_* + * @phpstan-var self::FILTERS_STATE_* */ private $filtersState = self::FILTERS_STATE_CLEAN; @@ -84,7 +84,7 @@ public function __construct(EntityManagerInterface $em) * Gets all the enabled filters. * * @return SQLFilter[] The enabled filters. - * @psalm-return array + * @phpstan-return array */ public function getEnabledFilters() { @@ -95,7 +95,7 @@ public function getEnabledFilters() * 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 fbbcd75a0b3..8ee44061467 100644 --- a/src/Query/Parser.php +++ b/src/Query/Parser.php @@ -36,9 +36,9 @@ * An LL(*) recursive-descent parser for the context-free grammar of the Doctrine Query Language. * Parses a DQL query, reports any errors in it, and generates an AST. * - * @psalm-import-type AssociationMapping from ClassMetadata - * @psalm-type DqlToken = Token - * @psalm-type QueryComponent = array{ + * @phpstan-import-type AssociationMapping from ClassMetadata + * @phpstan-type DqlToken = Token + * @phpstan-type QueryComponent = array{ * metadata?: ClassMetadata, * parent?: string|null, * relation?: AssociationMapping|null, @@ -103,19 +103,19 @@ class Parser * and still need to be validated. */ - /** @psalm-var list */ + /** @phpstan-var list */ private $deferredIdentificationVariables = []; - /** @psalm-var list */ + /** @phpstan-var list */ private $deferredPartialObjectExpressions = []; - /** @psalm-var list */ + /** @phpstan-var list */ private $deferredPathExpressions = []; - /** @psalm-var list */ + /** @phpstan-var list */ private $deferredResultVariables = []; - /** @psalm-var list */ + /** @phpstan-var list */ private $deferredNewObjectExpressions = []; /** @@ -149,7 +149,7 @@ class Parser /** * Map of declared query components in the parsed query. * - * @psalm-var array + * @phpstan-var array */ private $queryComponents = []; @@ -174,7 +174,7 @@ class Parser */ private $customOutputWalker; - /** @psalm-var array */ + /** @phpstan-var array */ private $identVariableExpressions = []; /** @@ -457,10 +457,10 @@ private function fixIdentificationVariableOrder(AST\Node $AST): void * * @param string $expected Expected string. * @param mixed[]|null $token Got token. - * @psalm-param DqlToken|null $token + * @phpstan-param DqlToken|null $token * * @return void - * @psalm-return no-return + * @phpstan-return no-return * * @throws QueryException */ @@ -484,10 +484,10 @@ public function syntaxError($expected = '', $token = null) * * @param string $message Optional message. * @param mixed[]|null $token Optional token. - * @psalm-param DqlToken|null $token + * @phpstan-param DqlToken|null $token * * @return void - * @psalm-return no-return + * @phpstan-return no-return * * @throws QueryException */ @@ -522,7 +522,7 @@ public function semanticalError($message = '', $token = null) * @param bool $resetPeek Reset peek after finding the closing parenthesis. * * @return mixed[] - * @psalm-return DqlToken|null + * @phpstan-return DqlToken|null */ private function peekBeyondClosingParenthesis(bool $resetPeek = true) { @@ -556,7 +556,7 @@ private function peekBeyondClosingParenthesis(bool $resetPeek = true) /** * Checks if the given token indicates a mathematical operator. * - * @psalm-param DqlToken|null $token + * @phpstan-param DqlToken|null $token */ private function isMathOperator($token): bool { @@ -582,7 +582,7 @@ private function isFunction(): bool /** * Checks whether the given token type indicates an aggregate function. * - * @psalm-param TokenType::T_* $tokenType + * @phpstan-param TokenType::T_* $tokenType * * @return bool TRUE if the token type is an aggregate function, FALSE otherwise. */ @@ -1120,7 +1120,7 @@ public function JoinAssociationPathExpression() * PathExpression ::= IdentificationVariable {"." identifier}* * * @param int $expectedTypes - * @psalm-param int-mask-of $expectedTypes + * @phpstan-param int-mask-of $expectedTypes * * @return AST\PathExpression */ diff --git a/src/Query/ParserResult.php b/src/Query/ParserResult.php index 86a4e4d3b64..28462dbc5be 100644 --- a/src/Query/ParserResult.php +++ b/src/Query/ParserResult.php @@ -50,7 +50,7 @@ class ParserResult /** * The mappings of DQL parameter names/positions to SQL parameter positions. * - * @psalm-var array> + * @phpstan-var array> */ private $parameterMappings = []; @@ -144,7 +144,7 @@ public function addParameterMapping($dqlPosition, $sqlPosition) /** * Gets all DQL to SQL parameter mappings. * - * @psalm-return array> The parameter mappings. + * @phpstan-return array> The parameter mappings. */ public function getParameterMappings() { @@ -157,7 +157,7 @@ public function getParameterMappings() * @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($dqlPosition) { diff --git a/src/Query/QueryException.php b/src/Query/QueryException.php index 9604ff5e107..8b572540876 100644 --- a/src/Query/QueryException.php +++ b/src/Query/QueryException.php @@ -10,7 +10,7 @@ use Exception; use Stringable; -/** @psalm-import-type AssociationMapping from ClassMetadata */ +/** @phpstan-import-type AssociationMapping from ClassMetadata */ class QueryException extends ORMException { /** @@ -144,7 +144,7 @@ public static function invalidLiteral($literal) /** * @param string[] $assoc - * @psalm-param AssociationMapping $assoc + * @phpstan-param AssociationMapping $assoc * * @return QueryException */ @@ -168,7 +168,7 @@ public static function partialObjectsAreDangerous() /** * @param string[] $assoc - * @psalm-param array $assoc + * @phpstan-param array $assoc * * @return QueryException */ @@ -192,7 +192,7 @@ public static function associationPathInverseSideNotSupported(PathExpression $pa /** * @param string[] $assoc - * @psalm-param AssociationMapping $assoc + * @phpstan-param AssociationMapping $assoc * * @return QueryException */ diff --git a/src/Query/ResultSetMapping.php b/src/Query/ResultSetMapping.php index 92e1d2eedc0..b59bf8d0b99 100644 --- a/src/Query/ResultSetMapping.php +++ b/src/Query/ResultSetMapping.php @@ -49,7 +49,7 @@ class ResultSetMapping * Maps alias names to related association field names. * * @ignore - * @psalm-var array + * @phpstan-var array */ public $relationMap = []; @@ -57,7 +57,7 @@ class ResultSetMapping * Maps alias names to parent alias names. * * @ignore - * @psalm-var array + * @phpstan-var array */ public $parentAliasMap = []; @@ -65,7 +65,7 @@ class ResultSetMapping * Maps column names in the result set to field names for each class. * * @ignore - * @psalm-var array + * @phpstan-var array */ public $fieldMappings = []; @@ -73,7 +73,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 $scalarMappings = []; @@ -81,7 +81,7 @@ class ResultSetMapping * Maps scalar columns to enums * * @ignore - * @psalm-var array + * @phpstan-var array */ public $enumMappings = []; @@ -89,7 +89,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 $typeMappings = []; @@ -97,7 +97,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 $entityMappings = []; @@ -105,7 +105,7 @@ class ResultSetMapping * Maps column names of meta columns (foreign keys, discriminator columns, ...) to field names. * * @ignore - * @psalm-var array + * @phpstan-var array */ public $metaMappings = []; @@ -113,7 +113,7 @@ class ResultSetMapping * Maps column names in the result set to the alias they belong to. * * @ignore - * @psalm-var array + * @phpstan-var array */ public $columnOwnerMap = []; @@ -121,7 +121,7 @@ class ResultSetMapping * List of columns in the result set that are used as discriminator columns. * * @ignore - * @psalm-var array + * @phpstan-var array */ public $discriminatorColumns = []; @@ -129,7 +129,7 @@ class ResultSetMapping * Maps alias names to field names that should be used for indexing. * * @ignore - * @psalm-var array + * @phpstan-var array */ public $indexByMap = []; @@ -144,28 +144,28 @@ class ResultSetMapping /** * This is necessary to hydrate derivate foreign keys correctly. * - * @psalm-var array> + * @phpstan-var array> */ public $isIdentifierColumn = []; /** * Maps column names in the result set to field names for each new object expression. * - * @psalm-var array> + * @phpstan-var array> */ public $newObjectMappings = []; /** * Maps metadata parameter names to the metadata attribute. * - * @psalm-var array + * @phpstan-var array */ public $metadataParameterMapping = []; /** * Contains query parameter names to be resolved as discriminator values * - * @psalm-var array + * @phpstan-var array */ public $discriminatorParameters = []; @@ -546,7 +546,7 @@ public function getAliasMap() * Gets the number of different entities that appear in the mapped result. * * @return int - * @psalm-return 0|positive-int + * @phpstan-return 0|positive-int */ public function getEntityResultCount() { diff --git a/src/Query/ResultSetMappingBuilder.php b/src/Query/ResultSetMappingBuilder.php index 93bc7dc26d8..e19da1c7391 100644 --- a/src/Query/ResultSetMappingBuilder.php +++ b/src/Query/ResultSetMappingBuilder.php @@ -60,13 +60,13 @@ class ResultSetMappingBuilder extends ResultSetMapping * Default column renaming mode. * * @var int - * @psalm-var self::COLUMN_RENAMING_* + * @phpstan-var self::COLUMN_RENAMING_* */ private $defaultRenameMode; /** * @param int $defaultRenameMode - * @psalm-param self::COLUMN_RENAMING_* $defaultRenameMode + * @phpstan-param self::COLUMN_RENAMING_* $defaultRenameMode */ public function __construct(EntityManagerInterface $em, $defaultRenameMode = self::COLUMN_RENAMING_NONE) { @@ -81,7 +81,7 @@ public function __construct(EntityManagerInterface $em, $defaultRenameMode = sel * @param string $alias The unique alias to use for the root entity. * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName). * @param int|null $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM). - * @psalm-param self::COLUMN_RENAMING_*|null $renameMode + * @phpstan-param self::COLUMN_RENAMING_*|null $renameMode * * @return void */ @@ -104,7 +104,7 @@ public function addRootEntityFromClassMetadata($class, $alias, $renamedColumns = * with the joined entity result. * @param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName). * @param int|null $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM). - * @psalm-param self::COLUMN_RENAMING_*|null $renameMode + * @phpstan-param self::COLUMN_RENAMING_*|null $renameMode * * @return void */ @@ -123,7 +123,7 @@ public function addJoinedEntityFromClassMetadata($class, $alias, $parentAlias, $ * @param string $class * @param string $alias * @param string[] $columnAliasMap - * @psalm-param array $columnAliasMap + * @phpstan-param array $columnAliasMap * * @return void * @@ -195,9 +195,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 { @@ -225,8 +225,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[] */ @@ -448,7 +448,7 @@ public function addNamedNativeQueryEntityResultMapping(ClassMetadataInfo $classM * expressions have to be written manually. * * @param string[] $tableAliases - * @psalm-param array $tableAliases + * @phpstan-param array $tableAliases * * @return string */ diff --git a/src/Query/SqlWalker.php b/src/Query/SqlWalker.php index e4e2de5c5c1..1d9d38a7228 100644 --- a/src/Query/SqlWalker.php +++ b/src/Query/SqlWalker.php @@ -43,8 +43,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 implements TreeWalker { @@ -111,7 +111,7 @@ class SqlWalker implements TreeWalker /** * Map from result variable names to their SQL column alias names. * - * @psalm-var array> + * @phpstan-var array> */ private $scalarResultAliasMap = []; @@ -132,21 +132,21 @@ class SqlWalker implements TreeWalker /** * Map of all components/classes that appear in the DQL query. * - * @psalm-var array + * @phpstan-var array */ private $queryComponents; /** * A list of classes that appear in non-scalar SelectExpressions. * - * @psalm-var array + * @phpstan-var array */ private $selectedClasses = []; /** * The DQL alias of the root class of the currently traversed query. * - * @psalm-var list + * @phpstan-var list */ private $rootAliases = []; @@ -175,7 +175,7 @@ class SqlWalker implements TreeWalker /** * @param Query $query The parsed Query. * @param ParserResult $parserResult The result of the parsing process. - * @psalm-param array $queryComponents The query components (symbol table). + * @phpstan-param array $queryComponents The query components (symbol table). */ public function __construct($query, $parserResult, array $queryComponents) { @@ -225,7 +225,7 @@ public function getEntityManager() * @param string $dqlAlias The DQL alias. * * @return mixed[] - * @psalm-return QueryComponent + * @phpstan-return QueryComponent */ public function getQueryComponent($dqlAlias) { @@ -255,7 +255,7 @@ public function getQueryComponents() * Sets or overrides a query component for a given dql alias. * * @param string $dqlAlias The DQL alias. - * @psalm-param QueryComponent $queryComponent + * @phpstan-param QueryComponent $queryComponent * * @return void * @@ -297,7 +297,6 @@ public function getExecutor($AST) } } - /** @psalm-internal Doctrine\ORM */ protected function createUpdateStatementExecutor(AST\UpdateStatement $AST): Exec\AbstractSqlExecutor { $primaryClass = $this->em->getClassMetadata($AST->updateClause->abstractSchemaName); @@ -307,7 +306,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); @@ -469,7 +467,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 { @@ -1035,7 +1033,7 @@ private function generateRangeVariableDeclarationSQL( * @param AST\JoinAssociationDeclaration $joinAssociationDeclaration * @param int $joinType * @param AST\ConditionalExpression|AST\Phase2OptimizableConditional $condExpr - * @psalm-param AST\Join::JOIN_TYPE_* $joinType + * @phpstan-param AST\Join::JOIN_TYPE_* $joinType * * @return string * diff --git a/src/Query/TreeWalker.php b/src/Query/TreeWalker.php index 00c3d52c498..010e2b6b28c 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 { @@ -19,7 +19,7 @@ interface TreeWalker * @param AbstractQuery $query The parsed Query. * @param ParserResult $parserResult The result of the parsing process. * @param mixed[] $queryComponents The query components (symbol table). - * @psalm-param array $queryComponents The query components (symbol table). + * @phpstan-param array $queryComponents The query components (symbol table). */ public function __construct($query, $parserResult, array $queryComponents); @@ -27,7 +27,7 @@ public function __construct($query, $parserResult, array $queryComponents); * Returns internal queryComponents array. * * @return array> - * @psalm-return array + * @phpstan-return array */ public function getQueryComponents(); @@ -38,7 +38,7 @@ public function getQueryComponents(); * * @param string $dqlAlias The DQL alias. * @param array $queryComponent - * @psalm-param QueryComponent $queryComponent + * @phpstan-param QueryComponent $queryComponent * * @return void */ diff --git a/src/Query/TreeWalkerAdapter.php b/src/Query/TreeWalkerAdapter.php index c705c52bf2b..cf02e32ce18 100644 --- a/src/Query/TreeWalkerAdapter.php +++ b/src/Query/TreeWalkerAdapter.php @@ -21,7 +21,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 { @@ -42,7 +42,7 @@ abstract class TreeWalkerAdapter implements TreeWalker /** * The query components of the original query (the "symbol table") that was produced by the Parser. * - * @psalm-var array + * @phpstan-var array */ private $queryComponents; @@ -71,7 +71,7 @@ public function getQueryComponents() * * @param string $dqlAlias The DQL alias. * @param array $queryComponent - * @psalm-param QueryComponent $queryComponent + * @phpstan-param QueryComponent $queryComponent * * @return void */ @@ -102,7 +102,7 @@ public function setQueryComponent($dqlAlias, array $queryComponent) * @deprecated Call {@see getQueryComponents()} instead. * * @return array> - * @psalm-return array + * @phpstan-return array */ protected function _getQueryComponents() { diff --git a/src/Query/TreeWalkerChain.php b/src/Query/TreeWalkerChain.php index 22655478b78..23f4bba61b3 100644 --- a/src/Query/TreeWalkerChain.php +++ b/src/Query/TreeWalkerChain.php @@ -16,7 +16,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 { @@ -37,7 +37,7 @@ class TreeWalkerChain implements TreeWalker * The query components of the original query (the "symbol table") that was produced by the Parser. * * @var array> - * @psalm-var array + * @phpstan-var array */ private $queryComponents; @@ -946,7 +946,7 @@ public function getExecutor($AST) return null; } - /** @psalm-return Generator */ + /** @phpstan-return Generator */ private function getWalkers(): Generator { foreach ($this->walkers as $walkerClass) { diff --git a/src/Query/TreeWalkerChainIterator.php b/src/Query/TreeWalkerChainIterator.php index f38f655e744..1ca58e54101 100644 --- a/src/Query/TreeWalkerChainIterator.php +++ b/src/Query/TreeWalkerChainIterator.php @@ -92,7 +92,7 @@ public function valid() /** * @param mixed $offset - * @psalm-param array-key|null $offset + * @phpstan-param array-key|null $offset * * @return bool */ @@ -104,7 +104,7 @@ public function offsetExists($offset) /** * @param mixed $offset - * @psalm-param array-key|null $offset + * @phpstan-param array-key|null $offset * * @return TreeWalker|null */ @@ -126,7 +126,7 @@ public function offsetGet($offset) * {@inheritDoc} * * @param string $value - * @psalm-param array-key|null $offset + * @phpstan-param array-key|null $offset * * @return void */ @@ -142,7 +142,7 @@ public function offsetSet($offset, $value) /** * @param mixed $offset - * @psalm-param array-key|null $offset + * @phpstan-param array-key|null $offset * * @return void */ diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index b99c05b44e8..b125a529231 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -67,7 +67,7 @@ class QueryBuilder /** * The array of DQL parts collected. * - * @psalm-var array + * @phpstan-var array */ private $dqlParts = [ 'distinct' => false, @@ -85,7 +85,7 @@ class QueryBuilder * The type of query this is. Can be select, update or delete. * * @var int - * @psalm-var self::SELECT|self::DELETE|self::UPDATE + * @phpstan-var self::SELECT|self::DELETE|self::UPDATE * @phpstan-ignore classConstant.deprecated */ private $type = self::SELECT; @@ -94,7 +94,7 @@ class QueryBuilder * The state of the query object. Can be dirty or clean. * * @var int - * @psalm-var self::STATE_* + * @phpstan-var self::STATE_* * @phpstan-ignore classConstant.deprecated */ private $state = self::STATE_CLEAN; @@ -110,7 +110,7 @@ class QueryBuilder * The query parameters. * * @var ArrayCollection - * @psalm-var ArrayCollection + * @phpstan-var ArrayCollection */ private $parameters; @@ -131,7 +131,7 @@ class QueryBuilder /** * Keeps root entity alias names for join entities. * - * @psalm-var array + * @phpstan-var array */ private $joinRootAliases = []; @@ -153,7 +153,7 @@ class QueryBuilder * Second level query cache mode. * * @var int|null - * @psalm-var Cache::MODE_*|null + * @phpstan-var Cache::MODE_*|null */ protected $cacheMode; @@ -261,7 +261,7 @@ public function setLifetime($lifetime) /** * @return int|null - * @psalm-return Cache::MODE_*|null + * @phpstan-return Cache::MODE_*|null */ public function getCacheMode() { @@ -270,7 +270,7 @@ public function getCacheMode() /** * @param int $cacheMode - * @psalm-param Cache::MODE_* $cacheMode + * @phpstan-param Cache::MODE_* $cacheMode * * @return $this */ @@ -287,7 +287,7 @@ public function setCacheMode($cacheMode) * @deprecated If necessary, track the type of the query being built outside of the builder. * * @return int - * @psalm-return self::SELECT|self::DELETE|self::UPDATE + * @phpstan-return self::SELECT|self::DELETE|self::UPDATE */ public function getType() { @@ -317,7 +317,7 @@ public function getEntityManager() * @deprecated The builder state is an internal concern. * * @return int Either QueryBuilder::STATE_DIRTY or QueryBuilder::STATE_CLEAN. - * @psalm-return self::STATE_* + * @phpstan-return self::STATE_* */ public function getState() { @@ -480,7 +480,7 @@ public function getRootAlias() * * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function getRootAliases() { @@ -515,7 +515,7 @@ public function getRootAliases() * * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function getAllAliases() { @@ -535,7 +535,7 @@ public function getAllAliases() * * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function getRootEntities() { @@ -603,7 +603,7 @@ public function setParameter($key, $value, $type = null) * * * @param ArrayCollection|mixed[] $parameters The query parameters to set. - * @psalm-param ArrayCollection|mixed[] $parameters + * @phpstan-param ArrayCollection|mixed[] $parameters * * @return $this */ @@ -611,7 +611,7 @@ public function setParameters($parameters) { // BC compatibility with 2.3- if (is_array($parameters)) { - /** @psalm-var ArrayCollection $parameterCollection */ + /** @phpstan-var ArrayCollection $parameterCollection */ $parameterCollection = new ArrayCollection(); foreach ($parameters as $key => $value) { @@ -632,7 +632,7 @@ public function setParameters($parameters) * Gets all defined query parameters for the query being constructed. * * @return ArrayCollection The currently defined query parameters. - * @psalm-return ArrayCollection + * @phpstan-return ArrayCollection */ public function getParameters() { @@ -724,7 +724,7 @@ public function getMaxResults() * @param string $dqlPartName The DQL part name. * @param string|object|array $dqlPart An Expr object. * @param bool $append Whether to append (true) or replace (false). - * @psalm-param string|object|list|array{join: array} $dqlPart + * @phpstan-param string|object|list|array{join: array} $dqlPart * * @return $this */ @@ -1020,7 +1020,7 @@ public function indexBy($alias, $indexBy) * @param string|null $conditionType The condition type constant. Either ON or WITH. * @param string|Expr\Comparison|Expr\Composite|Expr\Func|null $condition The condition for the join. * @param string|null $indexBy The index for the join. - * @psalm-param Expr\Join::ON|Expr\Join::WITH|null $conditionType + * @phpstan-param Expr\Join::ON|Expr\Join::WITH|null $conditionType * * @return $this */ @@ -1047,7 +1047,7 @@ public function join($join, $alias, $conditionType = null, $condition = null, $i * @param string|null $conditionType The condition type constant. Either ON or WITH. * @param string|Expr\Comparison|Expr\Composite|Expr\Func|null $condition The condition for the join. * @param string|null $indexBy The index for the join. - * @psalm-param Expr\Join::ON|Expr\Join::WITH|null $conditionType + * @phpstan-param Expr\Join::ON|Expr\Join::WITH|null $conditionType * * @return $this */ @@ -1088,7 +1088,7 @@ public function innerJoin($join, $alias, $conditionType = null, $condition = nul * @param string|null $conditionType The condition type constant. Either ON or WITH. * @param string|Expr\Comparison|Expr\Composite|Expr\Func|null $condition The condition for the join. * @param string|null $indexBy The index for the join. - * @psalm-param Expr\Join::ON|Expr\Join::WITH|null $conditionType + * @phpstan-param Expr\Join::ON|Expr\Join::WITH|null $conditionType * * @return $this */ @@ -1438,7 +1438,7 @@ public function getDQLPart($queryPartName) /** * Gets all query parts. * - * @psalm-return array $dqlParts + * @phpstan-return array $dqlParts */ public function getDQLParts() { @@ -1498,7 +1498,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); @@ -1516,7 +1516,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/Repository/DefaultRepositoryFactory.php b/src/Repository/DefaultRepositoryFactory.php index a146c965b28..fb785e3fd92 100644 --- a/src/Repository/DefaultRepositoryFactory.php +++ b/src/Repository/DefaultRepositoryFactory.php @@ -20,7 +20,7 @@ final class DefaultRepositoryFactory implements RepositoryFactory * The list of EntityRepository instances. * * @var ObjectRepository[] - * @psalm-var array + * @phpstan-var array */ private $repositoryList = []; diff --git a/src/Tools/Console/Command/MappingDescribeCommand.php b/src/Tools/Console/Command/MappingDescribeCommand.php index babd432b31a..c6d91aadfdb 100644 --- a/src/Tools/Console/Command/MappingDescribeCommand.php +++ b/src/Tools/Console/Command/MappingDescribeCommand.php @@ -40,8 +40,8 @@ * * @link www.doctrine-project.org * - * @psalm-import-type AssociationMapping from ClassMetadata - * @psalm-import-type FieldMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type FieldMapping from ClassMetadata */ final class MappingDescribeCommand extends AbstractEntityManagerCommand { @@ -234,7 +234,7 @@ private function formatValue($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, $value): array { @@ -248,10 +248,10 @@ private function formatField(string $label, $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 { @@ -271,10 +271,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 45b46f6cad8..54d4086dbf6 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/ConvertDoctrine1Schema.php b/src/Tools/ConvertDoctrine1Schema.php index fb89e9598a5..1145608762c 100644 --- a/src/Tools/ConvertDoctrine1Schema.php +++ b/src/Tools/ConvertDoctrine1Schema.php @@ -47,7 +47,7 @@ class ConvertDoctrine1Schema * to convert the Doctrine 1 schema files from. * * @param string[]|string $from - * @psalm-param list|string $from + * @phpstan-param list|string $from */ public function __construct($from) { @@ -66,7 +66,7 @@ public function __construct($from) * Doctrine 1 schema. * * @return ClassMetadataInfo[] An array of ClassMetadataInfo instances - * @psalm-return list + * @phpstan-return list */ public function getMetadata() { diff --git a/src/Tools/EntityGenerator.php b/src/Tools/EntityGenerator.php index f47d177a780..76ae24f7268 100644 --- a/src/Tools/EntityGenerator.php +++ b/src/Tools/EntityGenerator.php @@ -190,7 +190,7 @@ class EntityGenerator /** * Hash-map for handle types. * - * @psalm-var array + * @phpstan-var array */ protected $typeAlias = [ Types::DATETIMETZ_MUTABLE => '\DateTime', @@ -214,7 +214,7 @@ class EntityGenerator /** * Hash-map to handle generator types string. * - * @psalm-var array + * @phpstan-var array */ protected static $generatorStrategyMap = [ ClassMetadataInfo::GENERATOR_TYPE_AUTO => 'AUTO', @@ -228,7 +228,7 @@ class EntityGenerator /** * Hash-map to handle the change tracking policy string. * - * @psalm-var array + * @phpstan-var array */ protected static $changeTrackingPolicyMap = [ ClassMetadataInfo::CHANGETRACKING_DEFERRED_IMPLICIT => 'DEFERRED_IMPLICIT', @@ -239,7 +239,7 @@ class EntityGenerator /** * Hash-map to handle the inheritance type string. * - * @psalm-var array + * @phpstan-var array */ protected static $inheritanceTypeMap = [ ClassMetadataInfo::INHERITANCE_TYPE_NONE => 'NONE', @@ -373,7 +373,7 @@ public function __construct() * Generates and writes entity classes for the given array of ClassMetadataInfo instances. * * @param string $outputDirectory - * @psalm-param list $metadatas + * @phpstan-param list $metadatas * * @return void */ @@ -532,7 +532,7 @@ public function setGenerateAnnotations($bool) * * @throws InvalidArgumentException * - * @psalm-assert self::FIELD_VISIBLE_* $visibility + * @phpstan-assert self::FIELD_VISIBLE_* $visibility */ public function setFieldVisibility($visibility) { @@ -819,7 +819,6 @@ static function ($type, $variable) use ($maxParamTypeLength) { * @return void * * @todo this won't work if there is a namespace in brackets and a class outside of it. - * @psalm-suppress UndefinedConstant */ protected function parseTokensInEntityFile($src) { @@ -926,7 +925,7 @@ protected function hasMethod($method, ClassMetadataInfo $metadata) /** * @return ReflectionClass[] - * @psalm-return array> + * @phpstan-return array> * * @throws ReflectionException */ @@ -1076,7 +1075,7 @@ protected function generateTableAnnotation(ClassMetadataInfo $metadata) /** * @param string $constraintName - * @psalm-param array> $constraints + * @phpstan-param array> $constraints * * @return string */ @@ -1243,7 +1242,7 @@ protected function generateEntityStubMethods(ClassMetadataInfo $metadata) } /** - * @psalm-param array $associationMapping + * @phpstan-param array $associationMapping * * @return bool */ @@ -1461,7 +1460,7 @@ function ($event) { } /** - * @psalm-param array $joinColumn + * @phpstan-param array $joinColumn * * @return string */ @@ -1783,7 +1782,7 @@ protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, Cla } /** - * @psalm-param array $embeddedClass + * @phpstan-param array $embeddedClass * * @return string */ @@ -1903,7 +1902,7 @@ protected function getIdGeneratorTypeString($type) return static::$generatorStrategyMap[$type]; } - /** @psalm-param array $fieldMapping */ + /** @phpstan-param array $fieldMapping */ private function nullableFieldExpression(array $fieldMapping): ?string { if (isset($fieldMapping['nullable']) && $fieldMapping['nullable'] === true) { @@ -1916,7 +1915,7 @@ private function nullableFieldExpression(array $fieldMapping): ?string /** * Exports (nested) option elements. * - * @psalm-param array $options + * @phpstan-param array $options */ private function exportTableOptions(array $options): string { diff --git a/src/Tools/Export/Driver/AbstractExporter.php b/src/Tools/Export/Driver/AbstractExporter.php index cfaa4770654..be53f852b08 100644 --- a/src/Tools/Export/Driver/AbstractExporter.php +++ b/src/Tools/Export/Driver/AbstractExporter.php @@ -73,7 +73,7 @@ abstract public function exportClassMetadata(ClassMetadataInfo $metadata); /** * Sets the array of ClassMetadata instances to export. * - * @psalm-param list $metadata + * @phpstan-param list $metadata * * @return void */ @@ -172,7 +172,7 @@ public function setExtension($extension) /** * @param int $type - * @psalm-param ClassMetadataInfo::INHERITANCE_TYPE_* $type + * @phpstan-param ClassMetadataInfo::INHERITANCE_TYPE_* $type * * @return string */ @@ -195,7 +195,7 @@ protected function _getInheritanceTypeString($type) /** * @param int $mode - * @psalm-param ClassMetadataInfo::FETCH_* $mode + * @phpstan-param ClassMetadataInfo::FETCH_* $mode * * @return string */ @@ -215,7 +215,7 @@ protected function _getFetchModeString($mode) /** * @param int $policy - * @psalm-param ClassMetadataInfo::CHANGETRACKING_* $policy + * @phpstan-param ClassMetadataInfo::CHANGETRACKING_* $policy * * @return string */ @@ -235,7 +235,7 @@ protected function _getChangeTrackingPolicyString($policy) /** * @param int $type - * @psalm-param ClassMetadataInfo::GENERATOR_TYPE_* $type + * @phpstan-param ClassMetadataInfo::GENERATOR_TYPE_* $type * * @return string */ diff --git a/src/Tools/Export/Driver/PhpExporter.php b/src/Tools/Export/Driver/PhpExporter.php index 8838011fe1d..8f6ee390b63 100644 --- a/src/Tools/Export/Driver/PhpExporter.php +++ b/src/Tools/Export/Driver/PhpExporter.php @@ -181,7 +181,7 @@ protected function _varExport($var) /** * @return string[] - * @psalm-return list + * @phpstan-return list */ private function processEntityListeners(ClassMetadataInfo $metadata): array { diff --git a/src/Tools/Export/Driver/YamlExporter.php b/src/Tools/Export/Driver/YamlExporter.php index 4b633f6dfbc..4fbf6b69523 100644 --- a/src/Tools/Export/Driver/YamlExporter.php +++ b/src/Tools/Export/Driver/YamlExporter.php @@ -230,9 +230,9 @@ protected function yamlDump($array, $inline = 2) } /** - * @psalm-param array $array + * @phpstan-param array $array * - * @psalm-return array&array{entityListeners: array>} + * @phpstan-return array&array{entityListeners: array>} */ private function processEntityListeners(ClassMetadataInfo $metadata, array $array): array { @@ -250,10 +250,10 @@ private function processEntityListeners(ClassMetadataInfo $metadata, array $arra } /** - * @psalm-param array{entityListeners: array>} $array - * @psalm-param list $entityListenerConfig + * @phpstan-param array{entityListeners: array>} $array + * @phpstan-param list $entityListenerConfig * - * @psalm-return array{entityListeners: array>} + * @phpstan-return array{entityListeners: array>} */ private function processEntityListenerConfig( array $array, diff --git a/src/Tools/Pagination/CountOutputWalker.php b/src/Tools/Pagination/CountOutputWalker.php index 92615f8aab5..df6537e6e40 100644 --- a/src/Tools/Pagination/CountOutputWalker.php +++ b/src/Tools/Pagination/CountOutputWalker.php @@ -34,7 +34,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 { @@ -52,7 +52,7 @@ class CountOutputWalker extends SqlOutputWalker * @param Query $query * @param ParserResult $parserResult * @param mixed[] $queryComponents - * @psalm-param array $queryComponents + * @phpstan-param array $queryComponents */ public function __construct($query, $parserResult, array $queryComponents) { diff --git a/src/Tools/Pagination/LimitSubqueryOutputWalker.php b/src/Tools/Pagination/LimitSubqueryOutputWalker.php index 0e858ce0ecb..95b9066db2b 100644 --- a/src/Tools/Pagination/LimitSubqueryOutputWalker.php +++ b/src/Tools/Pagination/LimitSubqueryOutputWalker.php @@ -53,7 +53,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 { @@ -98,7 +98,7 @@ class LimitSubqueryOutputWalker extends SqlOutputWalker * @param Query $query * @param ParserResult $parserResult * @param mixed[] $queryComponents - * @psalm-param array $queryComponents + * @phpstan-param array $queryComponents */ public function __construct($query, $parserResult, array $queryComponents) { @@ -437,7 +437,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/Pagination/Paginator.php b/src/Tools/Pagination/Paginator.php index 6e5e87a10e6..a0ac0bfef4d 100644 --- a/src/Tools/Pagination/Paginator.php +++ b/src/Tools/Pagination/Paginator.php @@ -98,7 +98,7 @@ public function getUseOutputWalkers() * @param bool|null $useOutputWalkers * * @return $this - * @psalm-return static + * @phpstan-return static */ public function setUseOutputWalkers($useOutputWalkers) { @@ -130,7 +130,7 @@ public function count() * {@inheritDoc} * * @return Traversable - * @psalm-return Traversable + * @phpstan-return Traversable */ #[ReturnTypeWillChange] public function getIterator() diff --git a/src/Tools/ResolveTargetEntityListener.php b/src/Tools/ResolveTargetEntityListener.php index 5b8d2167428..b6b650ef123 100644 --- a/src/Tools/ResolveTargetEntityListener.php +++ b/src/Tools/ResolveTargetEntityListener.php @@ -20,7 +20,7 @@ * Mechanism to overwrite interfaces or classes specified as association * targets. * - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ class ResolveTargetEntityListener implements EventSubscriber { @@ -43,7 +43,7 @@ public function getSubscribedEvents() * * @param string $originalEntity * @param string $newEntity - * @psalm-param array $mapping + * @phpstan-param array $mapping * * @return void */ diff --git a/src/Tools/SchemaTool.php b/src/Tools/SchemaTool.php index 262d0772598..c713674638f 100644 --- a/src/Tools/SchemaTool.php +++ b/src/Tools/SchemaTool.php @@ -48,10 +48,10 @@ * * @link www.doctrine-project.org * - * @psalm-import-type AssociationMapping from ClassMetadata - * @psalm-import-type DiscriminatorColumnMapping from ClassMetadata - * @psalm-import-type FieldMapping from ClassMetadata - * @psalm-import-type JoinColumnData from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type DiscriminatorColumnMapping from ClassMetadata + * @phpstan-import-type FieldMapping from ClassMetadata + * @phpstan-import-type JoinColumnData from ClassMetadata */ class SchemaTool { @@ -91,7 +91,7 @@ public function __construct(EntityManagerInterface $em) /** * Creates the database schema for the given array of ClassMetadata instances. * - * @psalm-param list $classes + * @phpstan-param list $classes * * @return void * @@ -115,7 +115,7 @@ public function createSchema(array $classes) * 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. */ @@ -129,7 +129,7 @@ public function getCreateSchemaSql(array $classes) /** * 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, @@ -188,7 +188,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 * * @return Schema * @@ -485,7 +485,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, @@ -554,11 +554,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 */ @@ -643,7 +643,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 { @@ -674,14 +674,14 @@ private function getDefiningClass(ClassMetadata $class, string $referencedColumn /** * Gathers columns and fk constraints that are required for one part of relationship. * - * @psalm-param array $joinColumns - * @psalm-param AssociationMapping $mapping - * @psalm-param list $primaryKeyColumns - * @psalm-param array $joinColumns + * @phpstan-param AssociationMapping $mapping + * @phpstan-param list $primaryKeyColumns + * @phpstan-param array * }> $addedFks - * @psalm-param array $blacklistedFks + * @phpstan-param array $blacklistedFks * * @throws MissingColumnException */ @@ -805,7 +805,7 @@ private function gatherRelationJoinColumns( } /** - * @psalm-param JoinColumnData|FieldMapping|DiscriminatorColumnMapping $mapping + * @phpstan-param JoinColumnData|FieldMapping|DiscriminatorColumnMapping $mapping * * @return mixed[] */ @@ -837,7 +837,7 @@ private function gatherColumnOptions(array $mapping): array * In any way when an exception is thrown it is suppressed since drop was * issued for all classes of the schema and some probably just don't exist. * - * @psalm-param list $classes + * @phpstan-param list $classes * * @return void */ @@ -889,7 +889,7 @@ public function getDropDatabaseSQL() /** * 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 212ad019846..34705f8b170 100644 --- a/src/Tools/SchemaValidator.php +++ b/src/Tools/SchemaValidator.php @@ -50,7 +50,7 @@ * * @link www.doctrine-project.com * - * @psalm-import-type FieldMapping from ClassMetadata + * @phpstan-import-type FieldMapping from ClassMetadata */ class SchemaValidator { @@ -94,7 +94,7 @@ public function __construct(EntityManagerInterface $em, bool $validatePropertyTy * 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() { @@ -116,7 +116,7 @@ public function validateMapping() * Validates a single class of the current. * * @return string[] - * @psalm-return list + * @phpstan-return list */ public function validateClass(ClassMetadataInfo $class) { diff --git a/src/UnitOfWork.php b/src/UnitOfWork.php index 2969a3e0e0f..cb1c2a6ee73 100644 --- a/src/UnitOfWork.php +++ b/src/UnitOfWork.php @@ -83,7 +83,7 @@ * * Internal note: This class contains highly performance-sensitive code. * - * @psalm-import-type AssociationMapping from ClassMetadata + * @phpstan-import-type AssociationMapping from ClassMetadata */ class UnitOfWork implements PropertyChangedListener { @@ -134,7 +134,7 @@ class UnitOfWork implements PropertyChangedListener * Keys are object ids (spl_object_id). * * @var mixed[] - * @psalm-var array> + * @phpstan-var array> */ private $entityIdentifiers = []; @@ -147,7 +147,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 $originalEntityData = []; @@ -155,7 +155,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 $entityChangeSets = []; @@ -163,7 +163,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 $entityStates = []; @@ -179,28 +179,28 @@ class UnitOfWork implements PropertyChangedListener /** * A list of all pending entity insertions. * - * @psalm-var array + * @phpstan-var array */ private $entityInsertions = []; /** * A list of all pending entity updates. * - * @psalm-var array + * @phpstan-var array */ private $entityUpdates = []; /** * Any pending extra updates that have been scheduled by persisters. * - * @psalm-var array}> + * @phpstan-var array}> */ private $extraUpdates = []; /** * A list of all pending entity deletions. * - * @psalm-var array + * @phpstan-var array */ private $entityDeletions = []; @@ -220,14 +220,14 @@ class UnitOfWork implements PropertyChangedListener /** * All pending collection deletions. * - * @psalm-var array> + * @phpstan-var array> */ private $collectionDeletions = []; /** * All pending collection updates. * - * @psalm-var array> + * @phpstan-var array> */ private $collectionUpdates = []; @@ -236,7 +236,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 $visitedCollections = []; @@ -247,7 +247,7 @@ 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 $pendingCollectionElementRemovals = []; @@ -261,14 +261,14 @@ class UnitOfWork implements PropertyChangedListener /** * The entity persister instances used to persist entity instances. * - * @psalm-var array + * @phpstan-var array */ private $persisters = []; /** * The collection persister instances used to persist collections. * - * @psalm-var array + * @phpstan-var array */ private $collectionPersisters = []; @@ -296,7 +296,7 @@ class UnitOfWork implements PropertyChangedListener /** * Orphaned entities that are scheduled for removal. * - * @psalm-var array + * @phpstan-var array */ private $orphanRemovals = []; @@ -623,7 +623,7 @@ private function executeExtraUpdates(): void * @param object $entity * * @return mixed[][] - * @psalm-return array + * @phpstan-return array */ public function & getEntityChangeSet($entity) { @@ -664,8 +664,8 @@ public function & getEntityChangeSet($entity) * * @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 * * @return void * @@ -934,7 +934,7 @@ public function computeChangeSets() * Computes the changes of an association. * * @param mixed $value The value of the association. - * @psalm-param AssociationMapping $assoc The association mapping. + * @phpstan-param AssociationMapping $assoc The association mapping. * * @throws ORMInvalidArgumentException * @throws ORMException @@ -1025,8 +1025,8 @@ private function computeAssociationChanges(array $assoc, $value): void /** * @param object $entity - * @psalm-param ClassMetadata $class - * @psalm-param T $entity + * @phpstan-param ClassMetadata $class + * @phpstan-param T $entity * * @template T of object */ @@ -1085,8 +1085,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 * * @return void * @@ -1225,8 +1225,8 @@ private function executeInserts(): void /** * @param object $entity - * @psalm-param ClassMetadata $class - * @psalm-param T $entity + * @phpstan-param ClassMetadata $class + * @phpstan-param T $entity * * @template T of object */ @@ -1597,7 +1597,7 @@ public function scheduleForUpdate($entity) * Extra updates for entities are stored as (entity, changeset) tuples. * * @param object $entity The entity for which to schedule an extra update. - * @psalm-param array $changeset The changeset of the entity (what to update). + * @phpstan-param array $changeset The changeset of the entity (what to update). * * @return void * @@ -1823,10 +1823,10 @@ public function getIdHashByEntity($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 * * @return int The entity state. - * @psalm-return self::STATE_* + * @phpstan-return self::STATE_* */ public function getEntityState($entity, $assume = null) { @@ -2029,7 +2029,7 @@ public function persist($entity) * the already visited entities to prevent infinite recursions. * * @param object $entity The entity to persist. - * @psalm-param array $visited The already visited entities. + * @phpstan-param array $visited The already visited entities. * * @throws ORMInvalidArgumentException * @throws UnexpectedValueException @@ -2114,7 +2114,7 @@ public function remove($entity) * the already visited entities to prevent infinite recursions. * * @param object $entity The entity to delete. - * @psalm-param array $visited The map of the already visited entities. + * @phpstan-param array $visited The map of the already visited entities. * * @throws ORMInvalidArgumentException If the instance is a detached entity. * @throws UnexpectedValueException @@ -2187,8 +2187,8 @@ public function merge($entity) * Executes a merge operation on an entity. * * @param object $entity - * @psalm-param AssociationMapping|null $assoc - * @psalm-param array $visited + * @phpstan-param AssociationMapping|null $assoc + * @phpstan-param array $visited * * @return object The managed copy of the entity. * @@ -2293,9 +2293,9 @@ private function doMerge( /** * @param object $entity * @param object $managedCopy - * @psalm-param ClassMetadata $class - * @psalm-param T $entity - * @psalm-param T $managedCopy + * @phpstan-param ClassMetadata $class + * @phpstan-param T $entity + * @phpstan-param T $managedCopy * * @throws OptimisticLockException * @@ -2328,7 +2328,7 @@ private function ensureVersionMatch( * Sets/adds associated managed copies into the previous entity's association field * * @param object $entity - * @psalm-param AssociationMapping $association + * @phpstan-param AssociationMapping $association */ private function updateAssociationWithMergedEntity( $entity, @@ -2443,8 +2443,8 @@ public function refresh($entity) * Executes a refresh operation on an entity. * * @param object $entity The entity to refresh. - * @psalm-param array $visited The already visited entities during cascades. - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param array $visited The already visited entities during cascades. + * @phpstan-param LockMode::*|null $lockMode * * @throws ORMInvalidArgumentException If the entity is not MANAGED. * @throws TransactionRequiredException @@ -2486,8 +2486,8 @@ private function doRefresh($entity, array &$visited, ?int $lockMode = null): voi * Cascades a refresh operation to associated entities. * * @param object $entity - * @psalm-param array $visited - * @psalm-param LockMode::*|null $lockMode + * @phpstan-param array $visited + * @phpstan-param LockMode::*|null $lockMode */ private function cascadeRefresh($entity, array &$visited, ?int $lockMode = null): void { @@ -2576,7 +2576,7 @@ static function ($assoc) { * * @param object $entity * @param object $managedCopy - * @psalm-param array $visited + * @phpstan-param array $visited */ private function cascadeMerge($entity, $managedCopy, array &$visited): void { @@ -2615,7 +2615,7 @@ static function ($assoc) { * Cascades the save operation to associated entities. * * @param object $entity - * @psalm-param array $visited + * @phpstan-param array $visited */ private function cascadePersist($entity, array &$visited): void { @@ -2680,7 +2680,7 @@ static function ($assoc) { * Cascades the delete operation to associated entities. * * @param object $entity - * @psalm-param array $visited + * @phpstan-param array $visited */ private function cascadeRemove($entity, array &$visited): void { @@ -2731,7 +2731,7 @@ static function ($assoc) { * * @param object $entity * @param int|DateTimeInterface|null $lockVersion - * @psalm-param LockMode::* $lockMode + * @phpstan-param LockMode::* $lockMode * * @throws ORMInvalidArgumentException * @throws TransactionRequiredException @@ -3221,7 +3221,7 @@ public function triggerEagerLoads() * * @param PersistentCollection[] $collections * @param array $mapping - * @psalm-param array{ + * @phpstan-param array{ * targetEntity: class-string, * sourceEntity: class-string, * mappedBy: string, @@ -3353,7 +3353,7 @@ public function getIdentityMap() * @param object $entity * * @return mixed[] - * @psalm-return array + * @phpstan-return array */ public function getOriginalEntityData($entity) { @@ -3536,7 +3536,7 @@ public function getEntityPersister($entityName) /** * Gets a collection persister for a collection-valued association. * - * @psalm-param AssociationMapping $association + * @phpstan-param AssociationMapping $association * * @return CollectionPersister */ @@ -3638,7 +3638,7 @@ public function propertyChanged($sender, $propertyName, $oldValue, $newValue) /** * Gets the currently scheduled entity insertions in this UnitOfWork. * - * @psalm-return array + * @phpstan-return array */ public function getScheduledEntityInsertions() { @@ -3648,7 +3648,7 @@ public function getScheduledEntityInsertions() /** * Gets the currently scheduled entity updates in this UnitOfWork. * - * @psalm-return array + * @phpstan-return array */ public function getScheduledEntityUpdates() { @@ -3658,7 +3658,7 @@ public function getScheduledEntityUpdates() /** * Gets the currently scheduled entity deletions in this UnitOfWork. * - * @psalm-return array + * @phpstan-return array */ public function getScheduledEntityDeletions() { @@ -3668,7 +3668,7 @@ public function getScheduledEntityDeletions() /** * Gets the currently scheduled complete collection deletions * - * @psalm-return array> + * @phpstan-return array> */ public function getScheduledCollectionDeletions() { @@ -3678,7 +3678,7 @@ public function getScheduledCollectionDeletions() /** * Gets the currently scheduled collection inserts, updates and deletes. * - * @psalm-return array> + * @phpstan-return array> */ public function getScheduledCollectionUpdates() { @@ -3710,7 +3710,7 @@ public function initializeObject($obj) * * @param mixed $obj * - * @psalm-assert-if-true InternalProxy $obj + * @phpstan-assert-if-true InternalProxy $obj */ public function isUninitializedObject($obj): bool { diff --git a/src/Utility/HierarchyDiscriminatorResolver.php b/src/Utility/HierarchyDiscriminatorResolver.php index 6605c6e3e14..ee97f1183cf 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 8df8eb9ca2f..27ad79bd1f4 100644 --- a/src/Utility/IdentifierFlattener.php +++ b/src/Utility/IdentifierFlattener.php @@ -48,7 +48,7 @@ public function __construct(UnitOfWork $unitOfWork, ClassMetadataFactory $metada * @param mixed[] $id * * @return mixed[] - * @psalm-return array + * @phpstan-return array */ public function flattenIdentifier(ClassMetadata $class, array $id): array { diff --git a/tests/StaticAnalysis/Tools/Pagination/paginator-covariant.php b/tests/StaticAnalysis/Tools/Pagination/paginator-covariant.php index b49a731d837..6f2033b39ea 100644 --- a/tests/StaticAnalysis/Tools/Pagination/paginator-covariant.php +++ b/tests/StaticAnalysis/Tools/Pagination/paginator-covariant.php @@ -31,7 +31,7 @@ public function getClass(): string } /** - * @psalm-return Paginator + * @phpstan-return Paginator */ abstract public function createPaginator(): Paginator; } diff --git a/tests/Tests/Mocks/ConcurrentRegionMock.php b/tests/Tests/Mocks/ConcurrentRegionMock.php index 59bbc04728d..89ac562a2fc 100644 --- a/tests/Tests/Mocks/ConcurrentRegionMock.php +++ b/tests/Tests/Mocks/ConcurrentRegionMock.php @@ -22,13 +22,13 @@ */ class ConcurrentRegionMock implements ConcurrentRegion { - /** @psalm-var array>> */ + /** @phpstan-var array>> */ public $calls = []; - /** @psalm-var array> */ + /** @phpstan-var array> */ public $exceptions = []; - /** @psalm-var array */ + /** @phpstan-var array */ public $locks = []; /** @var Region */ diff --git a/tests/Tests/Mocks/EntityPersisterMock.php b/tests/Tests/Mocks/EntityPersisterMock.php index 4b17b42b96c..1d44c2fd81d 100644 --- a/tests/Tests/Mocks/EntityPersisterMock.php +++ b/tests/Tests/Mocks/EntityPersisterMock.php @@ -28,7 +28,7 @@ class EntityPersisterMock extends BasicEntityPersister /** @var int|null */ private $mockIdGeneratorType; - /** @psalm-var list */ + /** @phpstan-var list */ private $postInsertIds = []; /** @var bool */ @@ -48,7 +48,7 @@ public function addInsert($entity): void ]; } - /** @psalm-return list */ + /** @phpstan-return list */ public function executeInserts(): array { return $this->postInsertIds; 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 d7e284f499c..b815afa58ed 100644 --- a/tests/Tests/Models/CMS/CmsGroup.php +++ b/tests/Tests/Models/CMS/CmsGroup.php @@ -37,7 +37,7 @@ class CmsGroup implements IteratorAggregate public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CmsUser", mappedBy="groups") */ public $users; @@ -62,7 +62,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 aa0325dafda..9153b0a8d6c 100644 --- a/tests/Tests/Models/CMS/CmsTag.php +++ b/tests/Tests/Models/CMS/CmsTag.php @@ -35,7 +35,7 @@ class CmsTag public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CmsUser", mappedBy="tags") */ public $users; @@ -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/CmsUser.php b/tests/Tests/Models/CMS/CmsUser.php index 3856ed7445c..641f4b467dc 100644 --- a/tests/Tests/Models/CMS/CmsUser.php +++ b/tests/Tests/Models/CMS/CmsUser.php @@ -162,19 +162,19 @@ class CmsUser public $username; /** - * @psalm-var string|null + * @phpstan-var string|null * @Column(type="string", length=255) */ public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="CmsPhonenumber", mappedBy="user", cascade={"persist", "merge"}, orphanRemoval=true) */ public $phonenumbers; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="CmsArticle", mappedBy="user", cascade={"detach"}) */ public $articles; @@ -193,7 +193,7 @@ class CmsUser public $email; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CmsGroup", inversedBy="users", cascade={"persist", "merge", "detach"}) * @JoinTable(name="cms_users_groups", * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, @@ -255,7 +255,7 @@ public function addPhonenumber(CmsPhonenumber $phone): void $phone->setUser($this); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getPhonenumbers(): Collection { return $this->phonenumbers; @@ -273,7 +273,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/Action.php b/tests/Tests/Models/Cache/Action.php index 1ea4eb91538..ffe80e63a04 100644 --- a/tests/Tests/Models/Cache/Action.php +++ b/tests/Tests/Models/Cache/Action.php @@ -28,7 +28,7 @@ class Action public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Token", cascade={"persist", "remove"}, mappedBy="action") */ public $tokens; diff --git a/tests/Tests/Models/Cache/Attraction.php b/tests/Tests/Models/Cache/Attraction.php index 980bd3b0dcc..51fd5e6f729 100644 --- a/tests/Tests/Models/Cache/Attraction.php +++ b/tests/Tests/Models/Cache/Attraction.php @@ -54,7 +54,7 @@ abstract class Attraction protected $city; /** - * @psalm-var Collection + * @phpstan-var Collection * @Cache * @OneToMany(targetEntity="AttractionInfo", mappedBy="attraction") */ @@ -97,7 +97,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 e86b9b63c5a..56a83e97e79 100644 --- a/tests/Tests/Models/Cache/City.php +++ b/tests/Tests/Models/Cache/City.php @@ -67,7 +67,7 @@ class City public $travels; /** - * @psalm-var Collection + * @phpstan-var Collection * @Cache * @OrderBy({"name" = "ASC"}) * @OneToMany(targetEntity="Attraction", mappedBy="city") @@ -120,7 +120,7 @@ public function addTravel(Travel $travel): void $this->travels[] = $travel; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getTravels(): Collection { return $this->travels; @@ -131,7 +131,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/ComplexAction.php b/tests/Tests/Models/Cache/ComplexAction.php index 1999dacec83..a642ce571df 100644 --- a/tests/Tests/Models/Cache/ComplexAction.php +++ b/tests/Tests/Models/Cache/ComplexAction.php @@ -43,7 +43,7 @@ class ComplexAction public $action2; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Token", cascade={"persist", "remove"}, mappedBy="complexAction") */ public $tokens; diff --git a/tests/Tests/Models/Cache/State.php b/tests/Tests/Models/Cache/State.php index 7fa13f4b5b8..c34b4244426 100644 --- a/tests/Tests/Models/Cache/State.php +++ b/tests/Tests/Models/Cache/State.php @@ -46,7 +46,7 @@ class State protected $country; /** - * @psalm-var Collection + * @phpstan-var Collection * @Cache("NONSTRICT_READ_WRITE") * @OneToMany(targetEntity="City", mappedBy="state") */ @@ -89,13 +89,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/Token.php b/tests/Tests/Models/Cache/Token.php index 048ebfeaba6..2af7a474223 100644 --- a/tests/Tests/Models/Cache/Token.php +++ b/tests/Tests/Models/Cache/Token.php @@ -48,7 +48,7 @@ class Token public $client; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Login", cascade={"persist", "remove"}, mappedBy="token") */ public $logins; diff --git a/tests/Tests/Models/Cache/Travel.php b/tests/Tests/Models/Cache/Travel.php index e98d06f0dd3..67957fdfd0c 100644 --- a/tests/Tests/Models/Cache/Travel.php +++ b/tests/Tests/Models/Cache/Travel.php @@ -48,7 +48,7 @@ class Travel protected $traveler; /** - * @psalm-var Collection + * @phpstan-var Collection * @Cache * @ManyToMany(targetEntity="City", inversedBy="travels", cascade={"persist", "remove"}) * @JoinTable(name="cache_visited_cities", @@ -84,7 +84,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 9d1d77333e6..b8c75e9f2d9 100644 --- a/tests/Tests/Models/Cache/Traveler.php +++ b/tests/Tests/Models/Cache/Traveler.php @@ -37,7 +37,7 @@ class Traveler protected $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @Cache("NONSTRICT_READ_WRITE") * @OneToMany(targetEntity="Travel", mappedBy="traveler", cascade={"persist", "remove"}, orphanRemoval=true) */ @@ -86,7 +86,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 b1a601670c3..ea2ad7168a5 100644 --- a/tests/Tests/Models/Company/CompanyContract.php +++ b/tests/Tests/Models/Company/CompanyContract.php @@ -113,7 +113,7 @@ abstract class CompanyContract private $completed = false; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CompanyEmployee", inversedBy="contracts") * @JoinTable(name="company_contract_employees", * joinColumns={@JoinColumn(name="contract_id", referencedColumnName="id", onDelete="CASCADE")}, @@ -152,7 +152,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 26b4dc67bec..e32cfd7ed7d 100644 --- a/tests/Tests/Models/Company/CompanyContractListener.php +++ b/tests/Tests/Models/Company/CompanyContractListener.php @@ -18,28 +18,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; /** @PostPersist */ diff --git a/tests/Tests/Models/Company/CompanyEmployee.php b/tests/Tests/Models/Company/CompanyEmployee.php index c1d1d87690a..448fda34a2a 100644 --- a/tests/Tests/Models/Company/CompanyEmployee.php +++ b/tests/Tests/Models/Company/CompanyEmployee.php @@ -37,13 +37,13 @@ class CompanyEmployee extends CompanyPerson private $startDate; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CompanyContract", mappedBy="engineers", fetch="EXTRA_LAZY") */ public $contracts; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="CompanyFlexUltraContract", mappedBy="salesPerson", fetch="EXTRA_LAZY") */ public $soldContracts; diff --git a/tests/Tests/Models/Company/CompanyFlexContract.php b/tests/Tests/Models/Company/CompanyFlexContract.php index 82fb0f5fdd7..29391853d7c 100644 --- a/tests/Tests/Models/Company/CompanyFlexContract.php +++ b/tests/Tests/Models/Company/CompanyFlexContract.php @@ -78,7 +78,7 @@ class CompanyFlexContract extends CompanyContract private $pricePerHour = 0; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CompanyManager", inversedBy="managedContracts", fetch="EXTRA_LAZY") * @JoinTable(name="company_contract_managers", * joinColumns={@JoinColumn(name="contract_id", referencedColumnName="id", onDelete="CASCADE")}, @@ -112,7 +112,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 47dc298a2cd..f5f3953591e 100644 --- a/tests/Tests/Models/Company/CompanyFlexUltraContractListener.php +++ b/tests/Tests/Models/Company/CompanyFlexUltraContractListener.php @@ -12,7 +12,7 @@ class CompanyFlexUltraContractListener { - /** @psalm-var list */ + /** @phpstan-var list */ public $prePersistCalls; /** @PrePersist */ diff --git a/tests/Tests/Models/Company/CompanyManager.php b/tests/Tests/Models/Company/CompanyManager.php index c617e9ab3b2..cee3f0032bf 100644 --- a/tests/Tests/Models/Company/CompanyManager.php +++ b/tests/Tests/Models/Company/CompanyManager.php @@ -32,7 +32,7 @@ class CompanyManager extends CompanyEmployee private $car; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CompanyFlexContract", mappedBy="managers", fetch="EXTRA_LAZY") */ public $managedContracts; diff --git a/tests/Tests/Models/Company/CompanyOrganization.php b/tests/Tests/Models/Company/CompanyOrganization.php index 1d32b46347c..553cc2d5dd6 100644 --- a/tests/Tests/Models/Company/CompanyOrganization.php +++ b/tests/Tests/Models/Company/CompanyOrganization.php @@ -29,7 +29,7 @@ class CompanyOrganization private $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="CompanyEvent", mappedBy="organization", cascade={"persist"}, fetch="EXTRA_LAZY") */ public $events; @@ -39,7 +39,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 42e8d91c8b7..2b941fa5259 100644 --- a/tests/Tests/Models/Company/CompanyPerson.php +++ b/tests/Tests/Models/Company/CompanyPerson.php @@ -90,7 +90,7 @@ class CompanyPerson private $spouse; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CompanyPerson") * @JoinTable( * name="company_persons_friends", @@ -129,7 +129,7 @@ public function getSpouse(): ?CompanyPerson return $this->spouse; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getFriends(): Collection { return $this->friends; diff --git a/tests/Tests/Models/CustomType/CustomIdObjectTypeParent.php b/tests/Tests/Models/CustomType/CustomIdObjectTypeParent.php index 2e32f5e714d..3b811e5be4f 100644 --- a/tests/Tests/Models/CustomType/CustomIdObjectTypeParent.php +++ b/tests/Tests/Models/CustomType/CustomIdObjectTypeParent.php @@ -27,7 +27,7 @@ class CustomIdObjectTypeParent public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomIdObjectTypeChild", cascade={"persist", "remove"}, mappedBy="parent") */ public $children; diff --git a/tests/Tests/Models/CustomType/CustomTypeParent.php b/tests/Tests/Models/CustomType/CustomTypeParent.php index ef947af372c..377bdde353d 100644 --- a/tests/Tests/Models/CustomType/CustomTypeParent.php +++ b/tests/Tests/Models/CustomType/CustomTypeParent.php @@ -43,13 +43,13 @@ class CustomTypeParent public $child; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeParent", mappedBy="myFriends") */ private $friendsWithMe; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="Doctrine\Tests\Models\CustomType\CustomTypeParent", inversedBy="friendsWithMe") * @JoinTable( * name="customtype_parent_friends", @@ -71,7 +71,7 @@ public function addMyFriend(CustomTypeParent $friend): void $friend->addFriendWithMe($this); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getMyFriends(): Collection { return $this->myFriends; @@ -82,7 +82,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/DDC117/DDC117Article.php b/tests/Tests/Models/DDC117/DDC117Article.php index 1fc80f1d6ee..2d2d4e641cc 100644 --- a/tests/Tests/Models/DDC117/DDC117Article.php +++ b/tests/Tests/Models/DDC117/DDC117Article.php @@ -31,7 +31,7 @@ class DDC117Article private $title; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC117Reference", mappedBy="source", cascade={"remove"}) */ private $references; @@ -43,7 +43,7 @@ class DDC117Article private $details; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC117Translation", mappedBy="article", cascade={"persist", "remove"}) */ private $translations; diff --git a/tests/Tests/Models/DDC117/DDC117Editor.php b/tests/Tests/Models/DDC117/DDC117Editor.php index 39499698ee1..82a03bce622 100644 --- a/tests/Tests/Models/DDC117/DDC117Editor.php +++ b/tests/Tests/Models/DDC117/DDC117Editor.php @@ -34,7 +34,7 @@ class DDC117Editor public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC117Translation", inversedBy="reviewedByEditors") * @JoinTable( * inverseJoinColumns={ diff --git a/tests/Tests/Models/DDC3579/DDC3579Group.php b/tests/Tests/Models/DDC3579/DDC3579Group.php index 868d74e156c..55b186ddc5e 100644 --- a/tests/Tests/Models/DDC3579/DDC3579Group.php +++ b/tests/Tests/Models/DDC3579/DDC3579Group.php @@ -35,7 +35,7 @@ class DDC3579Group private $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC3579Admin", mappedBy="groups") */ #[ManyToMany(targetEntity: DDC3579Admin::class, mappedBy: 'groups')] @@ -62,7 +62,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/DDC3699/DDC3699Child.php b/tests/Tests/Models/DDC3699/DDC3699Child.php index d9f48ceb025..9ef7fb1610b 100644 --- a/tests/Tests/Models/DDC3699/DDC3699Child.php +++ b/tests/Tests/Models/DDC3699/DDC3699Child.php @@ -38,7 +38,7 @@ class DDC3699Child extends DDC3699Parent public $oneRelation; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3699RelationMany", mappedBy="child") */ public $relations; diff --git a/tests/Tests/Models/DDC3899/DDC3899User.php b/tests/Tests/Models/DDC3899/DDC3899User.php index 998f858c3b7..06e5d90cc1a 100644 --- a/tests/Tests/Models/DDC3899/DDC3899User.php +++ b/tests/Tests/Models/DDC3899/DDC3899User.php @@ -25,7 +25,7 @@ class DDC3899User public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3899Contract", mappedBy="user") */ public $contracts; diff --git a/tests/Tests/Models/DDC5934/DDC5934BaseContract.php b/tests/Tests/Models/DDC5934/DDC5934BaseContract.php index 0e06ab575ab..58beefa2b80 100644 --- a/tests/Tests/Models/DDC5934/DDC5934BaseContract.php +++ b/tests/Tests/Models/DDC5934/DDC5934BaseContract.php @@ -29,7 +29,7 @@ class DDC5934BaseContract public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC5934Member", fetch="LAZY", inversedBy="contracts") */ #[ManyToMany(targetEntity: DDC5934Member::class, fetch: 'LAZY', inversedBy: 'contracts')] diff --git a/tests/Tests/Models/DDC964/DDC964Group.php b/tests/Tests/Models/DDC964/DDC964Group.php index ca7d72f12a4..8c6704e48bc 100644 --- a/tests/Tests/Models/DDC964/DDC964Group.php +++ b/tests/Tests/Models/DDC964/DDC964Group.php @@ -29,7 +29,7 @@ class DDC964Group private $name; /** - * @psalm-var ArrayCollection + * @phpstan-var ArrayCollection * @ManyToMany(targetEntity="DDC964User", mappedBy="groups") */ private $users; @@ -55,7 +55,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 296e0d22574..6b99bcbbc8f 100644 --- a/tests/Tests/Models/DDC964/DDC964User.php +++ b/tests/Tests/Models/DDC964/DDC964User.php @@ -40,7 +40,7 @@ class DDC964User protected $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC964Group", inversedBy="users", cascade={"persist", "merge", "detach"}) * @JoinTable(name="ddc964_users_groups", * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, @@ -89,7 +89,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 c360859c2ef..fbae823a530 100644 --- a/tests/Tests/Models/ECommerce/ECommerceCart.php +++ b/tests/Tests/Models/ECommerce/ECommerceCart.php @@ -47,7 +47,7 @@ class ECommerceCart private $customer; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="ECommerceProduct", cascade={"persist"}) * @JoinTable(name="ecommerce_carts_products", * joinColumns={@JoinColumn(name="cart_id", referencedColumnName="id")}, @@ -97,7 +97,7 @@ public function getCustomer(): ?ECommerceCustomer 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 e91c205370b..cb9db0e18ca 100644 --- a/tests/Tests/Models/ECommerce/ECommerceCategory.php +++ b/tests/Tests/Models/ECommerce/ECommerceCategory.php @@ -40,13 +40,13 @@ class ECommerceCategory private $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="ECommerceProduct", mappedBy="categories") */ private $products; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="ECommerceCategory", mappedBy="parent", cascade={"persist"}) */ private $children; @@ -95,7 +95,7 @@ public function removeProduct(ECommerceProduct $product): void } } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getProducts(): Collection { return $this->products; @@ -106,7 +106,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 c4111879e0c..26318df1eb2 100644 --- a/tests/Tests/Models/ECommerce/ECommerceProduct.php +++ b/tests/Tests/Models/ECommerce/ECommerceProduct.php @@ -49,13 +49,13 @@ class ECommerceProduct private $shipping; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="ECommerceFeature", mappedBy="product", cascade={"persist"}) */ private $features; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="ECommerceCategory", cascade={"persist"}, inversedBy="products") * @JoinTable(name="ecommerce_products_categories", * joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")}, @@ -67,7 +67,7 @@ class ECommerceProduct * This relation is saved with two records in the association table for * simplicity. * - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="ECommerceProduct", cascade={"persist"}) * @JoinTable(name="ecommerce_products_related", * joinColumns={@JoinColumn(name="product_id", referencedColumnName="id")}, @@ -118,7 +118,7 @@ public function removeShipping(): void $this->shipping = null; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getFeatures(): Collection { return $this->features; @@ -162,19 +162,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..f70cc6f3653 100644 --- a/tests/Tests/Models/Enums/FaultySwitch.php +++ b/tests/Tests/Models/Enums/FaultySwitch.php @@ -15,7 +15,7 @@ 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 + * @phpstan-suppress InvalidArgument */ #[Column(enumType: SwitchStatus::class)] public SwitchStatus $status; diff --git a/tests/Tests/Models/Forum/ForumCategory.php b/tests/Tests/Models/Forum/ForumCategory.php index 781fd65cb2d..9cac94b8507 100644 --- a/tests/Tests/Models/Forum/ForumCategory.php +++ b/tests/Tests/Models/Forum/ForumCategory.php @@ -37,7 +37,7 @@ class ForumCategory public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="ForumBoard", mappedBy="category") */ public $boards; 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/GeoNames/Admin1.php b/tests/Tests/Models/GeoNames/Admin1.php index 633e312ac95..a155b9e46f6 100644 --- a/tests/Tests/Models/GeoNames/Admin1.php +++ b/tests/Tests/Models/GeoNames/Admin1.php @@ -39,7 +39,7 @@ class Admin1 public $country; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Admin1AlternateName", mappedBy="admin1") * @Cache */ diff --git a/tests/Tests/Models/Global/GlobalNamespaceModel.php b/tests/Tests/Models/Global/GlobalNamespaceModel.php index 5c2d651aa08..5ee5cf516d0 100644 --- a/tests/Tests/Models/Global/GlobalNamespaceModel.php +++ b/tests/Tests/Models/Global/GlobalNamespaceModel.php @@ -37,7 +37,7 @@ class DoctrineGlobalArticle protected $text; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DoctrineGlobalUser") * @JoinTable(name="author_articles", * joinColumns={@JoinColumn(name="article_id", referencedColumnName="id")}, @@ -47,7 +47,7 @@ class DoctrineGlobalArticle protected $author; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DoctrineGlobalUser") * @JoinTable(name="editor_articles", * joinColumns={@JoinColumn(name="article_id", referencedColumnName="id")}, diff --git a/tests/Tests/Models/Hydration/EntityWithArrayDefaultArrayValueM2M.php b/tests/Tests/Models/Hydration/EntityWithArrayDefaultArrayValueM2M.php index 6c14f41f7ca..39b9e626177 100644 --- a/tests/Tests/Models/Hydration/EntityWithArrayDefaultArrayValueM2M.php +++ b/tests/Tests/Models/Hydration/EntityWithArrayDefaultArrayValueM2M.php @@ -23,7 +23,7 @@ class EntityWithArrayDefaultArrayValueM2M public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity=SimpleEntity::class) */ public $collection = []; diff --git a/tests/Tests/Models/Legacy/LegacyCar.php b/tests/Tests/Models/Legacy/LegacyCar.php index 75c013a3ec8..e22c45c1e28 100644 --- a/tests/Tests/Models/Legacy/LegacyCar.php +++ b/tests/Tests/Models/Legacy/LegacyCar.php @@ -27,7 +27,7 @@ class LegacyCar public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="LegacyUser", mappedBy="cars") */ public $users; @@ -48,7 +48,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 b25bc6d067a..009a954949c 100644 --- a/tests/Tests/Models/Legacy/LegacyUser.php +++ b/tests/Tests/Models/Legacy/LegacyUser.php @@ -43,19 +43,19 @@ class LegacyUser public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="LegacyArticle", mappedBy="user") */ public $articles; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="LegacyUserReference", mappedBy="_source", cascade={"remove"}) */ public $references; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="LegacyCar", inversedBy="users", cascade={"persist", "merge"}) * @JoinTable(name="legacy_users_cars", * joinColumns={@JoinColumn(name="iUserId", referencedColumnName="iUserId")}, @@ -92,7 +92,7 @@ public function addReference(LegacyUserReference $reference): void $this->references[] = $reference; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function references(): Collection { return $this->references; @@ -104,7 +104,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 f8d9a560a0f..7bab5fe81ad 100644 --- a/tests/Tests/Models/ManyToManyPersister/ChildClass.php +++ b/tests/Tests/Models/ManyToManyPersister/ChildClass.php @@ -47,7 +47,7 @@ class ChildClass * inverseJoinColumns={@JoinColumn(name="parent_id", referencedColumnName="id")} * ) * @var Collection|ParentClass[] - * @psalm-var Collection + * @phpstan-var Collection */ public $parents; diff --git a/tests/Tests/Models/ManyToManyPersister/ParentClass.php b/tests/Tests/Models/ManyToManyPersister/ParentClass.php index 8600710efcd..e69a8cfe0a0 100644 --- a/tests/Tests/Models/ManyToManyPersister/ParentClass.php +++ b/tests/Tests/Models/ManyToManyPersister/ParentClass.php @@ -28,7 +28,7 @@ class ParentClass /** * @ManyToMany(targetEntity=ChildClass::class, mappedBy="parents", orphanRemoval=true, cascade={"persist"}) * @var Collection|ChildClass[] - * @psalm-var Collection + * @phpstan-var Collection */ public $children; diff --git a/tests/Tests/Models/Navigation/NavCountry.php b/tests/Tests/Models/Navigation/NavCountry.php index 47476e015cc..276d08e17b2 100644 --- a/tests/Tests/Models/Navigation/NavCountry.php +++ b/tests/Tests/Models/Navigation/NavCountry.php @@ -33,7 +33,7 @@ class NavCountry private $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="NavPointOfInterest", mappedBy="country") */ private $pois; diff --git a/tests/Tests/Models/Navigation/NavPointOfInterest.php b/tests/Tests/Models/Navigation/NavPointOfInterest.php index 2041fed32bb..d2ff469cede 100644 --- a/tests/Tests/Models/Navigation/NavPointOfInterest.php +++ b/tests/Tests/Models/Navigation/NavPointOfInterest.php @@ -48,7 +48,7 @@ class NavPointOfInterest private $country; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="NavUser", cascade={"persist"}) * @JoinTable(name="navigation_pois_visitors", * inverseJoinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, @@ -94,7 +94,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/Pagination/Company.php b/tests/Tests/Models/Pagination/Company.php index fa4309c69cd..03e95c88f3b 100644 --- a/tests/Tests/Models/Pagination/Company.php +++ b/tests/Tests/Models/Pagination/Company.php @@ -48,7 +48,7 @@ class Company public $logo; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Department", mappedBy="company", cascade={"persist"}, orphanRemoval=true) */ public $departments; diff --git a/tests/Tests/Models/Quote/Group.php b/tests/Tests/Models/Quote/Group.php index 4e2dd6d2602..956a47ffd41 100644 --- a/tests/Tests/Models/Quote/Group.php +++ b/tests/Tests/Models/Quote/Group.php @@ -42,7 +42,7 @@ class Group public $parent; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="User", mappedBy="groups") */ public $users; diff --git a/tests/Tests/Models/Quote/User.php b/tests/Tests/Models/Quote/User.php index b2c13772cba..2724f96818b 100644 --- a/tests/Tests/Models/Quote/User.php +++ b/tests/Tests/Models/Quote/User.php @@ -38,7 +38,7 @@ class User public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Phone", mappedBy="user", cascade={"persist"}) */ public $phones; @@ -50,7 +50,7 @@ class User public $address; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="Group", inversedBy="users", cascade={"all"}, fetch="EXTRA_LAZY") * @JoinTable(name="`quote-users-groups`", * joinColumns={ @@ -75,7 +75,7 @@ public function __construct() $this->groups = new ArrayCollection(); } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getPhones(): Collection { return $this->phones; @@ -86,7 +86,7 @@ public function getAddress(): ?Address return $this->address; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getGroups(): Collection { return $this->groups; diff --git a/tests/Tests/Models/StockExchange/Market.php b/tests/Tests/Models/StockExchange/Market.php index d43a4de3c90..6753e99874f 100644 --- a/tests/Tests/Models/StockExchange/Market.php +++ b/tests/Tests/Models/StockExchange/Market.php @@ -34,7 +34,7 @@ class Market /** * @OneToMany(targetEntity="Stock", mappedBy="market", indexBy="symbol") - * @psalm-var ArrayCollection + * @phpstan-var ArrayCollection */ public $stocks; diff --git a/tests/Tests/Models/Taxi/Car.php b/tests/Tests/Models/Taxi/Car.php index 0539c5faa7f..acbe7211590 100644 --- a/tests/Tests/Models/Taxi/Car.php +++ b/tests/Tests/Models/Taxi/Car.php @@ -33,13 +33,13 @@ class Car private $model; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Ride", mappedBy="car") */ private $freeCarRides; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="PaidRide", mappedBy="car") */ private $carRides; diff --git a/tests/Tests/Models/Taxi/Driver.php b/tests/Tests/Models/Taxi/Driver.php index 123616580ba..643d2884d31 100644 --- a/tests/Tests/Models/Taxi/Driver.php +++ b/tests/Tests/Models/Taxi/Driver.php @@ -33,13 +33,13 @@ class Driver private $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Ride", mappedBy="driver") */ private $freeDriverRides; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="PaidRide", mappedBy="driver") */ private $driverRides; diff --git a/tests/Tests/Models/Tweet/User.php b/tests/Tests/Models/Tweet/User.php index b134136ab0f..9a3cfa948e3 100644 --- a/tests/Tests/Models/Tweet/User.php +++ b/tests/Tests/Models/Tweet/User.php @@ -34,13 +34,13 @@ class User public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Tweet", mappedBy="author", cascade={"persist"}, fetch="EXTRA_LAZY") */ public $tweets; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="UserList", mappedBy="owner", fetch="EXTRA_LAZY", orphanRemoval=true) */ public $userLists; diff --git a/tests/Tests/Models/ValueConversionType/InversedManyToManyCompositeIdEntity.php b/tests/Tests/Models/ValueConversionType/InversedManyToManyCompositeIdEntity.php index a3c495ede67..9f2e4d0d438 100644 --- a/tests/Tests/Models/ValueConversionType/InversedManyToManyCompositeIdEntity.php +++ b/tests/Tests/Models/ValueConversionType/InversedManyToManyCompositeIdEntity.php @@ -33,7 +33,7 @@ class InversedManyToManyCompositeIdEntity public $id2; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="OwningManyToManyCompositeIdEntity", mappedBy="associatedEntities") */ public $associatedEntities; diff --git a/tests/Tests/Models/ValueConversionType/InversedManyToManyCompositeIdForeignKeyEntity.php b/tests/Tests/Models/ValueConversionType/InversedManyToManyCompositeIdForeignKeyEntity.php index d86ee008ee0..06c7cdbfb3b 100644 --- a/tests/Tests/Models/ValueConversionType/InversedManyToManyCompositeIdForeignKeyEntity.php +++ b/tests/Tests/Models/ValueConversionType/InversedManyToManyCompositeIdForeignKeyEntity.php @@ -36,7 +36,7 @@ class InversedManyToManyCompositeIdForeignKeyEntity public $foreignEntity; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="OwningManyToManyCompositeIdForeignKeyEntity", mappedBy="associatedEntities") */ public $associatedEntities; diff --git a/tests/Tests/Models/ValueConversionType/InversedManyToManyEntity.php b/tests/Tests/Models/ValueConversionType/InversedManyToManyEntity.php index 94d499fdbe8..c34226b7843 100644 --- a/tests/Tests/Models/ValueConversionType/InversedManyToManyEntity.php +++ b/tests/Tests/Models/ValueConversionType/InversedManyToManyEntity.php @@ -26,7 +26,7 @@ class InversedManyToManyEntity public $id1; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="OwningManyToManyEntity", mappedBy="associatedEntities") */ public $associatedEntities; diff --git a/tests/Tests/Models/ValueConversionType/InversedOneToManyCompositeIdEntity.php b/tests/Tests/Models/ValueConversionType/InversedOneToManyCompositeIdEntity.php index 066674be04d..6068ebc812a 100644 --- a/tests/Tests/Models/ValueConversionType/InversedOneToManyCompositeIdEntity.php +++ b/tests/Tests/Models/ValueConversionType/InversedOneToManyCompositeIdEntity.php @@ -39,7 +39,7 @@ class InversedOneToManyCompositeIdEntity public $someProperty; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="OwningManyToOneCompositeIdEntity", mappedBy="associatedEntity") */ public $associatedEntities; diff --git a/tests/Tests/Models/ValueConversionType/InversedOneToManyCompositeIdForeignKeyEntity.php b/tests/Tests/Models/ValueConversionType/InversedOneToManyCompositeIdForeignKeyEntity.php index 944379eec6c..07987f201a4 100644 --- a/tests/Tests/Models/ValueConversionType/InversedOneToManyCompositeIdForeignKeyEntity.php +++ b/tests/Tests/Models/ValueConversionType/InversedOneToManyCompositeIdForeignKeyEntity.php @@ -42,7 +42,7 @@ class InversedOneToManyCompositeIdForeignKeyEntity public $someProperty; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="OwningManyToOneCompositeIdForeignKeyEntity", mappedBy="associatedEntity") */ public $associatedEntities; diff --git a/tests/Tests/Models/ValueConversionType/InversedOneToManyEntity.php b/tests/Tests/Models/ValueConversionType/InversedOneToManyEntity.php index 9d69f8c28a4..bb586e2b07d 100644 --- a/tests/Tests/Models/ValueConversionType/InversedOneToManyEntity.php +++ b/tests/Tests/Models/ValueConversionType/InversedOneToManyEntity.php @@ -26,7 +26,7 @@ class InversedOneToManyEntity public $id1; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="OwningManyToOneEntity", mappedBy="associatedEntity") */ public $associatedEntities; diff --git a/tests/Tests/ORM/Cache/RegionTestCase.php b/tests/Tests/ORM/Cache/RegionTestCase.php index 7ff833fa83c..7f7379ecc34 100644 --- a/tests/Tests/ORM/Cache/RegionTestCase.php +++ b/tests/Tests/ORM/Cache/RegionTestCase.php @@ -21,7 +21,7 @@ abstract class RegionTestCase extends OrmFunctionalTestCase { /** * @var Region - * @psalm-var TRegion + * @phpstan-var TRegion */ protected $region; @@ -36,10 +36,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/Decorator/EntityManagerDecoratorTest.php b/tests/Tests/ORM/Decorator/EntityManagerDecoratorTest.php index 55af448fcde..6d67a2dfcba 100644 --- a/tests/Tests/ORM/Decorator/EntityManagerDecoratorTest.php +++ b/tests/Tests/ORM/Decorator/EntityManagerDecoratorTest.php @@ -48,7 +48,7 @@ protected function setUp(): void $this->wrapped = $this->createMock(EntityManagerInterface::class); } - /** @psalm-return Generator */ + /** @phpstan-return Generator */ public static function getMethodParameters(): Generator { $class = new ReflectionClass(EntityManagerInterface::class); diff --git a/tests/Tests/ORM/EntityManagerTest.php b/tests/Tests/ORM/EntityManagerTest.php index 202560602cd..98ad1cc01d3 100644 --- a/tests/Tests/ORM/EntityManagerTest.php +++ b/tests/Tests/ORM/EntityManagerTest.php @@ -160,7 +160,7 @@ public function testCreateNamedQuery(): void self::assertEquals('SELECT 1', $query->getDql()); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function dataMethodsAffectedByNoObjectArguments(): array { return [ @@ -181,7 +181,7 @@ public function testThrowsExceptionOnNonObjectValues($methodName): void $this->entityManager->$methodName(null); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function dataAffectedByErrorIfClosedException(): array { return [ diff --git a/tests/Tests/ORM/Functional/AdvancedAssociationTest.php b/tests/Tests/ORM/Functional/AdvancedAssociationTest.php index 4fb5a3146f1..0c66b857b05 100644 --- a/tests/Tests/ORM/Functional/AdvancedAssociationTest.php +++ b/tests/Tests/ORM/Functional/AdvancedAssociationTest.php @@ -340,7 +340,7 @@ class Phrase private $type; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Definition", mappedBy="phrase", cascade={"persist"}) */ private $definitions; @@ -416,7 +416,7 @@ class PhraseType private $abbreviation; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Phrase", mappedBy="type") */ private $phrases; diff --git a/tests/Tests/ORM/Functional/CascadeRemoveOrderTest.php b/tests/Tests/ORM/Functional/CascadeRemoveOrderTest.php index 0f8e70ed7b0..5d17a875bb1 100644 --- a/tests/Tests/ORM/Functional/CascadeRemoveOrderTest.php +++ b/tests/Tests/ORM/Functional/CascadeRemoveOrderTest.php @@ -88,7 +88,7 @@ class CascadeRemoveOrderEntityO private $oneToOneG; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany( * targetEntity="Doctrine\Tests\ORM\Functional\CascadeRemoveOrderEntityG", * mappedBy="ownerO", @@ -122,7 +122,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 e91d4f7e487..9bf1b81b590 100644 --- a/tests/Tests/ORM/Functional/ClassTableInheritanceSecondTest.php +++ b/tests/Tests/ORM/Functional/ClassTableInheritanceSecondTest.php @@ -194,7 +194,7 @@ class CTIRelated2 private $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="CTIChild") */ private $ctiChildren; @@ -214,7 +214,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/CustomRepositoryTest.php b/tests/Tests/ORM/Functional/CustomRepositoryTest.php index 22a72c49cea..2aae9545daf 100644 --- a/tests/Tests/ORM/Functional/CustomRepositoryTest.php +++ b/tests/Tests/ORM/Functional/CustomRepositoryTest.php @@ -95,7 +95,7 @@ class MinimalRepository implements ObjectRepository /** @var ClassMetadata */ private $class; - /** @psalm-param ClassMetadata $class */ + /** @phpstan-param ClassMetadata $class */ public function __construct(EntityManagerInterface $em, ClassMetadata $class) { $this->em = $em; 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 85f63114bf3..2fb65358c7a 100644 --- a/tests/Tests/ORM/Functional/EntityRepositoryTest.php +++ b/tests/Tests/ORM/Functional/EntityRepositoryTest.php @@ -92,7 +92,7 @@ public function loadFixture(): int return $user1Id; } - /** @psalm-return array{int, int} */ + /** @phpstan-return array{int, int} */ public function loadAssociatedFixture(): array { $address = new CmsAddress(); @@ -115,7 +115,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/LifecycleCallbackTest.php b/tests/Tests/ORM/Functional/LifecycleCallbackTest.php index 2317363b114..bff77353b58 100644 --- a/tests/Tests/ORM/Functional/LifecycleCallbackTest.php +++ b/tests/Tests/ORM/Functional/LifecycleCallbackTest.php @@ -586,7 +586,7 @@ class LifecycleCallbackCascader private $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="LifecycleCallbackTestEntity", mappedBy="cascader", cascade={"persist"}) */ public $entities; diff --git a/tests/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php b/tests/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php index 2b5dcb953c4..a1b681d3262 100644 --- a/tests/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php +++ b/tests/Tests/ORM/Functional/ManyToManyBidirectionalAssociationTest.php @@ -106,7 +106,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'); @@ -122,7 +122,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'); @@ -141,7 +141,7 @@ protected function findCategories(): array return $result; } - /** @psalm-param list */ + /** @phpstan-param list */ public function assertLazyLoadFromInverseSide(array $products): void { [$firstProduct, $secondProduct] = $products; @@ -177,7 +177,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 9528a878a46..ccc66052a88 100644 --- a/tests/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php +++ b/tests/Tests/ORM/Functional/ManyToManySelfReferentialAssociationTest.php @@ -104,7 +104,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; @@ -139,7 +139,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 669e62168af..304c6976967 100644 --- a/tests/Tests/ORM/Functional/NewOperatorTest.php +++ b/tests/Tests/ORM/Functional/NewOperatorTest.php @@ -32,7 +32,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/NotifyPolicyTest.php b/tests/Tests/ORM/Functional/NotifyPolicyTest.php index 357a11085c0..610696a29eb 100644 --- a/tests/Tests/ORM/Functional/NotifyPolicyTest.php +++ b/tests/Tests/ORM/Functional/NotifyPolicyTest.php @@ -96,7 +96,7 @@ public function testChangeTracking(): void class NotifyBaseEntity implements NotifyPropertyChanged { - /** @psalm-var list */ + /** @phpstan-var list */ public $listeners = []; public function addPropertyChangedListener(PropertyChangedListener $listener): void @@ -135,7 +135,7 @@ class NotifyUser extends NotifyBaseEntity private $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="NotifyGroup") */ private $groups; @@ -161,7 +161,7 @@ public function setName(string $name): void $this->name = $name; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getGroups(): Collection { return $this->groups; @@ -186,7 +186,7 @@ class NotifyGroup extends NotifyBaseEntity private $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="NotifyUser", mappedBy="groups") */ private $users; @@ -212,7 +212,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/OneToManyUnidirectionalAssociationTest.php b/tests/Tests/ORM/Functional/OneToManyUnidirectionalAssociationTest.php index 4d152c64cf1..c1bf4eed724 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/OneToOneEagerLoadingTest.php b/tests/Tests/ORM/Functional/OneToOneEagerLoadingTest.php index 94a68c19f32..81138141afa 100644 --- a/tests/Tests/ORM/Functional/OneToOneEagerLoadingTest.php +++ b/tests/Tests/ORM/Functional/OneToOneEagerLoadingTest.php @@ -237,7 +237,7 @@ class Train public $owner; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Waggon", mappedBy="train", cascade={"persist"}) */ public $waggons; 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/OrderedJoinedTableInheritanceCollectionTest.php b/tests/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php index d215696b44c..b4324f81563 100644 --- a/tests/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php +++ b/tests/Tests/ORM/Functional/OrderedJoinedTableInheritanceCollectionTest.php @@ -108,14 +108,14 @@ abstract class OJTICPet public $mother; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="OJTICPet", mappedBy="mother") * @OrderBy({"name" = "ASC"}) */ public $children; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="OJTICPet") * @JoinTable(name="OTJIC_Pet_Friends", * joinColumns={@JoinColumn(name="pet_id", referencedColumnName="id")}, diff --git a/tests/Tests/ORM/Functional/PaginationTest.php b/tests/Tests/ORM/Functional/PaginationTest.php index c4fa3296d0b..a856ce81827 100644 --- a/tests/Tests/ORM/Functional/PaginationTest.php +++ b/tests/Tests/ORM/Functional/PaginationTest.php @@ -758,7 +758,7 @@ public function populate(): void $this->_em->flush(); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function useOutputWalkers(): array { return [ @@ -767,7 +767,7 @@ public static function useOutputWalkers(): array ]; } - /** @psalm-return list */ + /** @phpstan-return list */ public static function fetchJoinCollection(): array { return [ @@ -776,7 +776,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/SQLFilterTest.php b/tests/Tests/ORM/Functional/SQLFilterTest.php index a4c8823c834..f6b966cdd88 100644 --- a/tests/Tests/ORM/Functional/SQLFilterTest.php +++ b/tests/Tests/ORM/Functional/SQLFilterTest.php @@ -245,7 +245,7 @@ private function getMockEntityManager(): EntityManagerInterface } /** - * @psalm-param EntityManagerInterface&MockObject $em + * @phpstan-param EntityManagerInterface&MockObject $em * * @return FilterCollection&MockObject */ diff --git a/tests/Tests/ORM/Functional/SecondLevelCacheFunctionalTestCase.php b/tests/Tests/ORM/Functional/SecondLevelCacheFunctionalTestCase.php index a70656ab18b..6d664c5796b 100644 --- a/tests/Tests/ORM/Functional/SecondLevelCacheFunctionalTestCase.php +++ b/tests/Tests/ORM/Functional/SecondLevelCacheFunctionalTestCase.php @@ -26,34 +26,34 @@ /** @group DDC-2183 */ abstract class SecondLevelCacheFunctionalTestCase extends OrmFunctionalTestCase { - /** @psalm-var list */ + /** @phpstan-var list */ protected $people = []; - /** @psalm-var list
*/ + /** @phpstan-var list
*/ protected $addresses = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $countries = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $states = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $cities = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $travels = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $travelers = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $attractions = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $attractionsInfo = []; - /** @psalm-var list */ + /** @phpstan-var list */ protected $travelersWithProfile = []; /** @var Cache */ diff --git a/tests/Tests/ORM/Functional/SecondLevelCacheTest.php b/tests/Tests/ORM/Functional/SecondLevelCacheTest.php index 3945b790611..c54841e20d3 100644 --- a/tests/Tests/ORM/Functional/SecondLevelCacheTest.php +++ b/tests/Tests/ORM/Functional/SecondLevelCacheTest.php @@ -341,7 +341,7 @@ class ListenerSecondLevelCacheTest /** @var array */ public $callbacks; - /** @psalm-param array $callbacks */ + /** @phpstan-param array $callbacks */ public function __construct(array $callbacks = []) { $this->callbacks = $callbacks; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1080Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1080Test.php index 0afd1fdbb3a..c1e3a4b22da 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1080Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1080Test.php @@ -97,7 +97,7 @@ class DDC1080Foo protected $fooTitle; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1080FooBar", mappedBy="foo", * cascade={"persist"}) * @OrderBy({"orderNr"="ASC"}) @@ -119,7 +119,7 @@ public function getFooTitle(): string return $this->fooTitle; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getFooBars(): Collection { return $this->fooBars; @@ -161,7 +161,7 @@ class DDC1080Bar protected $barTitle; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1080FooBar", mappedBy="bar", * cascade={"persist"}) * @OrderBy({"orderNr"="ASC"}) @@ -183,7 +183,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/DDC1300Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1300Test.php index 9bc695dca1b..c58d77f7913 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1300Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1300Test.php @@ -68,7 +68,7 @@ class DDC1300Foo public $fooReference = null; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1300FooLocale", mappedBy="foo", * cascade={"persist"}) */ diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1335Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1335Test.php index 06d1e5bb1a7..083283901ea 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1335Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1335Test.php @@ -177,7 +177,7 @@ class DDC1335User public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1335Phone", mappedBy="user", cascade={"persist", "remove"}) */ public $phones; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1400Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1400Test.php index 00cee7c82fa..1f756d3aa94 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1400Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1400Test.php @@ -81,7 +81,7 @@ class DDC1400Article public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1400UserState", mappedBy="article", indexBy="userId", fetch="EXTRA_LAZY") */ public $userStates; @@ -99,7 +99,7 @@ class DDC1400User public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1400UserState", mappedBy="user", indexBy="articleId", fetch="EXTRA_LAZY") */ public $userStates; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1452Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1452Test.php index 2cd3d1924bf..5e4151aec6d 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1452Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1452Test.php @@ -108,7 +108,7 @@ class DDC1452EntityA public $title; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1452EntityB", mappedBy="entityAFrom") */ public $entitiesB; @@ -118,7 +118,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/DDC1514Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1514Test.php index 3eb3b57897a..0672dc5f933 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1514Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1514Test.php @@ -85,7 +85,7 @@ class DDC1514EntityA public $title; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC1514EntityB", mappedBy="entityAFrom") */ public $entitiesB; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1526Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1526Test.php index 2ee0f870ebf..27fdbea3d37 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1526Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1526Test.php @@ -69,7 +69,7 @@ class DDC1526Menu public $parent; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1526Menu", mappedBy="parent") */ public $children; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1595Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1595Test.php index 165d95b32ce..34a91678cf5 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1595Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1595Test.php @@ -101,7 +101,7 @@ abstract class DDC1595BaseInheritance class DDC1595InheritedEntity1 extends DDC1595BaseInheritance { /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC1595InheritedEntity2", fetch="EXTRA_LAZY") * @JoinTable(name="entity1_entity2", * joinColumns={@JoinColumn(name="parent", referencedColumnName="id")}, @@ -110,7 +110,7 @@ class DDC1595InheritedEntity1 extends DDC1595BaseInheritance */ protected $entities; - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getEntities(): Collection { return $this->entities; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1654Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1654Test.php index e4fbb67dd95..e2e06a24bd7 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1654Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1654Test.php @@ -146,7 +146,7 @@ class DDC1654Post public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC1654Comment", orphanRemoval=true, * cascade={"persist"}) */ diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1655Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1655Test.php index 7cbe9491b5a..ef6ed4f01d3 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1655Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1655Test.php @@ -160,7 +160,7 @@ class DDC1655Baz public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC1655Foo", mappedBy="baz") */ public $foos = []; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1690Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1690Test.php index c72081cbc61..9dd806334d1 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1690Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1690Test.php @@ -80,7 +80,7 @@ public function testChangeTracking(): void class NotifyBaseEntity implements NotifyPropertyChanged { - /** @psalm-var list */ + /** @phpstan-var list */ public $listeners = []; public function addPropertyChangedListener(PropertyChangedListener $listener): void diff --git a/tests/Tests/ORM/Functional/Ticket/DDC1884Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1884Test.php index f4b4b135164..20378d20bdd 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1884Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1884Test.php @@ -54,7 +54,7 @@ protected function setUp(): void } /** - * @psalm-return array{Car, Car, Car, Car} + * @phpstan-return array{Car, Car, Car, Car} * * @var class-string $class */ @@ -85,7 +85,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/DDC1925Test.php b/tests/Tests/ORM/Functional/Ticket/DDC1925Test.php index 4f1f070ab3b..2aa46ae8032 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC1925Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC1925Test.php @@ -75,7 +75,7 @@ class DDC1925Product private $title; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC1925User") * @JoinTable( * name="user_purchases", diff --git a/tests/Tests/ORM/Functional/Ticket/DDC199Test.php b/tests/Tests/ORM/Functional/Ticket/DDC199Test.php index 5c7593d9bb4..9e9d8a34779 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC199Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC199Test.php @@ -88,7 +88,7 @@ class DDC199ParentClass public $parentData; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC199RelatedClass", mappedBy="parent") */ public $relatedEntities; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC2012Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2012Test.php index d7fc36e959c..27208610dd8 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2012Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2012Test.php @@ -104,7 +104,7 @@ class DDC2012Item public $id; /** - * @psalm-var list + * @phpstan-var list * @Column(name="tsv", type="tsvector", length=255, nullable=true) */ public $tsv; @@ -122,7 +122,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/DDC2106Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2106Test.php index 3164f4d6234..ff3a8cd28dd 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2106Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2106Test.php @@ -62,7 +62,7 @@ class DDC2106Entity public $parent; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC2106Entity", mappedBy="parent", cascade={"persist"}) */ public $children; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC211Test.php b/tests/Tests/ORM/Functional/Ticket/DDC211Test.php index dee422e265b..0cd826cba9a 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC211Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC211Test.php @@ -73,7 +73,7 @@ class DDC211User protected $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC211Group", inversedBy="users") * @JoinTable(name="user_groups", * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id")}, @@ -92,7 +92,7 @@ public function setName(string $name): void $this->name = $name; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getGroups(): Collection { return $this->groups; @@ -120,7 +120,7 @@ class DDC211Group protected $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC211User", mappedBy="groups") */ protected $users; @@ -135,7 +135,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 52a0d100a15..dd24f685966 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2252Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2252Test.php @@ -22,16 +22,16 @@ /** @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 */ + /** @phpstan-var list */ private $privileges = []; protected function setUp(): void @@ -172,7 +172,7 @@ class DDC2252User protected $uid = 222; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC2252Membership", mappedBy="userAccount", cascade={"persist"}) * @JoinColumn(name="uid", referencedColumnName="uid") */ @@ -188,7 +188,7 @@ public function getUid(): int return $this->uid; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getMemberships(): Collection { return $this->memberships; @@ -224,7 +224,7 @@ class DDC2252Membership protected $merchantAccount; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC2252Privilege", indexBy="privilegeid") * @JoinTable(name="ddc2252_user_mch_account_privilege", * joinColumns={ @@ -250,7 +250,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/DDC2256Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2256Test.php index 78c630f8cc6..7672b5f446d 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2256Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2256Test.php @@ -131,7 +131,7 @@ class DDC2256Group public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC2256User", mappedBy="group") */ public $users; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC2350Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2350Test.php index 3fe53e6bc2f..7e934dd1f2a 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2350Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2350Test.php @@ -64,7 +64,7 @@ class DDC2350User public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC2350Bug", mappedBy="user", fetch="EAGER") */ public $reportedBugs; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC2494Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2494Test.php index b785a58a463..daf0f216970 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2494Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2494Test.php @@ -99,7 +99,7 @@ class DDC2494Currency protected $temp; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC2494Campaign", mappedBy="currency") */ protected $campaigns; @@ -120,7 +120,7 @@ public function getTemp(): int return $this->temp; } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getCampaigns(): Collection { return $this->campaigns; @@ -166,7 +166,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/DDC2575Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2575Test.php index d77477a109c..da76b8dc925 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2575Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2575Test.php @@ -15,13 +15,13 @@ /** @group DDC-2575 */ class DDC2575Test extends OrmFunctionalTestCase { - /** @psalm-var list */ + /** @phpstan-var list */ private $rootsEntities = []; - /** @psalm-var list */ + /** @phpstan-var list */ private $aEntities = []; - /** @psalm-var list */ + /** @phpstan-var list */ private $bEntities = []; protected function setUp(): void diff --git a/tests/Tests/ORM/Functional/Ticket/DDC2759Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2759Test.php index 062e76f3bb0..f798938198c 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2759Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2759Test.php @@ -103,7 +103,7 @@ class DDC2759Category public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC2759MetadataCategory", mappedBy="category") */ public $metadataCategories; @@ -130,7 +130,7 @@ class DDC2759QualificationMetadata public $content; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC2759MetadataCategory", mappedBy="metadata") */ protected $metadataCategories; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC2775Test.php b/tests/Tests/ORM/Functional/Ticket/DDC2775Test.php index 17f0cf25b54..2947172a735 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC2775Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC2775Test.php @@ -89,7 +89,7 @@ abstract class Role public $user; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Authorization", mappedBy="role", cascade={"all"}, orphanRemoval=true) */ public $authorizations; @@ -151,13 +151,13 @@ class User public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Role", mappedBy="user", cascade={"all"}, orphanRemoval=true) */ public $roles; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Authorization", mappedBy="user", cascade={"all"}, orphanRemoval=true) */ public $authorizations; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC3033Test.php b/tests/Tests/ORM/Functional/Ticket/DDC3033Test.php index 62294f991ed..7968dc34424 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC3033Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC3033Test.php @@ -72,7 +72,7 @@ public function testIssue(): void */ class DDC3033Product { - /** @psalm-var array */ + /** @phpstan-var array */ public $changeSet = []; /** diff --git a/tests/Tests/ORM/Functional/Ticket/DDC3192Test.php b/tests/Tests/ORM/Functional/Ticket/DDC3192Test.php index 7046156dfdb..de6ff3a9f7e 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC3192Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC3192Test.php @@ -138,7 +138,7 @@ public function __construct(int $amount, DDC3192Currency $currency) class DDC3192CurrencyCode extends Type { - /** @psalm-var array */ + /** @phpstan-var array */ private static $map = ['BYR' => 974]; /** diff --git a/tests/Tests/ORM/Functional/Ticket/DDC3330Test.php b/tests/Tests/ORM/Functional/Ticket/DDC3330Test.php index ff70572f41a..93301bb6b11 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC3330Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC3330Test.php @@ -88,7 +88,7 @@ class DDC3330Building public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3330Hall", mappedBy="building", cascade={"persist"}) */ public $halls; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC345Test.php b/tests/Tests/ORM/Functional/Ticket/DDC345Test.php index 1567c23fffa..e460daa1102 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC345Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC345Test.php @@ -87,7 +87,7 @@ class DDC345User public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC345Membership", mappedBy="user", cascade={"persist"}) */ public $memberships; @@ -116,7 +116,7 @@ class DDC345Group public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC345Membership", mappedBy="group", cascade={"persist"}) */ public $memberships; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC3644Test.php b/tests/Tests/ORM/Functional/Ticket/DDC3644Test.php index 0ab9ced73de..8ada90a500e 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC3644Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC3644Test.php @@ -154,13 +154,13 @@ class DDC3644User public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3644Address", mappedBy="user", orphanRemoval=true) */ public $addresses = []; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3644Pet", mappedBy="owner", orphanRemoval=true) */ public $pets = []; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC371Test.php b/tests/Tests/ORM/Functional/Ticket/DDC371Test.php index 89a42dfbce7..606a591873f 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC371Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC371Test.php @@ -96,7 +96,7 @@ class DDC371Parent public $data; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC371Child", mappedBy="parent") */ public $children; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC3785Test.php b/tests/Tests/ORM/Functional/Ticket/DDC3785Test.php index 9fd7e80f411..0ede92c30f1 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC3785Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC3785Test.php @@ -75,7 +75,7 @@ class DDC3785Asset private $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC3785Attribute", cascade={"persist"}, orphanRemoval=true) * @JoinTable(name="asset_attributes", * joinColumns={@JoinColumn(name="asset_id", referencedColumnName="id")}, @@ -84,7 +84,7 @@ class DDC3785Asset */ private $attributes; - /** @psalm-param list $attributes */ + /** @phpstan-param list $attributes */ public function __construct(DDC3785AssetId $id, $attributes = []) { $this->id = $id; @@ -100,7 +100,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 8101a38d418..3da14f33a9c 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC440Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC440Test.php @@ -168,7 +168,7 @@ class DDC440Client protected $mainPhone; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC440Phone", mappedBy="client", cascade={"persist", "remove"}, fetch="EAGER", indexBy="id") * @OrderBy({"number"="ASC"}) */ @@ -200,7 +200,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 5c9a4bfba92..ba6a460c791 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC531Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC531Test.php @@ -70,7 +70,7 @@ class DDC531Item public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC531Item", mappedBy="parent") */ protected $children; @@ -92,7 +92,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 b8a1094eb3f..f3e1d114dc3 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC599Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC599Test.php @@ -99,7 +99,7 @@ class DDC599Item public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC599Child", mappedBy="parent", cascade={"remove"}) */ protected $children; @@ -109,7 +109,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/DDC618Test.php b/tests/Tests/ORM/Functional/Ticket/DDC618Test.php index 623ff277eff..ff540f8f8fd 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC618Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC618Test.php @@ -145,7 +145,7 @@ class DDC618Author public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC618Book", mappedBy="author", cascade={"persist"}) */ public $books; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC698Test.php b/tests/Tests/ORM/Functional/Ticket/DDC698Test.php index 2f41eeaaa44..7f2d0f2b6a1 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC698Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC698Test.php @@ -101,7 +101,7 @@ class DDC698Privilege protected $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC698Role", mappedBy="privilege") */ protected $roles; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC69Test.php b/tests/Tests/ORM/Functional/Ticket/DDC69Test.php index 868d014f0a4..10c10776254 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC69Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC69Test.php @@ -168,7 +168,7 @@ public function removeRelation(Relation $relation): void } } - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getRelations(): Collection { return $this->relations; @@ -340,7 +340,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 b0d08902e9f..ca5dbd457e4 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC719Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC719Test.php @@ -76,7 +76,7 @@ class DDC719Group extends MyEntity protected $description; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC719Group", inversedBy="parents") * @JoinTable(name="groups_groups", * joinColumns={@JoinColumn(name="parent_id", referencedColumnName="id")}, @@ -86,7 +86,7 @@ class DDC719Group extends MyEntity protected $children = null; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC719Group", mappedBy="children") */ protected $parents = null; @@ -141,19 +141,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/DDC729Test.php b/tests/Tests/ORM/Functional/Ticket/DDC729Test.php index 6359794a9ed..925986940d1 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC729Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC729Test.php @@ -163,7 +163,7 @@ class DDC729A public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC729B", inversedBy="related") */ public $related; @@ -186,7 +186,7 @@ class DDC729B public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC729B", mappedBy="related") */ public $related; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC735Test.php b/tests/Tests/ORM/Functional/Ticket/DDC735Test.php index cefe2673c59..6e0976e1970 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC735Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC735Test.php @@ -67,7 +67,7 @@ class DDC735Product protected $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany( * targetEntity="DDC735Review", * mappedBy="product", @@ -82,7 +82,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 c23c276e29b..844eb1671c8 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC809Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC809Test.php @@ -76,7 +76,7 @@ class DDC809Variant protected $variantId; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC809SpecificationValue", inversedBy="Variants") * @JoinTable(name="var_spec_value_test", * joinColumns={ @@ -89,7 +89,7 @@ class DDC809Variant */ protected $specificationValues; - /** @psalm-return Collection */ + /** @phpstan-return Collection */ public function getSpecificationValues(): Collection { return $this->specificationValues; @@ -110,7 +110,7 @@ class DDC809SpecificationValue protected $specificationValueId; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC809Variant", mappedBy="SpecificationValues") */ protected $variants; diff --git a/tests/Tests/ORM/Functional/Ticket/DDC881Test.php b/tests/Tests/ORM/Functional/Ticket/DDC881Test.php index 138c3c0914c..41e456c02db 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC881Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC881Test.php @@ -119,7 +119,7 @@ class DDC881User private $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC881PhoneNumber",mappedBy="id") */ private $phoneNumbers; @@ -159,7 +159,7 @@ class DDC881PhoneNumber private $phonenumber; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC881PhoneCall", mappedBy="phonenumber") */ private $calls; @@ -184,7 +184,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/DDC992Test.php b/tests/Tests/ORM/Functional/Ticket/DDC992Test.php index e6ff9119df7..709a76f1ff2 100644 --- a/tests/Tests/ORM/Functional/Ticket/DDC992Test.php +++ b/tests/Tests/ORM/Functional/Ticket/DDC992Test.php @@ -151,13 +151,13 @@ public function getRoleID(): int public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="DDC992Role", mappedBy="extends") */ public $extendedBy; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany (targetEntity="DDC992Role", inversedBy="extendedBy") * @JoinTable(name="RoleRelations", * joinColumns={@JoinColumn(name="roleID", referencedColumnName="roleID")}, diff --git a/tests/Tests/ORM/Functional/Ticket/GH10288Test.php b/tests/Tests/ORM/Functional/Ticket/GH10288Test.php index 66de8d77f2f..e4154797973 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH10288Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH10288Test.php @@ -48,8 +48,8 @@ protected function setUp(): void /** * @param class-string $personType - * @psalm-param GH10288BossWithEnumType|GH10288BossCustomEnumType $boss - * @psalm-param GH10288EmployeeWithEnumType|GH10288EmployeeCustomEnumType $employee + * @phpstan-param GH10288BossWithEnumType|GH10288BossCustomEnumType $boss + * @phpstan-param GH10288EmployeeWithEnumType|GH10288EmployeeCustomEnumType $employee */ private function performEnumDiscriminatorTest($boss, $employee, string $personType): void { diff --git a/tests/Tests/ORM/Functional/Ticket/GH5762Test.php b/tests/Tests/ORM/Functional/Ticket/GH5762Test.php index 05b30f148f0..bd5c9d65dd2 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH5762Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH5762Test.php @@ -128,7 +128,7 @@ class GH5762Driver public $name; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="GH5762DriverRide", mappedBy="driver") */ public $driverRides; @@ -194,7 +194,7 @@ class GH5762Car public $model; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="GH5762DriverRide", mappedBy="car") */ public $carRides; diff --git a/tests/Tests/ORM/Functional/Ticket/GH6029Test.php b/tests/Tests/ORM/Functional/Ticket/GH6029Test.php index 7ad76e338e4..416d509b028 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH6029Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH6029Test.php @@ -99,7 +99,7 @@ class GH6029User public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity=GH6029Group::class, cascade={"all"}) */ public $groups; @@ -146,7 +146,7 @@ class GH6029Product public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity=GH6029Feature::class, mappedBy="product", cascade={"all"}) */ public $features; diff --git a/tests/Tests/ORM/Functional/Ticket/GH6362Test.php b/tests/Tests/ORM/Functional/Ticket/GH6362Test.php index b185a4b430b..86ce1adf73d 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH6362Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH6362Test.php @@ -120,7 +120,7 @@ abstract class GH6362Base protected $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="GH6362Start", mappedBy="bases") */ private $starts; @@ -130,7 +130,7 @@ abstract class GH6362Base class GH6362Child extends GH6362Base { /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="GH6362Join", mappedBy="child") */ private $joins; diff --git a/tests/Tests/ORM/Functional/Ticket/GH6531Test.php b/tests/Tests/ORM/Functional/Ticket/GH6531Test.php index a331d7ea222..ea3dca1c7bb 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH6531Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH6531Test.php @@ -119,7 +119,7 @@ class GH6531Article public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity=GH6531ArticleAttribute::class, mappedBy="article", cascade={"ALL"}, indexBy="attribute") * */ public $attributes; @@ -173,7 +173,7 @@ class GH6531Order public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity=GH6531OrderItem::class, mappedBy="order", cascade={"ALL"}) */ public $items; diff --git a/tests/Tests/ORM/Functional/Ticket/GH7062Test.php b/tests/Tests/ORM/Functional/Ticket/GH7062Test.php index 035b0327c56..42122bf7222 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH7062Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH7062Test.php @@ -109,7 +109,7 @@ class GH7062Ranking /** * @OneToMany(targetEntity=GH7062RankingPosition::class, mappedBy="ranking", cascade={"all"}) * @var Collection|GH7062RankingPosition[] - * @psalm-var Collection + * @phpstan-var Collection */ public $positions; diff --git a/tests/Tests/ORM/Functional/Ticket/GH7767Test.php b/tests/Tests/ORM/Functional/Ticket/GH7767Test.php index dc993eec353..cd222700bed 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH7767Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH7767Test.php @@ -78,7 +78,7 @@ class GH7767ParentEntity private $id; /** - * @psalm-var Collection&Selectable + * @phpstan-var Collection&Selectable * @OneToMany(targetEntity=GH7767ChildEntity::class, mappedBy="parent", fetch="EXTRA_LAZY", cascade={"persist"}) * @OrderBy({"position" = "ASC"}) */ @@ -89,7 +89,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 646bbf66170..408748d890f 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH7836Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH7836Test.php @@ -120,7 +120,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/GH8217Test.php b/tests/Tests/ORM/Functional/Ticket/GH8217Test.php index 463ef8cdc54..530db9202d2 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH8217Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH8217Test.php @@ -56,7 +56,7 @@ class GH8217Collection public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="GH8217CollectionItem", mappedBy="collection", * cascade={"persist", "remove"}, orphanRemoval=true) */ diff --git a/tests/Tests/ORM/Functional/Ticket/GH9109Test.php b/tests/Tests/ORM/Functional/Ticket/GH9109Test.php index 090afc2a7c8..e8d7ae3e8cb 100644 --- a/tests/Tests/ORM/Functional/Ticket/GH9109Test.php +++ b/tests/Tests/ORM/Functional/Ticket/GH9109Test.php @@ -105,7 +105,7 @@ class GH9109Product /** * @var Collection|GH9109User[] - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="GH9109User") */ private $buyers; @@ -130,7 +130,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 4376d529c95..096751aa610 100644 --- a/tests/Tests/ORM/Functional/ValueObjectsTest.php +++ b/tests/Tests/ORM/Functional/ValueObjectsTest.php @@ -344,7 +344,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/ArrayHydratorTest.php b/tests/Tests/ORM/Hydration/ArrayHydratorTest.php index 994002076e8..72926a06e02 100644 --- a/tests/Tests/ORM/Hydration/ArrayHydratorTest.php +++ b/tests/Tests/ORM/Hydration/ArrayHydratorTest.php @@ -16,7 +16,7 @@ class ArrayHydratorTest extends HydrationTestCase { - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideDataForUserEntityResult(): array { return [ diff --git a/tests/Tests/ORM/Hydration/ObjectHydratorTest.php b/tests/Tests/ORM/Hydration/ObjectHydratorTest.php index 712a8cf411c..e1479547746 100644 --- a/tests/Tests/ORM/Hydration/ObjectHydratorTest.php +++ b/tests/Tests/ORM/Hydration/ObjectHydratorTest.php @@ -34,7 +34,7 @@ class ObjectHydratorTest extends HydrationTestCase { use MockBuilderCompatibilityTools; - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideDataForUserEntityResult(): array { return [ @@ -43,7 +43,7 @@ public static function provideDataForUserEntityResult(): array ]; } - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideDataForMultipleRootEntityResult(): array { return [ @@ -54,7 +54,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 a9402481e9e..13423be458e 100644 --- a/tests/Tests/ORM/Internal/HydrationCompleteHandlerTest.php +++ b/tests/Tests/ORM/Internal/HydrationCompleteHandlerTest.php @@ -153,7 +153,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 090a9d17693..69fe443d1c7 100644 --- a/tests/Tests/ORM/Mapping/XmlMappingDriverTest.php +++ b/tests/Tests/ORM/Mapping/XmlMappingDriverTest.php @@ -179,7 +179,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/ORMInvalidArgumentExceptionTest.php b/tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php index 49bf396a6bd..e878bc067b6 100644 --- a/tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php +++ b/tests/Tests/ORM/ORMInvalidArgumentExceptionTest.php @@ -26,7 +26,7 @@ public function testInvalidEntityName($value, string $expectedMessage): void self::assertSame($expectedMessage, $exception->getMessage()); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function invalidEntityNames(): array { return [ diff --git a/tests/Tests/ORM/Query/LanguageRecognitionTest.php b/tests/Tests/ORM/Query/LanguageRecognitionTest.php index 37aac27f260..8212be5fe7a 100644 --- a/tests/Tests/ORM/Query/LanguageRecognitionTest.php +++ b/tests/Tests/ORM/Query/LanguageRecognitionTest.php @@ -38,7 +38,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); @@ -86,7 +86,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 9aa818d1dd2..696fac761e4 100644 --- a/tests/Tests/ORM/Query/LexerTest.php +++ b/tests/Tests/ORM/Query/LexerTest.php @@ -183,7 +183,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/ParameterTypeInfererTest.php b/tests/Tests/ORM/Query/ParameterTypeInfererTest.php index 2f22ec2f5a2..29923cba773 100644 --- a/tests/Tests/ORM/Query/ParameterTypeInfererTest.php +++ b/tests/Tests/ORM/Query/ParameterTypeInfererTest.php @@ -20,7 +20,7 @@ class ParameterTypeInfererTest extends OrmTestCase { - /** @psalm-return Generator */ + /** @phpstan-return Generator */ public static function providerParameterTypeInferer(): Generator { yield 'integer' => [1, Types::INTEGER]; diff --git a/tests/Tests/ORM/Query/ParserTest.php b/tests/Tests/ORM/Query/ParserTest.php index 2bc42a58b8f..464e8595a82 100644 --- a/tests/Tests/ORM/Query/ParserTest.php +++ b/tests/Tests/ORM/Query/ParserTest.php @@ -112,7 +112,7 @@ public function testMatchFailure(int $expectedToken, string $inputString): void $parser->match($expectedToken); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function validMatches(): array { /* @@ -133,7 +133,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 b16fe220777..edabff175a9 100644 --- a/tests/Tests/ORM/Query/QueryExpressionVisitorTest.php +++ b/tests/Tests/ORM/Query/QueryExpressionVisitorTest.php @@ -42,7 +42,7 @@ public function testWalkComparison(CriteriaComparison $criteriaExpr, $queryExpr, } /** - * @psalm-return listgetHint(Query::HINT_LOCK_MODE)); } - /** @psalm-return list */ + /** @phpstan-return list */ public static function provideLockModes(): array { return [ @@ -304,7 +304,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 5effffe36d0..6c24d6c02d1 100644 --- a/tests/Tests/ORM/Query/SelectSqlGenerationTest.php +++ b/tests/Tests/ORM/Query/SelectSqlGenerationTest.php @@ -2165,7 +2165,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 31223ee9262..71a48876b81 100644 --- a/tests/Tests/ORM/Tools/AttachEntityListenersListenerTest.php +++ b/tests/Tests/ORM/Tools/AttachEntityListenersListenerTest.php @@ -179,7 +179,7 @@ class AttachEntityListenersListenerTestBarEntity class AttachEntityListenersListenerTestListener { - /** @psalm-var array>> */ + /** @phpstan-var array>> */ public $calls; public function prePersist(): void @@ -200,7 +200,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/Tools/DebugTest.php b/tests/Tests/ORM/Tools/DebugTest.php index 413c577fa66..4d64b9d8ee6 100644 --- a/tests/Tests/ORM/Tools/DebugTest.php +++ b/tests/Tests/ORM/Tools/DebugTest.php @@ -128,7 +128,7 @@ public function testCollectionsAreCastIntoArrays(): void } /** - * @psalm-return array + * @phpstan-return array */ public function provideAttributesCases(): iterable { diff --git a/tests/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Tests/ORM/Tools/EntityGeneratorTest.php index c3193686c50..fdf1dff1222 100644 --- a/tests/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Tests/ORM/Tools/EntityGeneratorTest.php @@ -1016,7 +1016,7 @@ public function testRegenerateEntityClass(): void /** * @return mixed[] - * @psalm-return list */ + /** @phpstan-return list */ public static function getParseTokensInEntityFileData(): array { return [ diff --git a/tests/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php b/tests/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php index e4387835de1..0cb269baa37 100644 --- a/tests/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php +++ b/tests/Tests/ORM/Tools/Export/annotation/Doctrine.Tests.ORM.Tools.Export.User.php @@ -74,14 +74,14 @@ class User public $mainGroup; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Doctrine\Tests\ORM\Tools\Export\Phonenumber", mappedBy="user", cascade={"persist", "merge"}, orphanRemoval=true) * @OrderBy({"number"="ASC"}) */ public $phonenumbers; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="Doctrine\Tests\ORM\Tools\Export\Group", cascade={"all"}, fetch="EXTRA_LAZY") * @JoinTable(name="cms_users_groups", * joinColumns={@JoinColumn(name="user_id", referencedColumnName="id", nullable=false, unique=false)}, diff --git a/tests/Tests/ORM/Tools/Pagination/PaginationTestCase.php b/tests/Tests/ORM/Tools/Pagination/PaginationTestCase.php index 025fc42e3c0..9473e32ec88 100644 --- a/tests/Tests/ORM/Tools/Pagination/PaginationTestCase.php +++ b/tests/Tests/ORM/Tools/Pagination/PaginationTestCase.php @@ -180,7 +180,7 @@ class Group public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="User", mappedBy="groups") */ public $users; @@ -198,7 +198,7 @@ class User public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="Group", inversedBy="users") * @JoinTable( * name="user_group", diff --git a/tests/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php b/tests/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php index 124fd325422..80de7a424a5 100644 --- a/tests/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php +++ b/tests/Tests/ORM/Tools/ResolveTargetEntityListenerTest.php @@ -134,7 +134,7 @@ class ResolveTargetEntity implements ResolveTarget private $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="Doctrine\Tests\ORM\Tools\Target") */ private $manyToMany; @@ -146,7 +146,7 @@ class ResolveTargetEntity implements ResolveTarget private $manyToOne; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="Doctrine\Tests\ORM\Tools\ResolveTarget", mappedBy="manyToOne") */ private $oneToMany; diff --git a/tests/Tests/ORM/Tools/SchemaToolTest.php b/tests/Tests/ORM/Tools/SchemaToolTest.php index a3726f2d0b7..dde41a70fa6 100644 --- a/tests/Tests/ORM/Tools/SchemaToolTest.php +++ b/tests/Tests/ORM/Tools/SchemaToolTest.php @@ -534,7 +534,7 @@ class GH6830Category public $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity=GH6830Board::class, mappedBy="category") */ public $boards; diff --git a/tests/Tests/ORM/Tools/SchemaValidatorTest.php b/tests/Tests/ORM/Tools/SchemaValidatorTest.php index 14d53c2a5c3..7b24a2321b8 100644 --- a/tests/Tests/ORM/Tools/SchemaValidatorTest.php +++ b/tests/Tests/ORM/Tools/SchemaValidatorTest.php @@ -601,14 +601,14 @@ class DDC3322One private $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3322ValidEntity1", mappedBy="oneValid") * @OrderBy({"id" = "ASC"}) */ private $validAssoc; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3322ValidEntity1", mappedBy="oneInvalid") * @OrderBy({"invalidField" = "ASC"}) */ @@ -627,14 +627,14 @@ class DDC3322Two private $id; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3322ValidEntity1", mappedBy="twoValid") * @OrderBy({"manyToOne" = "ASC"}) */ private $validAssoc; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3322ValidEntity1", mappedBy="twoInvalid") * @OrderBy({"oneToMany" = "ASC"}) */ @@ -660,7 +660,7 @@ class DDC3322Three private $validAssoc; /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="DDC3322ValidEntity1", mappedBy="threeInvalid") * @OrderBy({"oneToOneInverse" = "ASC"}) */ @@ -706,7 +706,7 @@ class Issue9095Child extends Issue9095AbstractChild class InvalidMappedSuperClass { /** - * @psalm-var Collection + * @phpstan-var Collection * @ManyToMany(targetEntity="InvalidMappedSuperClass", mappedBy="invalid") */ private $selfWhatever; diff --git a/tests/Tests/ORM/UnitOfWorkTest.php b/tests/Tests/ORM/UnitOfWorkTest.php index ae6b1d282f3..39fcc1bb942 100644 --- a/tests/Tests/ORM/UnitOfWorkTest.php +++ b/tests/Tests/ORM/UnitOfWorkTest.php @@ -526,7 +526,7 @@ public function testAddToIdentityMapValidIdentifiers($entity, string $idHash): v self::assertSame($entity, $this->_unitOfWork->getByIdHash($idHash, get_class($entity))); } - /** @psalm-return array */ + /** @phpstan-return array */ public static function entitiesWithValidIdentifiersProvider(): array { $emptyString = new EntityWithStringIdentifier(); @@ -585,7 +585,7 @@ public function testAddToIdentityMapInvalidIdentifiers($entity, array $identifie $this->_unitOfWork->registerManaged($entity, $identifier, []); } - /** @psalm-return array}> */ + /** @phpstan-return array}> */ public static function entitiesWithInvalidIdentifiersProvider(): array { $firstNullString = new EntityWithCompositeStringIdentifier(); @@ -1014,7 +1014,7 @@ public function rollBack(): bool /** @Entity */ class NotifyChangedEntity implements NotifyPropertyChanged { - /** @psalm-var list */ + /** @phpstan-var list */ private $_listeners = []; /** @@ -1035,7 +1035,7 @@ class NotifyChangedEntity implements NotifyPropertyChanged private $transient; // not persisted /** - * @psalm-var Collection + * @phpstan-var Collection * @OneToMany(targetEntity="NotifyChangedRelatedItem", mappedBy="owner") */ private $items; diff --git a/tests/Tests/OrmFunctionalTestCase.php b/tests/Tests/OrmFunctionalTestCase.php index f81eddc7d59..73c812acbe1 100644 --- a/tests/Tests/OrmFunctionalTestCase.php +++ b/tests/Tests/OrmFunctionalTestCase.php @@ -931,7 +931,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 a7729248752..391bdd4bfdb 100644 --- a/tests/Tests/TestUtil.php +++ b/tests/Tests/TestUtil.php @@ -190,7 +190,7 @@ private static function getPrivilegedConnectionParameters(): array return $parameters; } - /** @psalm-return array */ + /** @phpstan-return array */ private static function getTestConnectionParameters(): array { if (! isset($GLOBALS['db_driver'])) {