From 2c97c4066325dd44f2270ceacef91d3c1f4247a6 Mon Sep 17 00:00:00 2001 From: Simon Berger Date: Sun, 14 Mar 2021 21:05:26 +0100 Subject: [PATCH] Add missing @param and @result PHPDoc attributes --- lib/Doctrine/ORM/Cache/Region.php | 2 +- lib/Doctrine/ORM/Configuration.php | 13 +++--- lib/Doctrine/ORM/EntityManager.php | 14 ++++--- lib/Doctrine/ORM/EntityRepository.php | 6 ++- .../Internal/Hydration/AbstractHydrator.php | 5 ++- .../Internal/Hydration/HydrationException.php | 3 +- .../ORM/Mapping/ClassMetadataInfo.php | 13 +++++- .../ORM/Mapping/Driver/DatabaseDriver.php | 32 ++++++++------- lib/Doctrine/ORM/Mapping/MappingException.php | 3 ++ lib/Doctrine/ORM/PersistentCollection.php | 1 + .../Collection/ManyToManyPersister.php | 6 ++- .../Entity/BasicEntityPersister.php | 7 +++- .../ORM/Persisters/Entity/EntityPersister.php | 40 ++++++++++--------- lib/Doctrine/ORM/Query/Expr/Base.php | 1 + lib/Doctrine/ORM/Query/Expr/Func.php | 3 +- lib/Doctrine/ORM/Query/Parser.php | 13 ++++-- lib/Doctrine/ORM/Query/ParserResult.php | 3 +- lib/Doctrine/ORM/Query/QueryException.php | 3 ++ .../ORM/Query/ResultSetMappingBuilder.php | 30 ++++++++------ lib/Doctrine/ORM/Query/SqlWalker.php | 15 +++---- .../ORM/Query/TreeWalkerChainIterator.php | 2 + lib/Doctrine/ORM/QueryBuilder.php | 8 ++-- .../ORM/Tools/ConvertDoctrine1Schema.php | 1 + lib/Doctrine/ORM/UnitOfWork.php | 5 ++- .../ORM/Utility/IdentifierFlattener.php | 1 + 25 files changed, 144 insertions(+), 86 deletions(-) diff --git a/lib/Doctrine/ORM/Cache/Region.php b/lib/Doctrine/ORM/Cache/Region.php index 59bb5598711..b2ee20b990b 100644 --- a/lib/Doctrine/ORM/Cache/Region.php +++ b/lib/Doctrine/ORM/Cache/Region.php @@ -57,7 +57,7 @@ public function get(CacheKey $key); * * @param CacheKey $key The key under which to cache the item. * @param CacheEntry $entry The entry to cache. - * @param Lock $lock The lock previously obtained. + * @param Lock|null $lock The lock previously obtained. * * @throws CacheException Indicates a problem accessing the region. */ diff --git a/lib/Doctrine/ORM/Configuration.php b/lib/Doctrine/ORM/Configuration.php index 49ce822c6f1..5f8a0bb8c3d 100644 --- a/lib/Doctrine/ORM/Configuration.php +++ b/lib/Doctrine/ORM/Configuration.php @@ -150,7 +150,8 @@ public function setMetadataDriverImpl(MappingDriver $driverImpl) * Adds a new default annotation driver with a correctly configured annotation reader. If $useSimpleAnnotationReader * is true, the notation `@Entity` will work, otherwise, the notation `@ORM\Entity` will be supported. * - * @param bool $useSimpleAnnotationReader + * @param string|string[] $paths + * @param bool $useSimpleAnnotationReader * @psalm-param string|list $paths * * @return AnnotationDriver @@ -349,11 +350,8 @@ public function addNamedNativeQuery($name, $sql, Query\ResultSetMapping $rsm) * * @param string $name The name of the query. * - * @psalm-return array{string, ResultSetMapping} A tuple with the first - * element being the SQL - * string and the second - * element being the - * ResultSetMapping. + * @return array{string, ResultSetMapping} A tuple with the first element being the SQL string and the second + * element being the ResultSetMapping. * * @throws ORMException */ @@ -592,7 +590,8 @@ public function getCustomHydrationMode($modeName) * Adds a custom hydration mode. * * @param string $modeName The hydration mode name. - * @psalm-param class-string $hydrator The hydrator class name. + * @param string $hydrator The hydrator class name. + * @psalm-param class-string $hydrator * * @return void */ diff --git a/lib/Doctrine/ORM/EntityManager.php b/lib/Doctrine/ORM/EntityManager.php index 912b29a07bb..901a50d7aaa 100644 --- a/lib/Doctrine/ORM/EntityManager.php +++ b/lib/Doctrine/ORM/EntityManager.php @@ -877,9 +877,10 @@ public function initializeObject($obj) /** * Factory method to create EntityManager instances. * - * @param array|Connection $connection An array with the connection parameters or an existing Connection instance. - * @param Configuration $config The Configuration instance to use. - * @param EventManager $eventManager The EventManager instance to use. + * @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 * * @return EntityManager The created EntityManager. * @@ -900,9 +901,10 @@ public static function create($connection, Configuration $config, ?EventManager /** * Factory method to create Connection instances. * - * @param array|Connection $connection An array with the connection parameters or an existing Connection instance. - * @param Configuration $config The Configuration instance to use. - * @param EventManager $eventManager The EventManager instance to use. + * @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 * * @return Connection * diff --git a/lib/Doctrine/ORM/EntityRepository.php b/lib/Doctrine/ORM/EntityRepository.php index ff5fdca17ed..e8342a818bb 100644 --- a/lib/Doctrine/ORM/EntityRepository.php +++ b/lib/Doctrine/ORM/EntityRepository.php @@ -185,7 +185,8 @@ public function findAll() * @psalm-param array $criteria * @psalm-param array|null $orderBy * - * @psalm-return list The objects. + * @return object[] The objects. + * @psalm-return list */ public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null) { @@ -227,7 +228,8 @@ public function count(array $criteria) /** * Adds support for magic method calls. * - * @param string $method + * @param string $method + * @param mixed[] $arguments * @psalm-param list $arguments * * @return mixed The returned value from the resolved method. diff --git a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php index 98cf2af6081..9afacc44f70 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php +++ b/lib/Doctrine/ORM/Internal/Hydration/AbstractHydrator.php @@ -411,9 +411,11 @@ protected function gatherRowData(array $data, array &$id, array &$nonemptyCompon * values according to their types. The resulting row has the same number * of elements as before. * + * @param mixed[] $data * @psalm-param array $data * - * @psalm-return array The processed row. + * @return mixed[] The processed row. + * @psalm-return array */ protected function gatherScalarRowData(&$data) { @@ -447,6 +449,7 @@ protected function gatherScalarRowData(&$data) * * @param string $key Column name * + * @return mixed[]|null * @psalm-return array|null */ protected function hydrateColumnInfo($key) diff --git a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php index 24570c64a9e..4db1db83ad0 100644 --- a/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php +++ b/lib/Doctrine/ORM/Internal/Hydration/HydrationException.php @@ -99,7 +99,8 @@ public static function missingDiscriminatorMetaMappingColumn($entityName, $discr } /** - * @param string $discrValue + * @param string $discrValue + * @param string[] $discrMap * @psalm-param array $discrMap * * @return HydrationException diff --git a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php index deab8c836c3..d4107688163 100644 --- a/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php +++ b/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php @@ -1261,7 +1261,8 @@ public function getColumnName($fieldName) * * @param string $fieldName The field name. * - * @psalm-return array The field mapping. + * @return mixed[] The field mapping. + * @psalm-return array * * @throws MappingException */ @@ -1282,7 +1283,8 @@ public function getFieldMapping($fieldName) * @param string $fieldName The field name that represents the association in * the object model. * - * @psalm-return array The mapping. + * @return mixed[] The mapping. + * @psalm-return array * * @throws MappingException */ @@ -1355,6 +1357,7 @@ public function getNamedQueries() * * @param string $queryName The query name. * + * @return mixed[] * @psalm-return array * * @throws MappingException @@ -1385,6 +1388,7 @@ public function getNamedNativeQueries() * * @param string $name The result set mapping name. * + * @return mixed[] * @psalm-return array * * @throws MappingException @@ -2753,6 +2757,7 @@ public function hasLifecycleCallbacks($lifecycleEvent) * * @param string $event * + * @return string[] * @psalm-return list */ public function getLifecycleCallbacks($event) @@ -2828,6 +2833,7 @@ public function addEntityListener($eventName, $class, $method) * * @see getDiscriminatorColumn() * + * @param mixed[] $columnDef * @psalm-param array $columnDef * * @return void @@ -2880,6 +2886,7 @@ public function setDiscriminatorMap(array $map) * Adds one entry of the discriminator map with a new class and corresponding name. * * @param string $name + * @param string $className * @psalm-param class-string $className * * @return void @@ -3220,6 +3227,7 @@ public function getName() * * @param AbstractPlatform $platform * + * @return string[] * @psalm-return list */ public function getQuotedIdentifierColumnNames($platform) @@ -3322,6 +3330,7 @@ public function getAssociationMappedByTargetField($fieldName) /** * @param string $targetClass * + * @return mixed[][] * @psalm-return array> */ public function getAssociationsByTargetClass($targetClass) diff --git a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php index 0eb67da0ad2..44b9f17cab9 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/DatabaseDriver.php @@ -145,6 +145,8 @@ public function setFieldNameForColumn($tableName, $columnName, $fieldName) /** * Sets tables manually instead of relying on the reverse engineering capabilities of SchemaManager. * + * @param Table[] $entityTables + * @param Table[] $manyToManyTables * @psalm-param list $entityTables * @psalm-param list
$manyToManyTables * @@ -384,21 +386,21 @@ private function buildFieldMappings(ClassMetadataInfo $metadata) * * @param string $tableName * - * @psalm-return array{ - * fieldName: string, - * columnName: string, - * type: string, - * nullable: bool, - * options?: array{ - * unsigned?: bool, - * fixed?: bool, - * comment?: string, - * default?: string - * }, - * precision?: int, - * scale?: int, - * length?: int|null - * } + * @return array{ + * fieldName: string, + * columnName: string, + * type: string, + * nullable: bool, + * options?: array{ + * unsigned?: bool, + * fixed?: bool, + * comment?: string, + * default?: string + * }, + * precision?: int, + * scale?: int, + * length?: int|null + * } */ private function buildFieldMapping($tableName, Column $column) { diff --git a/lib/Doctrine/ORM/Mapping/MappingException.php b/lib/Doctrine/ORM/Mapping/MappingException.php index 9599ff0ae36..d107cc429c5 100644 --- a/lib/Doctrine/ORM/Mapping/MappingException.php +++ b/lib/Doctrine/ORM/Mapping/MappingException.php @@ -921,6 +921,9 @@ public static function infiniteEmbeddableNesting($className, $propertyName) } /** + * @param string $className + * @param string $propertyName + * * @return MappingException */ public static function illegalOverrideOfInheritedProperty($className, $propertyName) diff --git a/lib/Doctrine/ORM/PersistentCollection.php b/lib/Doctrine/ORM/PersistentCollection.php index 0f7b47cc17b..26288f26dc2 100644 --- a/lib/Doctrine/ORM/PersistentCollection.php +++ b/lib/Doctrine/ORM/PersistentCollection.php @@ -620,6 +620,7 @@ public function __sleep(): array * @param int $offset * @param int|null $length * + * @return T[] * @psalm-return array */ public function slice($offset, $length = null) diff --git a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php index 346fa438c54..eca57e8256e 100644 --- a/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/Collection/ManyToManyPersister.php @@ -298,7 +298,8 @@ public function loadCriteria(PersistentCollection $collection, Criteria $criteri * have to join in the actual entities table leading to additional * JOIN. * - * @psalm-param array $mapping Array containing mapping information. + * @param mixed[] $mapping Array containing mapping information. + * @psalm-param array $mapping * * @return string[] ordered tuple: * - JOIN condition to add to the SQL @@ -350,6 +351,7 @@ protected function generateFilterConditionSQL(ClassMetadata $targetEntity, $targ /** * Generate ON condition * + * @param mixed[] $mapping * @psalm-param array $mapping * * @return string[] @@ -464,6 +466,7 @@ protected function getDeleteRowSQL(PersistentCollection $collection) * * @param mixed $element * + * @return mixed[] * @psalm-return list */ protected function getDeleteRowSQLParameters(PersistentCollection $collection, $element) @@ -513,6 +516,7 @@ protected function getInsertRowSQL(PersistentCollection $collection) * * @param mixed $element * + * @return mixed[] * @psalm-return list */ protected function getInsertRowSQLParameters(PersistentCollection $collection, $element) diff --git a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php index b3af206e946..c9c66564041 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/BasicEntityPersister.php @@ -1656,7 +1656,8 @@ public function getSelectConditionStatementSQL($field, $value, $assoc = null, $c /** * Builds the left-hand-side of a where condition statement. * - * @param string $field + * @param string $field + * @param mixed[]|null $assoc * @psalm-param array|null $assoc * * @return string[] @@ -1724,6 +1725,7 @@ private function getSelectConditionStatementColumnSQL($field, $assoc = null) * Subclasses are supposed to override this method if they intend to change * or alter the criteria by which entities are selected. * + * @param mixed[]|null $assoc * @psalm-param array $criteria * @psalm-param array|null $assoc * @@ -2012,7 +2014,8 @@ public function exists($entity, ?Criteria $extraConditions = null) /** * Generates the appropriate join SQL for the given join column. * - * @psalm-param array> $joinColumns The join columns definition of an association. + * @param array[] $joinColumns The join columns definition of an association. + * @psalm-param array> $joinColumns * * @return string LEFT JOIN if one of the columns is nullable, INNER JOIN otherwise. */ diff --git a/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php b/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php index 1bdf7d29ebc..38f03998d27 100644 --- a/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/Entity/EntityPersister.php @@ -103,9 +103,10 @@ public function expandCriteriaParameters(Criteria $criteria); /** * Gets the SQL WHERE condition for matching a field with a given value. * - * @param string $field - * @param mixed $value - * @param string|null $comparison + * @param string $field + * @param mixed $value + * @param mixed[]|null $assoc + * @param string|null $comparison * @psalm-param array|null $assoc * * @return string @@ -186,21 +187,24 @@ public function getOwningTable($fieldName); /** * Loads an entity by a list of field criteria. * - * @param object|null $entity The entity to load the data into. If not specified, a new entity is created. - * @param int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants - * or NULL if no specific lock mode should be used - * for loading the entity. - * @param int|null $limit Limit number of results. - * @psalm-param array $hints Hints for entity creation. - * @psalm-param array $criteria The criteria by which - * to load the entity. - * @psalm-param array|null $assoc The association that - * connects the entity to - * load to another entity, - * if any. - * @psalm-param array|null $orderBy Criteria to order by. - * - * @return object|null The loaded and managed entity instance or NULL if the entity can not be found. + * @param mixed[] $criteria The criteria by which to load the entity. + * @param object|null $entity The entity to load the data into. If not specified, + * a new entity is created. + * @param mixed[]|null $assoc The association that connects the entity + * to load to another entity, if any. + * @param mixed[] $hints Hints for entity creation. + * @param int|null $lockMode One of the \Doctrine\DBAL\LockMode::* constants + * or NULL if no specific lock mode should be used + * 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|null $assoc + * @psalm-param array $hints + * @psalm-param array|null $orderBy + * + * @return object|null The loaded and managed entity instance or NULL + * if the entity can not be found. * * @todo Check identity map? loadById method? Try to guess whether $criteria is the id? */ diff --git a/lib/Doctrine/ORM/Query/Expr/Base.php b/lib/Doctrine/ORM/Query/Expr/Base.php index 37c9433bf23..a9c45a80677 100644 --- a/lib/Doctrine/ORM/Query/Expr/Base.php +++ b/lib/Doctrine/ORM/Query/Expr/Base.php @@ -60,6 +60,7 @@ public function __construct($args = []) } /** + * @param array $args * @psalm-param list $args * * @return static diff --git a/lib/Doctrine/ORM/Query/Expr/Func.php b/lib/Doctrine/ORM/Query/Expr/Func.php index e87fc1e1358..6ab784e22a8 100644 --- a/lib/Doctrine/ORM/Query/Expr/Func.php +++ b/lib/Doctrine/ORM/Query/Expr/Func.php @@ -38,7 +38,8 @@ class Func /** * Creates a function, with the given argument. * - * @param string $name + * @param string $name + * @param mixed[] $arguments * @psalm-param list $arguments */ public function __construct($name, $arguments) diff --git a/lib/Doctrine/ORM/Query/Parser.php b/lib/Doctrine/ORM/Query/Parser.php index 3d966269420..dc9ec135feb 100644 --- a/lib/Doctrine/ORM/Query/Parser.php +++ b/lib/Doctrine/ORM/Query/Parser.php @@ -261,6 +261,7 @@ public function setCustomOutputTreeWalker($className) /** * Adds a custom tree walker for modifying the AST. * + * @param string $className * @psalm-param class-string $className * * @return void @@ -490,8 +491,9 @@ private function fixIdentificationVariableOrder($AST) /** * Generates a new syntax error. * - * @param string $expected Expected string. - * @psalm-param array|null $token Got token. + * @param string $expected Expected string. + * @param mixed[]|null $token Got token. + * @psalm-param array|null $token * * @return void * @@ -515,8 +517,9 @@ public function syntaxError($expected = '', $token = null) /** * Generates a new semantical error. * - * @param string $message Optional message. - * @psalm-param array|null $token Optional token. + * @param string $message Optional message. + * @param mixed[]|null $token Optional token. + * @psalm-param array|null $token * * @return void * @@ -552,6 +555,7 @@ public function semanticalError($message = '', $token = null) * * @param bool $resetPeek Reset peek after finding the closing parenthesis. * + * @return mixed[]| null * @psalm-return array| null */ private function peekBeyondClosingParenthesis(bool $resetPeek = true) @@ -586,6 +590,7 @@ private function peekBeyondClosingParenthesis(bool $resetPeek = true) /** * Checks if the given token indicates a mathematical operator. * + * @param mixed[] $token * @psalm-param array $token */ private function isMathOperator($token): bool diff --git a/lib/Doctrine/ORM/Query/ParserResult.php b/lib/Doctrine/ORM/Query/ParserResult.php index 9b79db38b9e..7280e659985 100644 --- a/lib/Doctrine/ORM/Query/ParserResult.php +++ b/lib/Doctrine/ORM/Query/ParserResult.php @@ -131,7 +131,8 @@ public function getParameterMappings() * * @param string|int $dqlPosition The name or position of the DQL parameter. * - * @psalm-return list The positions of the corresponding SQL parameters. + * @return int[] The positions of the corresponding SQL parameters. + * @psalm-return list */ public function getSqlParameterPositions($dqlPosition) { diff --git a/lib/Doctrine/ORM/Query/QueryException.php b/lib/Doctrine/ORM/Query/QueryException.php index edfbc123c1f..4f2d8f32c43 100644 --- a/lib/Doctrine/ORM/Query/QueryException.php +++ b/lib/Doctrine/ORM/Query/QueryException.php @@ -165,6 +165,7 @@ public static function invalidLiteral($literal) } /** + * @param string[] $assoc * @psalm-param array $assoc * * @return QueryException @@ -190,6 +191,7 @@ public static function partialObjectsAreDangerous() } /** + * @param string[] $assoc * @psalm-param array $assoc * * @return QueryException @@ -215,6 +217,7 @@ public static function associationPathInverseSideNotSupported(PathExpression $pa } /** + * @param string[] $assoc * @psalm-param array $assoc * * @return QueryException diff --git a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php index 52fefde70f0..017d438c138 100644 --- a/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php +++ b/lib/Doctrine/ORM/Query/ResultSetMappingBuilder.php @@ -84,10 +84,11 @@ public function __construct(EntityManagerInterface $em, $defaultRenameMode = sel /** * Adds a root entity and all of its fields to the result set. * - * @param string $class The class name of the root entity. - * @param string $alias The unique alias to use for the root entity. - * @param int|null $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM). - * @psalm-param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName). + * @param string $class The class name of the root entity. + * @param string $alias The unique alias to use for the root entity. + * @param string[] $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 array $renamedColumns * * @return void */ @@ -103,13 +104,14 @@ public function addRootEntityFromClassMetadata($class, $alias, $renamedColumns = /** * Adds a joined entity and all of its fields to the result set. * - * @param string $class The class name of the joined entity. - * @param string $alias The unique alias to use for the joined entity. - * @param string $parentAlias The alias of the entity result that is the parent of this joined result. - * @param string $relation The association field that connects the parent entity result - * with the joined entity result. - * @param int|null $renameMode One of the COLUMN_RENAMING_* constants or array for BC reasons (CUSTOM). - * @psalm-param array $renamedColumns Columns that have been renamed (tableColumnName => queryColumnName). + * @param string $class The class name of the joined entity. + * @param string $alias The unique alias to use for the joined entity. + * @param string $parentAlias The alias of the entity result that is the parent of this joined result. + * @param string $relation The association field that connects the parent entity result + * with the joined entity result. + * @param string[] $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 array $renamedColumns * * @return void */ @@ -125,8 +127,9 @@ public function addJoinedEntityFromClassMetadata($class, $alias, $parentAlias, $ /** * Adds all fields of the given class to the result set mapping (columns and meta fields). * - * @param string $class - * @param string $alias + * @param string $class + * @param string $alias + * @param string[] $columnAliasMap * @psalm-param array $columnAliasMap * * @return void @@ -425,6 +428,7 @@ public function addNamedNativeQueryEntityResultMapping(ClassMetadataInfo $classM * Works only for all the entity results. The select parts for scalar * expressions have to be written manually. * + * @param string[] $tableAliases * @psalm-param array $tableAliases * * @return string diff --git a/lib/Doctrine/ORM/Query/SqlWalker.php b/lib/Doctrine/ORM/Query/SqlWalker.php index 41663f765c8..9829965baed 100644 --- a/lib/Doctrine/ORM/Query/SqlWalker.php +++ b/lib/Doctrine/ORM/Query/SqlWalker.php @@ -240,14 +240,15 @@ public function getEntityManager() * * @param string $dqlAlias The DQL alias. * + * @return mixed[] * @psalm-return array{ - * metadata: ClassMetadata, - * parent: string, - * relation: mixed[], - * map: mixed, - * nestingLevel: int, - * token: array - * } + * metadata: ClassMetadata, + * parent: string, + * relation: mixed[], + * map: mixed, + * nestingLevel: int, + * token: array + * } */ public function getQueryComponent($dqlAlias) { diff --git a/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php b/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php index ac828139110..cf30c20830a 100644 --- a/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php +++ b/lib/Doctrine/ORM/Query/TreeWalkerChainIterator.php @@ -106,6 +106,8 @@ public function offsetExists($offset) } /** + * @param mixed $offset + * * @return TreeWalker|null */ public function offsetGet($offset) diff --git a/lib/Doctrine/ORM/QueryBuilder.php b/lib/Doctrine/ORM/QueryBuilder.php index df24824458e..1f0c5a8526f 100644 --- a/lib/Doctrine/ORM/QueryBuilder.php +++ b/lib/Doctrine/ORM/QueryBuilder.php @@ -690,9 +690,10 @@ public function getMaxResults() * The available parts are: 'select', 'from', 'join', 'set', 'where', * 'groupBy', 'having' and 'orderBy'. * - * @param string $dqlPartName The DQL part name. - * @param bool $append Whether to append (true) or replace (false). - * @psalm-param string|object|list|array{join: array} $dqlPart An Expr object. + * @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 * * @return self */ @@ -1465,6 +1466,7 @@ private function getReducedDQLQueryPart(string $queryPartName, array $options = /** * Resets DQL parts. * + * @param string[]|null $parts * @psalm-param list|null $parts * * @return self diff --git a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php index 682f860acd1..60da8055ce6 100644 --- a/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php +++ b/lib/Doctrine/ORM/Tools/ConvertDoctrine1Schema.php @@ -59,6 +59,7 @@ class ConvertDoctrine1Schema * Constructor passes the directory or array of directories * to convert the Doctrine 1 schema files from. * + * @param string[]|string $from * @psalm-param list|string $from */ public function __construct($from) diff --git a/lib/Doctrine/ORM/UnitOfWork.php b/lib/Doctrine/ORM/UnitOfWork.php index 4ece50f3bd6..ba09d4ce46a 100644 --- a/lib/Doctrine/ORM/UnitOfWork.php +++ b/lib/Doctrine/ORM/UnitOfWork.php @@ -590,6 +590,7 @@ private function executeExtraUpdates(): void * * @param object $entity * + * @return mixed[][] * @psalm-return array */ public function & getEntityChangeSet($entity) @@ -2632,7 +2633,8 @@ private function newInstance($class) * * @param string $className The name of the entity class. * @param mixed[] $data The data for the entity. - * @psalm-param array $hints Any hints to account for during reconstitution/lookup of the entity. + * @param mixed[] $hints Any hints to account for during reconstitution/lookup of the entity. + * @psalm-param array $hints * * @return object The managed entity instance. * @@ -2984,6 +2986,7 @@ public function getIdentityMap() * * @param object $entity * + * @return mixed[] * @psalm-return array */ public function getOriginalEntityData($entity) diff --git a/lib/Doctrine/ORM/Utility/IdentifierFlattener.php b/lib/Doctrine/ORM/Utility/IdentifierFlattener.php index 954501d4a4b..864c7dcd29e 100644 --- a/lib/Doctrine/ORM/Utility/IdentifierFlattener.php +++ b/lib/Doctrine/ORM/Utility/IdentifierFlattener.php @@ -62,6 +62,7 @@ public function __construct(UnitOfWork $unitOfWork, ClassMetadataFactory $metada * * @param mixed[] $id * + * @return mixed[] * @psalm-return array */ public function flattenIdentifier(ClassMetadata $class, array $id)