Skip to content

Commit

Permalink
Use a more accurate type
Browse files Browse the repository at this point in the history
getFixtures() doesn't always return instances of OrderedFixtureInterface
(for instance if you don't use those at all).
  • Loading branch information
greg0ire committed Jan 5, 2023
1 parent 1a4232c commit 581375d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/Doctrine/Common/DataFixtures/Loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Loader
/**
* Array of ordered fixture object instances.
*
* @psalm-var array<class-string<OrderedFixtureInterface>, OrderedFixtureInterface>|list<OrderedFixtureInterface>
* @psalm-var array<class-string<FixtureInterface>|int, FixtureInterface>
*/
private $orderedFixtures = [];

Expand Down Expand Up @@ -181,7 +181,7 @@ public function addFixture(FixtureInterface $fixture)
/**
* Returns the array of data fixtures to execute.
*
* @psalm-return array<class-string<OrderedFixtureInterface>|int, OrderedFixtureInterface>
* @psalm-return array<class-string<FixtureInterface>|int, FixtureInterface>
*/
public function getFixtures()
{
Expand Down
5 changes: 0 additions & 5 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ parameters:
count: 1
path: lib/Doctrine/Common/DataFixtures/Loader.php

-
message: "#^Property Doctrine\\\\Common\\\\DataFixtures\\\\Loader\\:\\:\\$orderedFixtures \\(array\\<class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\OrderedFixtureInterface\\>\\|int, Doctrine\\\\Common\\\\DataFixtures\\\\OrderedFixtureInterface\\>\\) does not accept array\\<class\\-string\\<Doctrine\\\\Common\\\\DataFixtures\\\\FixtureInterface\\>, Doctrine\\\\Common\\\\DataFixtures\\\\FixtureInterface\\>\\.$#"
count: 2
path: lib/Doctrine/Common/DataFixtures/Loader.php

-
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getReference\\(\\)\\.$#"
count: 2
Expand Down

0 comments on commit 581375d

Please sign in to comment.