diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fdf2a60..327b0cb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -27,7 +27,7 @@ jobs: - 8.5 symfony-version: - 6.4.* - - 7.* + - 7.4.* dependencies: [lowest, highest] name: 'PHP ${{ matrix.php-version }} + Symfony ${{ matrix.symfony-version }} + ${{ matrix.dependencies }} dependencies' diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index e6eba4b..e101479 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -2,6 +2,31 @@ parameters: ignoreErrors: - identifier: trait.unused + + - + message: '#^Call to method scalarNode\(\) on an unknown class Symfony\\Component\\Config\\Definition\\Builder\\NodeBuilder\\.$#' + identifier: class.notFound + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Cannot call method defaultValue\(\) on mixed\.$#' + identifier: method.nonObject + count: 1 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Cannot call method end\(\) on mixed\.$#' + identifier: method.nonObject + count: 2 + path: src/DependencyInjection/Configuration.php + + - + message: '#^Method Speicher210\\FunctionalTestBundle\\DependencyInjection\\Configuration\:\:getConfigTreeBuilder\(\) return type with generic class Symfony\\Component\\Config\\Definition\\Builder\\TreeBuilder does not specify its types\: T$#' + identifier: missingType.generics + count: 1 + path: src/DependencyInjection/Configuration.php + - message: '#^Parameter \#1 \$string of function Psl\\Str\\trim expects string, mixed given\.$#' identifier: argument.type @@ -67,3 +92,9 @@ parameters: identifier: argument.type count: 1 path: src/Test/bootstrap.php + + - + message: '#^Call to function method_exists\(\) with Doctrine\\ORM\\Configuration and ''enableNativeLazyObj…'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php diff --git a/src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php b/src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php index 5284bd6..ed45b66 100644 --- a/src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php +++ b/src/Test/Doctrine/ORM/Query/AST/FunctionTestCase.php @@ -11,6 +11,10 @@ use Doctrine\ORM\Query\AST\Functions\FunctionNode; use PHPUnit\Framework\TestCase; +use function method_exists; + +use const PHP_VERSION_ID; + abstract class FunctionTestCase extends TestCase { /** @@ -24,6 +28,10 @@ protected function getEntityManager(): EntityManager $configuration->setProxyDir(__DIR__ . '/Fixtures/Proxies'); $configuration->setProxyNamespace(__NAMESPACE__ . '\Proxy'); $configuration->setAutoGenerateProxyClasses(true); + if (PHP_VERSION_ID >= 80400 && method_exists($configuration, 'enableNativeLazyObjects')) { + $configuration->enableNativeLazyObjects(true); + } + $configuration->setMetadataDriverImpl(new AttributeDriver([__DIR__ . '/Fixtures'])); foreach ($this->registeredStringFunctions() as $name => $class) { $configuration->addCustomStringFunction($name, $class);