From 52a6a21387380b09419a66a7ec1c66f6cab69b20 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 1 Mar 2024 10:47:18 +0100 Subject: [PATCH] Psalm 5.22.2 (#11326) --- composer.json | 2 +- psalm-baseline.xml | 1611 ++++++++++++++++++++++++-------------------- psalm.xml | 6 + 3 files changed, 880 insertions(+), 739 deletions(-) diff --git a/composer.json b/composer.json index 108d37fdc5c..c43da335c67 100644 --- a/composer.json +++ b/composer.json @@ -49,7 +49,7 @@ "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.16.0" + "vimeo/psalm": "4.30.0 || 5.22.2" }, "conflict": { "doctrine/annotations": "<1.13 || >= 3.0" diff --git a/psalm-baseline.xml b/psalm-baseline.xml index 223173b32f4..2ee190b60d7 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,57 +1,57 @@ - + - IterableResult + - iterate + - in_array($fetchMode, [Mapping\ClassMetadata::FETCH_EAGER, Mapping\ClassMetadata::FETCH_LAZY], true) + isEmpty() ? $filteredParameters->first() : null]]> - Parameter|null + - \Doctrine\Common\Cache\Cache + - $alias - $data - $data + + + _em->getConfiguration()->getResultCacheImpl()]]> _queryCacheProfile->getResultCacheDriver()]]> - $stmt - $stmt + + - getCacheLogger - getQueryCache + + - (bool) $cacheable - (int) $cacheMode - (int) $lifetime - (string) $cacheRegion + + + + - getTimestampRegion + - (string) $association - (string) $entityClass + + @@ -64,18 +64,18 @@ ->getCacheFactory()]]> - getCacheFactory + - string + fileLockRegionDirectory]]> - (string) $fileLockRegionDirectory + @@ -91,7 +91,7 @@ - getCacheRegion + @@ -102,30 +102,30 @@ identifiers[$index]]]> - $id + class]]> class]]> - getCacheLogger + - assert($cm instanceof ClassMetadata) + - getCacheRegion - resolveAssociationEntries - resolveAssociationEntries - storeEntityCache - storeEntityCache + + + + + - $cache - $entityKey + + identifiers]]> @@ -135,8 +135,8 @@ getOwner()]]> - buildCollectionHydrator - getCacheFactory + + @@ -156,16 +156,16 @@ getOwner()]]> - lock - lock + + - $cacheEntry + - loadAll + class]]> @@ -178,31 +178,31 @@ getCache()]]> - getCacheFactory - getTimestampRegion + + - assert($metadata instanceof ClassMetadata) + - getCacheRegion - getCacheRegion - getCacheRegion - getCacheRegion - loadCollectionCache - loadCollectionCache - storeCollectionCache - storeCollectionCache - storeEntityCache + + + + + + + + + - $isChanged + - lock - lock + + @@ -210,27 +210,27 @@ cache]]> - CacheProvider + - (int) $defaultLifetime - (int) $defaultLifetime - (int) $defaultLockLifetime - (int) $defaultLockLifetime - (int) $lifetime - (int) $lifetime + + + + + + - (float) $time + - (string) $space + @@ -240,71 +240,71 @@ - $className + - getMetadataCacheImpl - getQueryCacheImpl + + - (bool) $flag + - copy - getHydrator - transactional - transactional + + + + wrapped->getClassMetadata($className)]]> - getClassMetadata + - $entity - $lockMode - $lockVersion + + + - wrapInTransaction + - $className + - find - flush + + - $className - $connection - $entityName + + + - getMetadataCacheImpl - merge + + - is_object($entity) - is_object($entity) - is_object($entity) - is_object($entity) - is_object($entity) + + + + + - ClassMetadataFactory + - $entity - $entity - $entity - $entity + + + + name ? $entity : null]]> name ? $entity : null]]> load($sortedId, null, null, [], $lockMode)]]> @@ -312,124 +312,131 @@ metadataFactory->getMetadataFor($className)]]> - ?T - getClassMetadata + + - wrapInTransaction + - $entity - $entity - $entity - $entity - $entity - $entityName - $entityName + + + + + + + getProxyDir()]]> getProxyNamespace()]]> - createCache - getCacheFactory + + - new $metadataFactoryClassName() + - (string) $hydrationMode + - $repository instanceof EntityRepository - is_object($connection) + + - new $class($this) + - addNamedNativeQueryMapping + load($criteria, null, null, [], null, 1, $orderBy)]]> - new LazyCriteriaCollection($persister, $criteria) + - ?T + &Selectable]]> - find + - (string) $className + - BaseORMException + - $entity + - serialize - unserialize + + - $currentLevel + nextValue]]> nextValue]]> - getTableHiLoCurrentValSql - getTableHiLoUpdateNextValSql + + - IterableResult - new IterableResult($this) + + + + associationMappings[$fieldName]['joinColumns'][0]]]> + associationMappings[$fieldName]['joinColumns'][0]['name']]]> + + + + associationMappings[$fieldName]['joinColumns']]]> associationMappings[$fieldName]['joinColumns']]]> - return $rowData; - return $rowData; + + - $index + - $result[$resultKey] - $result[$resultKey] + + - $result + - $baseElement + resultPointers[$parent]]]> @@ -441,10 +448,10 @@ - mixed[]|false + - Iterator + hydrator->hydrateRow()]]> @@ -456,32 +463,40 @@ - $element + - $index + - $parentObject - $parentObject - $parentObject - $parentObject - $parentObject - $parentObject - $parentObject + + + + + + + + + associationMappings[$class->identifier[0]]['joinColumns'][0]]]> + associationMappings[$class->identifier[0]]['joinColumns'][0]['name']]]> + associationMappings[$fieldName]['joinColumns'][0]]]> + associationMappings[$fieldName]['joinColumns'][0]['name']]]> + + + reflFields]]> - getValue - getValue - getValue - setValue - setValue + + + + + associationMappings[$class->identifier[0]]['joinColumns']]]> @@ -491,71 +506,77 @@ - $class + + + + + + + - $repositoryClassName + - addNamedQuery + - $class + - $generatedValue - $sequenceDef - $version + + + - (bool) $flag - (bool) $flag - (string) $customIdGenerator + + + - ClassMetadata - ClassMetadata - ClassMetadata - ClassMetadata + + + + - $class - $class - $platformFamily + + + - new UuidGenerator() + - ClassMetadata::GENERATOR_TYPE_UUID + - addNamedNativeQuery - addNamedQuery + + table[$indexType][$indexName]]]> - $driver - $evm + + table[$indexType]]]> @@ -565,21 +586,21 @@ em]]> - getConfiguration - getConfiguration - getConfiguration - getConfiguration - getConfiguration - getConnection + + + + + + - $mapping + - canEmulateSchemas - canRequireSQLConversion + + columnNames]]> @@ -588,79 +609,88 @@ columnNames]]> - table]]> table]]> - - $mapping - $mapping - $overrideMapping + + + - ReflectionProperty - ReflectionProperty - getAssociationMappedByTargetField + + + + + - $definition + sqlResultSetMappings]]> - $mapping + reflClass]]> - AssociationMapping - getReflectionClass + + - $columnNames - $mapping - $quotedColumnNames + + + - FieldMapping + ]]> ]]> + associationMappings[$fieldName]['joinColumns'][0]['name']]]> + associationMappings[$fieldName]['joinColumns'][0]['referencedColumnName']]]> associationMappings[$fieldName]['mappedBy']]]> reflClass]]> reflFields[$name]]]> reflFields[$this->identifier[0]]]]> - $entity - $fieldName - $fieldName + + + - $class - $className + + + + + associationMappings[$fieldName]['joinColumns'][0]]]> + associationMappings[$fieldName]['joinColumns'][0]]]> + associationMappings[$fieldName]['joinColumns'][0]['name']]]> + associationMappings[$fieldName]['joinColumns'][0]['referencedColumnName']]]> + reflClass->name]]> reflClass->name]]> - getProperty - getProperty - getProperty - getValue - getValue - getValue - instantiate - setValue - setValue + + + + + + + + + @@ -675,35 +705,34 @@ associationMappings[$idProperty]['joinColumns']]]> - $idGenerator - $namespace - $table - $tableGeneratorDefinition + + + + - $mapping !== false - $mapping !== false - + + - array_values + - joinColumnName - joinColumnName + + - $name + - is_object($object) + - new $className() + instances]]> @@ -716,15 +745,21 @@ - canEmulateSchemas - canEmulateSchemas + + - $quotedColumnNames + - getIdentifierColumnNames + + + + + + + associationMappings[$fieldName]['joinColumns']]]> @@ -732,19 +767,19 @@ - $mapping + - array + - array_merge(self::DEFAULT_TYPED_FIELD_MAPPINGS, $typedFieldMappings) + - addNamedNativeQuery - addNamedQuery + + - $mapping + - $metadata + - array{ + + * }]]> - $listenerClassName + @@ -791,16 +826,16 @@ name)]]> - mapEmbedded - mapManyToMany - mapManyToOne - mapOneToMany - mapOneToOne + + + + + - $columnDef + - $mapping + - $metadata + - array{ + + * }]]> - $listenerClassName + getReflectionClass()]]> - assert($cacheAttribute instanceof Mapping\Cache) - assert($method instanceof ReflectionMethod) - assert($method instanceof ReflectionMethod) - assert($property instanceof ReflectionProperty) + + + + name)]]> @@ -848,46 +883,46 @@ - $metadata instanceof ClassMetadata + namespace . $this->classNamesForTables[$tableName]]]> namespace . $this->inflector->classify(strtolower($tableName))]]> - $metadata + - class-string + - $metadata + tables[$tableName]]]> tables[$tableName]]]> - getColumns - getColumns - getIndexes + + + - PHPDriver + - $fileExtension - $prefixes + + - $fileExtension - $prefixes + + @@ -896,11 +931,11 @@ - addNamedNativeQuery - addNamedQuery + + - $columnDef + table]]> @@ -910,15 +945,15 @@ {'discriminator-map'}]]> - $mapping - $result + + $usage, 'region' => $region, ]]]> - array{ + - array{usage: int|null, region?: string} - loadMappingFile + * }]]> + + - $fileExtension - $locator + + - $metadata + {'discriminator-column'}]]> @@ -965,8 +1000,8 @@ ]]]> - addNamedNativeQuery - addNamedQuery + + - $fileExtension - $locator + + - $metadata + - array{usage: int|null, region: string|null} + - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element + + + + + + + + + + + + + + + + + + - $element - $element - $element - $element - $element - $element - $element - $element - $element - $element + + + + + + + + + + - $columnPrefix + - $discriminatorColumn - $entityClass + + - $column - $name + + - $value + - $inverseJoinColumns - $joinColumns + + - $className - $className - $indexName - $indexName + + + + - $name - $query - $resultClass - $resultSetMapping + + + + - $value + - $name - $query + + @@ -1077,33 +1112,33 @@ embeddedClass]]> - $object - $object - $value + + + - ReflectionEmbeddedProperty - ReflectionEmbeddedProperty + + - (string) $embeddedClass + - ReflectionEnumProperty - ReflectionEnumProperty + + - ReflectionReadonlyProperty - ReflectionReadonlyProperty + + - $name + @@ -1113,14 +1148,14 @@ - $sql + ]]> - object|null - object|null + + unwrap()->matching($criteria)]]> - $offset + - $value - $value + + backRefFieldName]]> + getMapping()['indexBy']]]> - setValue - setValue + + @@ -1172,8 +1208,25 @@ getOwner()]]> getOwner()]]> getOwner()]]> - $owner + + + + + + + + + + + + + + + + + + associationMappings]]> associationMappings]]> @@ -1181,17 +1234,33 @@ associationMappings]]> associationMappings]]> + + + + + + + + + + + + + + + + - getFieldForColumn - getFieldForColumn + + - $mapping[$sourceRelationMode] - $mapping[$targetRelationMode] + + @@ -1211,7 +1280,7 @@ - int|null + associationMappings]]> + + associationMappings[$mapping['mappedBy']]['joinColumns']]]> + associationMappings[$mapping['mappedBy']]['joinColumns']]]> @@ -1237,53 +1309,55 @@ - $assoc - $association + + - $value === null + - $assoc + getMetadataFactory()]]> - $hints - $hints + + true]]]> true]]]> true]]]> - loadOneToOneEntity + - $newValue - [$params, $types] - [$sqlParams, $sqlTypes] + + + - loadAll + - expandCriteriaParameters - expandParameters + + ]]> - $targetEntity - $targetEntity + + - $association - $type + + + + @@ -1293,16 +1367,22 @@ class->associationMappings]]> - $joinColumns + + + + + + + - getValue - getValue - getValue - getValue - getValue - getValue - setValue + + + + + + + @@ -1332,18 +1412,18 @@ - $selectJoinSql + - $class + - (bool) $handlesLimits + - loadAll + @@ -1358,27 +1438,27 @@ - $columnList + - $className - substr($className, $pos + Proxy::MARKER_LENGTH + 2) + + - string + - $classMetadata - $classMetadata - $classMetadata + + + - createCloner - createInitializer + + getReflectionProperties()]]> @@ -1386,7 +1466,7 @@ getMetadataFactory()]]> - Closure + proxyFactories]]> @@ -1399,125 +1479,127 @@ proxyFactories[$className] = $proxyFactory]]> - $i + - $i + name]]> name]]> - getValue - setAccessible - setValue - setValue + + + 4]]> - __wakeup + + + + - require $fileName + - IterableResult + - parent::iterate($parameters, $hydrationMode) + - $sqlParams + getDQL()]]> - evictEntityRegion + - $parserResult + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + @@ -1543,9 +1625,9 @@ ArithmeticPrimary()]]> - null - null - null + + + unit->value]]> @@ -1564,10 +1646,16 @@ - $sqlWalker + + + + + + + @@ -1587,10 +1675,22 @@ + + + + + + + + associationMappings]]> associationMappings]]> + + + + @@ -1609,27 +1709,27 @@ - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + @@ -1637,161 +1737,161 @@ simpleStateFieldPathExpression]]> - dispatch + walkIndexBy($this)]]> - $sqlWalker + - null - null + + - $sqlWalker + - $sqlWalker + - $sqlWalker + - walkJoinPathExpression + - walkJoinVariableDeclaration + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - null + - $sqlWalker + - $sqlWalker + - $sqlWalker + - walkWhenClauseExpression + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - $sqlWalker + - walkWhenClauseExpression + - $sqlWalker + @@ -1804,12 +1904,12 @@ sqlStatements === null]]> - null + - $_sqlStatements - $queryCacheProfile - $sqlStatements + + + _sqlStatements !== null]]> @@ -1824,33 +1924,33 @@ - $numDeleted + - int + sqlStatements]]> - MultiTableDeleteExecutor - MultiTableDeleteExecutor + + - $numUpdated + - int + sqlStatements]]> - MultiTableUpdateExecutor - MultiTableUpdateExecutor - MultiTableUpdateExecutor + + + @@ -1858,8 +1958,8 @@ sqlStatements]]> - SingleSelectExecutor - SingleSelectExecutor + + @@ -1867,31 +1967,31 @@ executeStatement($this->sqlStatements, $params, $types)]]> - int + sqlStatements]]> - SingleTableDeleteUpdateExecutor - SingleTableDeleteUpdateExecutor - SingleTableDeleteUpdateExecutor + + + - $y + - $allowedClasses - $parts + + - $part + @@ -1904,7 +2004,7 @@ - $parts + @@ -1914,27 +2014,27 @@ - $parts + - $allowedClasses - $parts + + - $allowedClasses - $parts + + - $value + - static function ($value) use ($connection, $param) { + parameters]]> @@ -1942,50 +2042,50 @@ - Connection::PARAM_INT_ARRAY - Connection::PARAM_STR_ARRAY + + - $stringPattern + - AST\SelectStatement|AST\UpdateStatement|AST\DeleteStatement + queryComponents]]> - $factors[0] - $primary - $terms[0] + + + - AST\ArithmeticFactor - AST\ArithmeticTerm - AST\SimpleArithmeticExpression|AST\ArithmeticTerm + + + - new $functionClass($functionName) - new $functionClass($functionName) - new $functionClass($functionName) + + + - $function - $function - $function + + + - $statement + - $AST - $expr - $pathExp + + + lexer->getLiteral($token)]]> lexer->getLiteral($token)]]> lexer->getLiteral($token)]]> @@ -1994,7 +2094,7 @@ SimpleArithmeticExpression()]]> - $dql + query->getDQL()]]> value]]> @@ -2004,16 +2104,16 @@ value]]> - $args + - $AST instanceof AST\SelectStatement - $token === Lexer::T_IDENTIFIER + + - $sqlExecutor + @@ -2024,18 +2124,18 @@ ]]> - Comparison::EQ + - $class + - addNamedNativeQueryEntityResultMapping - addNamedNativeQueryEntityResultMapping - addNamedNativeQueryResultClassMapping - addNamedNativeQueryResultSetMapping + + + + @@ -2046,70 +2146,70 @@ - is_string($expression) + - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string - string + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - $expr + queryComponents[$expression]]]> - string + - $query + - $expression + whereClause]]> @@ -2117,10 +2217,28 @@ whereClause]]> simpleArithmeticExpression]]> subselect]]> - $condExpr + + + + + rangeVariableDeclaration]]> + + whereClause]]> + + + + + + + + + + + + associationMappings]]> associationMappings]]> @@ -2128,8 +2246,16 @@ scalarResultAliasMap]]> scalarResultAliasMap]]> + + + + + + + + - dispatch + @@ -2144,37 +2270,37 @@ - $whereClause !== null + - getExecutor + - null + - getExecutor + - $dqlAlias + - null + - $condPrimary + - $value + - TreeWalker|null + |false]]> @@ -2191,35 +2317,35 @@ $join]]]> - getRootAlias - getRootAlias + + isEmpty() ? $filteredParameters->first() : null]]> - Parameter|null + - new ArrayCollection($parameters) + - $spacePos - $spacePos + + - $spacePos - $spacePos + + - $dqlPart + - $alias - $alias + + - self::SELECT + @@ -2228,58 +2354,58 @@ repositoryList[$repositoryHash] = $this->createRepository($entityManager, $entityName)]]> - ObjectRepository + - $repository instanceof EntityRepository + - new $repositoryClassName($entityManager, $metadata) + - evictAll + - evictAll + - getQueryCacheImpl + - $fromPaths - $metadata + + - ClassMetadataExporter - ClassMetadataExporter - ClassMetadataExporter|null - EntityGenerator - EntityGenerator - EntityGenerator|null - new ClassMetadataExporter() - new ConvertDoctrine1Schema($fromPaths) - new EntityGenerator() - private $entityGenerator = null; - private $metadataExporter = null; + + + + + + + + + + + - $metadata + - AbstractExporter - new ClassMetadataExporter() - new DisconnectedClassMetadataFactory() - new EntityGenerator() + + + + name]]> @@ -2287,16 +2413,16 @@ - connect + - $metadatas + - new DisconnectedClassMetadataFactory() - new EntityGenerator() + + name]]> @@ -2312,7 +2438,7 @@ - new EntityRepositoryGenerator() + customRepositoryClassName]]> @@ -2320,7 +2446,7 @@ - getAllClassNames + @@ -2328,12 +2454,12 @@ entityListeners]]> - getAllClassNames + - int + executeSchemaCommand($input, $output, new SchemaTool($em), $metadatas, $ui)]]> @@ -2341,15 +2467,15 @@ - $metadatas - $metadatas + + - $metadatas - $metadatas - $metadatas + + + getName()]]> @@ -2358,7 +2484,7 @@ - $metadatas + getName()]]> @@ -2367,20 +2493,23 @@ - new ArrayIterator($metadatas) + - MetadataFilter + + + + - $state === UnitOfWork::STATE_DETACHED + @@ -2391,20 +2520,20 @@ - $tokens[$i - 1] + - $last + name, '\\')]]> - $variableType + - $classToExtend + - (bool) $embeddablesImmutable + lifecycleCallbacks)]]> @@ -2412,43 +2541,43 @@ - $fullClassName - $fullClassName - $fullClassName + + + - $repositoryName + - Driver\AbstractExporter - Driver\AnnotationExporter::class - Driver\PhpExporter::class - Driver\XmlExporter::class - Driver\YamlExporter::class - Driver\YamlExporter::class - ExportException::invalidExporterDriverType($type) + + + + + + + - new $class($dest) + - new $class($dest) + - Driver\AbstractExporter + - ExportException::attemptOverwriteExistingFile($path) + - string + _outputDir]]> @@ -2456,12 +2585,12 @@ - AbstractExporter - EntityGenerator - EntityGenerator|null + + + - $_extension + @@ -2469,10 +2598,10 @@ changeTrackingPolicy]]> - AbstractExporter + - $_extension + @@ -2488,10 +2617,10 @@ asXML()]]> - AbstractExporter + - $_extension + @@ -2506,22 +2635,22 @@ changeTrackingPolicy]]> - AbstractExporter + null]]]> - $array + - $array + &array{entityListeners: array>}]]> - $_extension + @@ -2535,7 +2664,7 @@ - $query + associationMappings[$property]['joinColumns']]]> @@ -2543,7 +2672,7 @@ - $query + @@ -2564,29 +2693,29 @@ - $parameters + - (bool) $fetchJoinCollection + - $orderByClause + - $classes + - canEmulateSchemas + - $asset + - $referencedFieldName + @@ -2598,14 +2727,14 @@ - is_numeric($indexName) + - assert(is_array($assoc)) - is_array($assoc) + + - $indexName + @@ -2622,7 +2751,7 @@ - $paths + @@ -2635,12 +2764,12 @@ - ! is_object($object) - is_object($object) + + - $collectionToDelete - $collectionToUpdate + + getMetadataFactory()]]> @@ -2648,80 +2777,80 @@ entityChangeSets]]> - $managedCopy - $prevManagedCopy - $previousManagedCopy + + + - $entityState - $entityState - $object + + + - $value + identityMap[$rootClassName]]]> - $assoc - $assoc + + getTypeOfField($class->getSingleIdentifierFieldName())]]> getOwner()]]> getOwner()]]> - $owner + reflFields]]> reflFields]]> - buildCachedCollectionPersister - buildCachedEntityPersister - getCacheFactory - getCacheFactory - getValue - getValue - getValue - getValue - getValue - getValue - getValue - getValue - getValue - getValue - getValue - getValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue - setValue + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - unwrap - unwrap - unwrap + + + - is_array($entity) + - $visited + @@ -2739,6 +2868,12 @@ + + + + + + diff --git a/psalm.xml b/psalm.xml index 46d39f56301..19b4e9368ca 100644 --- a/psalm.xml +++ b/psalm.xml @@ -243,6 +243,12 @@ + + + + + +