15
15
use Doctrine \Common \DataFixtures \AbstractFixture as BaseAbstractFixture ;
16
16
use Doctrine \ORM \Id \AssignedGenerator ;
17
17
use Doctrine \Common \DataFixtures \OrderedFixtureInterface ;
18
- use Doctrine \Common \ Persistence \ObjectManager ;
18
+ use Doctrine \Persistence \ObjectManager ;
19
19
use Doctrine \Instantiator \Instantiator ;
20
20
use Doctrine \ORM \EntityManagerInterface ;
21
21
use Doctrine \ORM \EntityRepository ;
22
22
use ReflectionClass ;
23
+ use function count ;
23
24
use function method_exists ;
24
25
use RuntimeException ;
25
26
use function sprintf ;
@@ -90,7 +91,7 @@ public function load(ObjectManager $manager)
90
91
91
92
$ objects = $ this ->getObjects ();
92
93
93
- $ this ->totalNumberOfObjects = \ count ($ objects );
94
+ $ this ->totalNumberOfObjects = count ($ objects );
94
95
95
96
$ this ->numberOfIteratedObjects = 0 ;
96
97
foreach ($ objects as $ data ) {
@@ -114,7 +115,7 @@ public function load(ObjectManager $manager)
114
115
/**
115
116
* Creates the object and persist it in database.
116
117
*
117
- * @param object $data
118
+ * @param array $data
118
119
*/
119
120
private function fixtureObject (array $ data ): void
120
121
{
@@ -127,7 +128,7 @@ private function fixtureObject(array $data): void
127
128
// This means that it _may_ break objects for which ids are not provided in the fixtures.
128
129
$ metadata = $ this ->manager ->getClassMetadata ($ this ->getEntityClass ());
129
130
$ primaryKey = $ metadata ->getIdentifierFieldNames ();
130
- if (1 === \ count ($ primaryKey ) && isset ($ data [$ primaryKey [0 ]])) {
131
+ if (1 === count ($ primaryKey ) && isset ($ data [$ primaryKey [0 ]])) {
131
132
$ metadata ->setIdGeneratorType ($ metadata ::GENERATOR_TYPE_NONE );
132
133
$ metadata ->setIdGenerator (new AssignedGenerator ());
133
134
}
0 commit comments