Skip to content

Commit

Permalink
Mark ClassMetadataInfo::sequenceGeneratorDefinition as nullable
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Sep 22, 2022
1 parent 6dd07e4 commit 2b8ac15
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
6 changes: 4 additions & 2 deletions lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -716,8 +716,8 @@ class ClassMetadataInfo implements ClassMetadata
* )
* </code>
*
* @var array<string, mixed>
* @psalm-var array{sequenceName: string, allocationSize: string, initialValue: string, quoted?: mixed}
* @var array<string, mixed>|null
* @psalm-var array{sequenceName: string, allocationSize: string, initialValue: string, quoted?: mixed}|null
* @todo Merge with tableGeneratorDefinition into generic generatorDefinition
*/
public $sequenceGeneratorDefinition;
Expand Down Expand Up @@ -2376,6 +2376,8 @@ public function isIdGeneratorIdentity()
* Checks whether the class uses a sequence for id generation.
*
* @return bool TRUE if the class uses the SEQUENCE generator, FALSE otherwise.
*
* @psalm-assert-if-true !null $this->sequenceGeneratorDefinition
*/
public function isIdGeneratorSequence()
{
Expand Down
12 changes: 1 addition & 11 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,6 @@ parameters:
count: 2
path: lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php

-
message: "#^Negated boolean expression is always false\\.$#"
count: 1
path: lib/Doctrine/ORM/Mapping/ClassMetadataFactory.php

-
message: "#^Parameter \\#2 \\$class of method Doctrine\\\\ORM\\\\Mapping\\\\QuoteStrategy\\:\\:getSequenceName\\(\\) expects Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadata, Doctrine\\\\ORM\\\\Mapping\\\\ClassMetadataInfo given\\.$#"
count: 2
Expand Down Expand Up @@ -630,11 +625,6 @@ parameters:
count: 1
path: lib/Doctrine/ORM/Tools/Console/Command/MappingDescribeCommand.php

-
message: "#^If condition is always true\\.$#"
count: 1
path: lib/Doctrine/ORM/Tools/EntityGenerator.php

-
message: "#^Offset 'allocationSize' on array\\{sequenceName\\: string, allocationSize\\: string, initialValue\\: string, quoted\\?\\: mixed\\} in isset\\(\\) always exists and is not nullable\\.$#"
count: 1
Expand Down Expand Up @@ -697,7 +687,7 @@ parameters:

-
message: "#^Right side of && is always true\\.$#"
count: 2
count: 1
path: lib/Doctrine/ORM/Tools/Export/Driver/XmlExporter.php

-
Expand Down

0 comments on commit 2b8ac15

Please sign in to comment.