diff --git a/composer.json b/composer.json index 864ab6e161f..ea97e49c498 100644 --- a/composer.json +++ b/composer.json @@ -42,14 +42,14 @@ "doctrine/annotations": "^1.13 || ^2", "doctrine/coding-standard": "^9.0.2 || ^12.0", "phpbench/phpbench": "^0.16.10 || ^1.0", - "phpstan/phpstan": "~1.4.10 || 1.10.25", + "phpstan/phpstan": "~1.4.10 || 1.10.28", "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6", "psr/log": "^1 || ^2 || ^3", "squizlabs/php_codesniffer": "3.7.2", "symfony/cache": "^4.4 || ^5.4 || ^6.0", "symfony/var-exporter": "^4.4 || ^5.4 || ^6.2", "symfony/yaml": "^3.4 || ^4.0 || ^5.0 || ^6.0", - "vimeo/psalm": "4.30.0 || 5.13.1" + "vimeo/psalm": "4.30.0 || 5.14.1" }, "conflict": { "doctrine/annotations": "<1.13 || >= 3.0" diff --git a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php index abd94fd01e3..827ef873b5a 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/XmlDriver.php @@ -944,7 +944,10 @@ private function cacheToArray(SimpleXMLElement $cacheMapping): array private function getCascadeMappings(SimpleXMLElement $cascadeElement): array { $cascades = []; - foreach ($cascadeElement->children() as $action) { + $children = $cascadeElement->children(); + assert($children !== null); + + foreach ($children as $action) { // According to the JPA specifications, XML uses "cascade-persist" // instead of "persist". Here, both variations // are supported because YAML, Annotation and Attribute use "persist" diff --git a/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php b/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php index c5b7ecc2c6c..e1c7b13fcfd 100644 --- a/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php +++ b/lib/Doctrine/ORM/Mapping/UnderscoreNamingStrategy.php @@ -30,7 +30,10 @@ class UnderscoreNamingStrategy implements NamingStrategy /** @var int */ private $case; - /** @var string */ + /** + * @var string + * @psalm-var non-empty-string + */ private $pattern; /** diff --git a/lib/Doctrine/ORM/Tools/EntityGenerator.php b/lib/Doctrine/ORM/Tools/EntityGenerator.php index 5bf086d52b5..04be6551881 100644 --- a/lib/Doctrine/ORM/Tools/EntityGenerator.php +++ b/lib/Doctrine/ORM/Tools/EntityGenerator.php @@ -1376,7 +1376,7 @@ protected function generateEntityStubMethod(ClassMetadataInfo $metadata, $type, $this->staticReflection[$metadata->name]['methods'][] = strtolower($methodName); $var = sprintf('%sMethodTemplate', $type); - $template = static::$$var; + $template = (string) static::$$var; $methodTypeHint = ''; $types = Type::getTypesMap(); @@ -1695,7 +1695,7 @@ protected function generateFieldMappingPropertyDocBlock(array $fieldMapping, Cla } if (isset($fieldMapping['options']['comment']) && $fieldMapping['options']['comment']) { - $options[] = '"comment"="' . str_replace('"', '""', $fieldMapping['options']['comment']) . '"'; + $options[] = '"comment"="' . str_replace('"', '""', (string) $fieldMapping['options']['comment']) . '"'; } if (isset($fieldMapping['options']['collation']) && $fieldMapping['options']['collation']) { diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php index 02fae2564c6..6bcd178d030 100644 --- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php +++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php @@ -404,7 +404,7 @@ private function recreateInnerSql( /** * @return string[][] - * @psalm-return array{0: list, 1: list} + * @psalm-return array{0: list, 1: list} */ private function generateSqlAliasReplacements(): array { diff --git a/psalm-baseline.xml b/psalm-baseline.xml index fb8846989ba..d7e3f499397 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,5 +1,5 @@ - + IterableResult @@ -964,9 +964,6 @@ children()]]> children()]]> - - children()]]> - getName() === 'embeddable']]> getName() === 'entity']]>