Skip to content

Commit 581375d

Browse files
committed
Use a more accurate type
getFixtures() doesn't always return instances of OrderedFixtureInterface (for instance if you don't use those at all).
1 parent 1a4232c commit 581375d

File tree

2 files changed

+2
-7
lines changed

2 files changed

+2
-7
lines changed

lib/Doctrine/Common/DataFixtures/Loader.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ class Loader
4747
/**
4848
* Array of ordered fixture object instances.
4949
*
50-
* @psalm-var array<class-string<OrderedFixtureInterface>, OrderedFixtureInterface>|list<OrderedFixtureInterface>
50+
* @psalm-var array<class-string<FixtureInterface>|int, FixtureInterface>
5151
*/
5252
private $orderedFixtures = [];
5353

@@ -181,7 +181,7 @@ public function addFixture(FixtureInterface $fixture)
181181
/**
182182
* Returns the array of data fixtures to execute.
183183
*
184-
* @psalm-return array<class-string<OrderedFixtureInterface>|int, OrderedFixtureInterface>
184+
* @psalm-return array<class-string<FixtureInterface>|int, FixtureInterface>
185185
*/
186186
public function getFixtures()
187187
{

phpstan-baseline.neon

-5
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,6 @@ parameters:
2525
count: 1
2626
path: lib/Doctrine/Common/DataFixtures/Loader.php
2727

28-
-
29-
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\\>\\.$#"
30-
count: 2
31-
path: lib/Doctrine/Common/DataFixtures/Loader.php
32-
3328
-
3429
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getReference\\(\\)\\.$#"
3530
count: 2

0 commit comments

Comments
 (0)