Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Psalm 5.10.0 #10677

Merged
merged 1 commit into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
"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.9.0"
"vimeo/psalm": "4.30.0 || 5.10.0"
},
"conflict": {
"doctrine/annotations": "<1.13 || >= 3.0"
Expand Down
146 changes: 67 additions & 79 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.9.0@8b9ad1eb9e8b7d3101f949291da2b9f7767cd163">
<files psalm-version="5.10.0@a5effd2d2dddd1a7ea7a0f6a051ce63ff979e356">
<file src="lib/Doctrine/ORM/AbstractQuery.php">
<DeprecatedClass>
<code>IterableResult</code>
Expand Down Expand Up @@ -458,6 +458,9 @@
</RedundantConditionGivenDocblockType>
</file>
<file src="lib/Doctrine/ORM/Internal/Hydration/ObjectHydrator.php">
<InvalidArgument>
<code>$element</code>
</InvalidArgument>
<PossiblyFalseArgument>
<code>$index</code>
</PossiblyFalseArgument>
Expand Down Expand Up @@ -610,17 +613,14 @@
<code><![CDATA[$this->subClasses]]></code>
</InvalidPropertyAssignmentValue>
<InvalidReturnStatement>
<code>$mapping</code>
<code>$mapping</code>
<code><![CDATA[$this->reflClass]]></code>
</InvalidReturnStatement>
<InvalidReturnType>
<code>AssociationMapping</code>
<code>FieldMapping</code>
<code>getReflectionClass</code>
</InvalidReturnType>
<LessSpecificReturnStatement>
<code>$cache</code>
<code>$className</code>
<code>$className</code>
<code>$columnNames</code>
Expand All @@ -632,8 +632,7 @@
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<MoreSpecificReturnType>
<code>AssociationMapping</code>
<code>array{usage: int, region: string|null}</code>
<code>FieldMapping</code>
<code>class-string|null</code>
<code><![CDATA[list<string>]]></code>
<code><![CDATA[list<string>]]></code>
Expand Down Expand Up @@ -743,12 +742,12 @@
</PossiblyUndefinedArrayOffset>
</file>
<file src="lib/Doctrine/ORM/Mapping/DefaultTypedFieldMapper.php">
<InvalidReturnStatement>
<LessSpecificReturnStatement>
<code>$mapping</code>
</InvalidReturnStatement>
<InvalidReturnType>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code>array</code>
</InvalidReturnType>
</MoreSpecificReturnType>
<PropertyTypeCoercion>
<code>array_merge(self::DEFAULT_TYPED_FIELD_MAPPINGS, $typedFieldMappings)</code>
</PropertyTypeCoercion>
Expand Down Expand Up @@ -914,8 +913,18 @@
<InvalidPropertyAssignmentValue>
<code><![CDATA[$metadata->table]]></code>
</InvalidPropertyAssignmentValue>
<InvalidPropertyFetch>
<code><![CDATA[$indexXml->options]]></code>
<code><![CDATA[$uniqueXml->options]]></code>
<code><![CDATA[$xmlRoot->{'discriminator-column'}]]></code>
<code><![CDATA[$xmlRoot->{'discriminator-map'}]]></code>
</InvalidPropertyFetch>
<InvalidReturnStatement>
<code>$mapping</code>
<code><![CDATA[[
'usage' => $usage,
'region' => $region,
]]]></code>
</InvalidReturnStatement>
<InvalidReturnType>
<code>array{
Expand All @@ -934,74 +943,48 @@
* columnDefinition?: string,
* options?: array
* }</code>
<code>array{usage: int|null, region?: string}</code>
</InvalidReturnType>
<LessSpecificReturnStatement>
<code><![CDATA[[
'usage' => $usage,
'region' => $region,
]]]></code>
</LessSpecificReturnStatement>
<MissingParamType>
<code>$fileExtension</code>
<code>$locator</code>
</MissingParamType>
<MoreSpecificImplementedParamType>
<code>$metadata</code>
</MoreSpecificImplementedParamType>
<MoreSpecificReturnType>
<code>array{usage: int|null, region?: string}</code>
</MoreSpecificReturnType>
<NoInterfaceProperties>
<code><![CDATA[$indexXml->options]]></code>
<code><![CDATA[$uniqueXml->options]]></code>
<code><![CDATA[$xmlRoot->{'discriminator-column'}]]></code>
<code><![CDATA[$xmlRoot->{'discriminator-map'}]]></code>
</NoInterfaceProperties>
<PossiblyInvalidPropertyFetch>
<code><![CDATA[$indexXml->options]]></code>
<code><![CDATA[$uniqueXml->options]]></code>
<code><![CDATA[$xmlRoot->{'discriminator-column'}]]></code>
<code><![CDATA[$xmlRoot->{'discriminator-map'}]]></code>
</PossiblyInvalidPropertyFetch>
<RedundantCondition>
<code><![CDATA[isset($xmlRoot->cache)]]></code>
<code><![CDATA[isset($xmlRoot->embedded)]]></code>
<code><![CDATA[isset($xmlRoot->field)]]></code>
<code><![CDATA[isset($xmlRoot->indexes)]]></code>
<code><![CDATA[isset($xmlRoot->options)]]></code>
<code><![CDATA[isset($xmlRoot->{'association-overrides'})]]></code>
<code><![CDATA[isset($xmlRoot->{'attribute-overrides'})]]></code>
<code><![CDATA[isset($xmlRoot->{'entity-listeners'})]]></code>
<code><![CDATA[isset($xmlRoot->{'lifecycle-callbacks'})]]></code>
<code><![CDATA[isset($xmlRoot->{'many-to-many'})]]></code>
<code><![CDATA[isset($xmlRoot->{'many-to-one'})]]></code>
<code><![CDATA[isset($xmlRoot->{'named-native-queries'})]]></code>
<code><![CDATA[isset($xmlRoot->{'named-queries'})]]></code>
<code><![CDATA[isset($xmlRoot->{'one-to-many'})]]></code>
<code><![CDATA[isset($xmlRoot->{'one-to-one'})]]></code>
<code><![CDATA[isset($xmlRoot->{'sql-result-set-mappings'})]]></code>
<code><![CDATA[isset($xmlRoot->{'unique-constraints'})]]></code>
</RedundantCondition>
<PossiblyNullArgument>
<code><![CDATA[$joinColumnElement['options']->children()]]></code>
<code><![CDATA[$option->children()]]></code>
</PossiblyNullArgument>
<PossiblyNullIterator>
<code><![CDATA[$cascadeElement->children()]]></code>
</PossiblyNullIterator>
<TypeDoesNotContainType>
<code><![CDATA[$xmlRoot->getName() === 'embeddable']]></code>
<code><![CDATA[$xmlRoot->getName() === 'entity']]></code>
<code><![CDATA[$xmlRoot->getName() === 'mapped-superclass']]></code>
</TypeDoesNotContainType>
</file>
<file src="lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php">
<DeprecatedMethod>
<code>addNamedNativeQuery</code>
<code>addNamedQuery</code>
</DeprecatedMethod>
<InvalidArgument>
<ArgumentTypeCoercion>
<code><![CDATA[[
'name' => 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,
]]]></code>
</InvalidArgument>
</ArgumentTypeCoercion>
<DeprecatedMethod>
<code>addNamedNativeQuery</code>
<code>addNamedQuery</code>
</DeprecatedMethod>
<LessSpecificReturnStatement>
<code><![CDATA[[
'usage' => $usage,
Expand Down Expand Up @@ -1038,9 +1021,6 @@
<code>$element</code>
<code>$element</code>
</PossiblyUndefinedMethod>
<PropertyTypeCoercion>
<code><![CDATA[$metadata->table]]></code>
</PropertyTypeCoercion>
<UndefinedInterfaceMethod>
<code>$element</code>
<code>$element</code>
Expand Down Expand Up @@ -1302,15 +1282,13 @@
</InvalidNullableReturnType>
<LessSpecificReturnStatement>
<code>$newValue</code>
<code>$postInsertIds</code>
<code>[$params, $types]</code>
<code>[$sqlParams, $sqlTypes]</code>
</LessSpecificReturnStatement>
<MissingReturnType>
<code>loadAll</code>
</MissingReturnType>
<MoreSpecificReturnType>
<code>executeInserts</code>
<code>expandCriteriaParameters</code>
<code>expandParameters</code>
<code><![CDATA[list<mixed>]]></code>
Expand Down Expand Up @@ -1394,12 +1372,6 @@
</MissingReturnType>
</file>
<file src="lib/Doctrine/ORM/Persisters/Entity/JoinedSubclassPersister.php">
<LessSpecificReturnStatement>
<code>$postInsertIds</code>
</LessSpecificReturnStatement>
<MoreSpecificReturnType>
<code>executeInserts</code>
</MoreSpecificReturnType>
<PossiblyUndefinedArrayOffset>
<code><![CDATA[$assoc['targetToSourceKeyColumns']]]></code>
<code><![CDATA[$mapping['joinColumns']]]></code>
Expand Down Expand Up @@ -1937,9 +1909,6 @@
<MethodSignatureMustProvideReturnType>
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<PropertyTypeCoercion>
<code><![CDATA[$this->parts]]></code>
</PropertyTypeCoercion>
</file>
<file src="lib/Doctrine/ORM/Query/Expr/Comparison.php">
<MethodSignatureMustProvideReturnType>
Expand Down Expand Up @@ -2292,10 +2261,6 @@
</file>
<file src="lib/Doctrine/ORM/QueryBuilder.php">
<ArgumentTypeCoercion>
<code>$args</code>
<code>$args</code>
<code>$args</code>
<code>$args</code>
<code><![CDATA[[$rootAlias => $join]]]></code>
<code><![CDATA[[$rootAlias => $join]]]></code>
</ArgumentTypeCoercion>
Expand All @@ -2312,17 +2277,9 @@
<InvalidPropertyAssignmentValue>
<code>new ArrayCollection($parameters)</code>
</InvalidPropertyAssignmentValue>
<LessSpecificReturnStatement>
<code>$aliases</code>
<code>$entities</code>
</LessSpecificReturnStatement>
<MethodSignatureMustProvideReturnType>
<code>__toString</code>
</MethodSignatureMustProvideReturnType>
<MoreSpecificReturnType>
<code><![CDATA[list<string>]]></code>
<code><![CDATA[list<string>]]></code>
</MoreSpecificReturnType>
<PossiblyFalseArgument>
<code>$spacePos</code>
<code>$spacePos</code>
Expand Down Expand Up @@ -2621,8 +2578,42 @@
<PossiblyFalseArgument>
<code><![CDATA[$simpleXml->asXML()]]></code>
</PossiblyFalseArgument>
<PossiblyNullArgument>
<code>$entityListenersXml</code>
<code>$optionsXml</code>
</PossiblyNullArgument>
<PossiblyNullReference>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addAttribute</code>
<code>addChild</code>
<code>addChild</code>
<code>addChild</code>
<code>addChild</code>
<code>addChild</code>
<code>addChild</code>
<code>addChild</code>
<code>addChild</code>
<code>addChild</code>
<code>addChild</code>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block should go away once vimeo/psalm#9745 is merged and released.

</PossiblyNullReference>
<RedundantCondition>
<code><![CDATA[$field['associationKey']]]></code>
Expand Down Expand Up @@ -2863,9 +2854,6 @@
<code>unwrap</code>
<code>unwrap</code>
</PossiblyUndefinedMethod>
<PropertyTypeCoercion>
<code><![CDATA[$this->nonCascadedNewDetectedEntities]]></code>
</PropertyTypeCoercion>
<RedundantCondition>
<code><![CDATA[$i >= 0 && $this->entityDeletions]]></code>
<code><![CDATA[$this->entityDeletions]]></code>
Expand Down