Skip to content

Commit f324e2a

Browse files
authored
Fix deprecation warnings in doctrine/collections:2.4 (#46)
* Enable native lazy objects whenever possible. The LazyGhostTrait will be removed from symfony/var-exporter:8. * Fix usage of deprecated phpstan config option * Set $accessRawFieldValues explicitly Fixes a deprecation warning when using doctrine/collections:2.4 See doctrine/collections#472
1 parent e213270 commit f324e2a

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Codeception/Module/Doctrine.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,7 @@ protected function _buildAssociationQuery(QueryBuilder $qb, string $assoc, strin
10051005
} elseif ($val instanceof Criteria) {
10061006
$qb->addCriteria($val);
10071007
} elseif ($val instanceof Expression) {
1008-
$qb->addCriteria(Criteria::create()->where($val));
1008+
$qb->addCriteria(Criteria::create(true)->where($val));
10091009
} else {
10101010
$qb->andWhere(sprintf('%s.%s = ?%s', $alias, $key, $paramIndex));
10111011
$qb->setParameter($paramIndex, $val);

tests/unit/Codeception/Module/Doctrine2Test.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -258,17 +258,17 @@ public function testCriteria()
258258
{
259259
$this->module->haveInRepository(PlainEntity::class, ['name' => 'Test 1']);
260260
$this->module->seeInRepository(PlainEntity::class, [
261-
Criteria::create()->where(
261+
Criteria::create(true)->where(
262262
Criteria::expr()->eq('name', 'Test 1')
263263
),
264264
]);
265265
$this->module->seeInRepository(PlainEntity::class, [
266-
Criteria::create()->where(
266+
Criteria::create(true)->where(
267267
Criteria::expr()->contains('name', 'est')
268268
),
269269
]);
270270
$this->module->seeInRepository(PlainEntity::class, [
271-
Criteria::create()->where(
271+
Criteria::create(true)->where(
272272
Criteria::expr()->in('name', ['Test 1'])
273273
),
274274
]);
@@ -303,7 +303,7 @@ public function testOrderBy()
303303
'c',
304304
],
305305
array_map($getName, $this->module->grabEntitiesFromRepository(PlainEntity::class, [
306-
Criteria::create()->orderBy(['name' => 'asc']),
306+
Criteria::create(true)->orderBy(['name' => 'asc']),
307307
]))
308308
);
309309

@@ -314,7 +314,7 @@ public function testOrderBy()
314314
'a',
315315
],
316316
array_map($getName, $this->module->grabEntitiesFromRepository(PlainEntity::class, [
317-
Criteria::create()->orderBy(['name' => 'desc']),
317+
Criteria::create(true)->orderBy(['name' => 'desc']),
318318
]))
319319
);
320320
}

0 commit comments

Comments
 (0)