Skip to content

Commit ca283ad

Browse files
Support doctrine native lazy objects (#65)
1 parent 1518112 commit ca283ad

3 files changed

Lines changed: 40 additions & 1 deletion

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- 8.5
2828
symfony-version:
2929
- 6.4.*
30-
- 7.*
30+
- 7.4.*
3131
dependencies: [lowest, highest]
3232
name: 'PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }} + ${{ matrix.dependencies }} dependencies'
3333

phpstan-baseline.neon

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@ parameters:
22
ignoreErrors:
33
-
44
identifier: trait.unused
5+
6+
-
7+
message: '#^Call to method scalarNode\(\) on an unknown class Symfony\\Component\\Config\\Definition\\Builder\\NodeBuilder\<Symfony\\Component\\Config\\Definition\\Builder\\ArrayNodeDefinition\>\.$#'
8+
identifier: class.notFound
9+
count: 1
10+
path: src/DependencyInjection/Configuration.php
11+
12+
-
13+
message: '#^Cannot call method defaultValue\(\) on mixed\.$#'
14+
identifier: method.nonObject
15+
count: 1
16+
path: src/DependencyInjection/Configuration.php
17+
18+
-
19+
message: '#^Cannot call method end\(\) on mixed\.$#'
20+
identifier: method.nonObject
21+
count: 2
22+
path: src/DependencyInjection/Configuration.php
23+
24+
-
25+
message: '#^Method Speicher210\\FunctionalTestBundle\\DependencyInjection\\Configuration\:\:getConfigTreeBuilder\(\) return type with generic class Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder does not specify its types\: T$#'
26+
identifier: missingType.generics
27+
count: 1
28+
path: src/DependencyInjection/Configuration.php
29+
530
-
631
message: '#^Parameter \#1 \$string of function Psl\\Str\\trim expects string, mixed given\.$#'
732
identifier: argument.type
@@ -67,3 +92,9 @@ parameters:
6792
identifier: argument.type
6893
count: 1
6994
path: src/Test/bootstrap.php
95+
96+
-
97+
message: '#^Call to function method_exists\(\) with Doctrine\\ORM\\Configuration and ''enableNativeLazyObj…'' will always evaluate to true\.$#'
98+
identifier: function.alreadyNarrowedType
99+
count: 1
100+
path: src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php

src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@
1111
use Doctrine\ORM\Query\AST\Functions\FunctionNode;
1212
use PHPUnit\Framework\TestCase;
1313

14+
use function method_exists;
15+
16+
use const PHP_VERSION_ID;
17+
1418
abstract class FunctionTestCase extends TestCase
1519
{
1620
/**
@@ -24,6 +28,10 @@ protected function getEntityManager(): EntityManager
2428
$configuration->setProxyDir(__DIR__ . '/Fixtures/Proxies');
2529
$configuration->setProxyNamespace(__NAMESPACE__ . '\Proxy');
2630
$configuration->setAutoGenerateProxyClasses(true);
31+
if (PHP_VERSION_ID >= 80400 && method_exists($configuration, 'enableNativeLazyObjects')) {
32+
$configuration->enableNativeLazyObjects(true);
33+
}
34+
2735
$configuration->setMetadataDriverImpl(new AttributeDriver([__DIR__ . '/Fixtures']));
2836
foreach ($this->registeredStringFunctions() as $name => $class) {
2937
$configuration->addCustomStringFunction($name, $class);

0 commit comments

Comments
 (0)