diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index 6043c30..a3ba5e4 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - php-version: [ '8.1', '8.2', '8.3', '8.4' ] + php-version: [ '8.1', '8.2', '8.3', '8.4', '8.5' ] dependency-version: [ prefer-lowest, prefer-stable ] steps: - diff --git a/composer.json b/composer.json index 6ca34da..cdbabea 100644 --- a/composer.json +++ b/composer.json @@ -6,13 +6,13 @@ ], "require": { "php": "^8.1", - "doctrine/orm": "^3.3.0" + "doctrine/orm": "^3.5.3" }, "require-dev": { "doctrine/dbal": "^4.0", "doctrine/event-manager": "^2.0", "editorconfig-checker/editorconfig-checker": "10.6.0", - "ergebnis/composer-normalize": "2.44.0", + "ergebnis/composer-normalize": "^2.45", "phpstan/phpstan": "2.0.1", "phpstan/phpstan-phpunit": "2.0.0", "phpstan/phpstan-strict-rules": "2.0.0", @@ -23,6 +23,9 @@ "symfony/cache": "^6.4.13", "symfony/cache-contracts": "^3.5.0" }, + "conflict": { + "doctrine/persistence": "< 3.4.1" + }, "autoload": { "psr-4": { "ShipMonk\\Doctrine\\Walker\\": "src/" diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 4877ded..cbe3cda 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -19,4 +19,9 @@ parameters: ignoreErrors: - message: '#ShipMonk\\Doctrine\\Walker\\HintDrivenSqlWalker\:\:__construct\(\)#' # unable to replicate PHPStan bug - reportUnmatched: false # issue differs with versinos of doctrine/orm + reportUnmatched: false # issue differs with versions of doctrine/orm + + - + message: '#enableNativeLazy#' + identifier: function.alreadyNarrowedType + reportUnmatched: false # issue differs with versions of doctrine/orm diff --git a/tests/HintDrivenSqlWalkerTest.php b/tests/HintDrivenSqlWalkerTest.php index c7ef9f4..08b91cc 100644 --- a/tests/HintDrivenSqlWalkerTest.php +++ b/tests/HintDrivenSqlWalkerTest.php @@ -15,6 +15,8 @@ use ShipMonk\Doctrine\Walker\Handlers\CommentWholeSqlHintHandler; use ShipMonk\Doctrine\Walker\Handlers\LowercaseSelectHintHandler; use Symfony\Component\Cache\Adapter\ArrayAdapter; +use function method_exists; +use const PHP_VERSION_ID; class HintDrivenSqlWalkerTest extends TestCase { @@ -150,10 +152,17 @@ public static function walksProvider(): iterable private function createEntityManagerMock(): EntityManager { $config = new Configuration(); - $config->setProxyNamespace('Tmp\Doctrine\Tests\Proxies'); - $config->setProxyDir('/tmp/doctrine'); + + if (PHP_VERSION_ID >= 8_04_00 && method_exists($config, 'enableNativeLazyObjects')) { + $config->enableNativeLazyObjects(true); + + } else { + $config->setProxyNamespace('Tmp\Doctrine\Tests\Proxies'); + $config->setProxyDir('/tmp/doctrine'); + $config->setAutoGenerateProxyClasses(false); + } + $config->setQueryCache(new ArrayAdapter()); - $config->setAutoGenerateProxyClasses(false); $config->setSecondLevelCacheEnabled(false); $config->setMetadataDriverImpl(new AttributeDriver([__DIR__])); $config->setNamingStrategy(new UnderscoreNamingStrategy());