Skip to content

Commit 5018888

Browse files
committed
fix: disable ORM native lazy object on Symfony 6.4 in tests
Disable native lazy objects in tests for Symfony 6.4 as they do not seems to work well with the testsuite. Also ignore a specific PHPStan error that has been reported as a bug.
1 parent df92455 commit 5018888

2 files changed

Lines changed: 11 additions & 3 deletions

File tree

phpstan-baseline.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,5 +207,12 @@
207207
'count' => 1,
208208
'path' => __DIR__.'/src/ProviderFactory/GeoIP2Factory.php',
209209
];
210+
// See https://github.com/phpstan/phpstan/issues/14067
211+
$ignoreErrors[] = [
212+
'message' => '#^Parameter \\#1 \\$provider of class Bazinga\\\\GeocoderBundle\\\\Mapping\\\\ClassMetadata constructor expects non-empty-string, ReflectionMethod\\|ReflectionProperty\\|non-empty-string given\\.$#',
213+
'identifier' => 'argument.type',
214+
'count' => 1,
215+
'path' => __DIR__.'/src/Mapping/Driver/AttributeDriver.php',
216+
];
210217

211218
return ['parameters' => ['ignoreErrors' => $ignoreErrors]];

tests/Functional/GeocodeEntityListenerTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,10 @@ public function process(ContainerBuilder $container): void
9292
$orm['enable_lazy_ghost_objects'] = true;
9393
}
9494
if (\PHP_VERSION_ID >= 80400
95-
&& version_compare($doctrineBundleVersion, '2.15.0', '>=')
96-
&& version_compare($doctrineBundleVersion, '3.1.0', '<')
97-
&& version_compare($ormVersion, '3.4.0', '>=')
95+
&& Kernel::VERSION_ID >= 70000
96+
&& version_compare($doctrineBundleVersion, '2.15.0', '>=')
97+
&& version_compare($doctrineBundleVersion, '3.1.0', '<')
98+
&& version_compare($ormVersion, '3.4.0', '>=')
9899
) {
99100
$orm['enable_native_lazy_objects'] = true;
100101
}

0 commit comments

Comments
 (0)