Skip to content

Commit aa16f61

Browse files
authored
Add PHP 8.5 support (#60)
1 parent 83dcdff commit aa16f61

File tree

4 files changed

+24
-7
lines changed

4 files changed

+24
-7
lines changed

.github/workflows/checks.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
strategy:
1212
fail-fast: false
1313
matrix:
14-
php-version: [ '8.1', '8.2', '8.3', '8.4' ]
14+
php-version: [ '8.1', '8.2', '8.3', '8.4', '8.5' ]
1515
dependency-version: [ prefer-lowest, prefer-stable ]
1616
steps:
1717
-

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
],
77
"require": {
88
"php": "^8.1",
9-
"doctrine/orm": "^3.3.0"
9+
"doctrine/orm": "^3.5.3"
1010
},
1111
"require-dev": {
1212
"doctrine/dbal": "^4.0",
1313
"doctrine/event-manager": "^2.0",
1414
"editorconfig-checker/editorconfig-checker": "10.6.0",
15-
"ergebnis/composer-normalize": "2.44.0",
15+
"ergebnis/composer-normalize": "^2.45",
1616
"phpstan/phpstan": "2.0.1",
1717
"phpstan/phpstan-phpunit": "2.0.0",
1818
"phpstan/phpstan-strict-rules": "2.0.0",
@@ -23,6 +23,9 @@
2323
"symfony/cache": "^6.4.13",
2424
"symfony/cache-contracts": "^3.5.0"
2525
},
26+
"conflict": {
27+
"doctrine/persistence": "< 3.4.1"
28+
},
2629
"autoload": {
2730
"psr-4": {
2831
"ShipMonk\\Doctrine\\Walker\\": "src/"

phpstan.neon.dist

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,9 @@ parameters:
1919
ignoreErrors:
2020
-
2121
message: '#ShipMonk\\Doctrine\\Walker\\HintDrivenSqlWalker\:\:__construct\(\)#' # unable to replicate PHPStan bug
22-
reportUnmatched: false # issue differs with versinos of doctrine/orm
22+
reportUnmatched: false # issue differs with versions of doctrine/orm
23+
24+
-
25+
message: '#enableNativeLazy#'
26+
identifier: function.alreadyNarrowedType
27+
reportUnmatched: false # issue differs with versions of doctrine/orm

tests/HintDrivenSqlWalkerTest.php

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
use ShipMonk\Doctrine\Walker\Handlers\CommentWholeSqlHintHandler;
1616
use ShipMonk\Doctrine\Walker\Handlers\LowercaseSelectHintHandler;
1717
use Symfony\Component\Cache\Adapter\ArrayAdapter;
18+
use function method_exists;
19+
use const PHP_VERSION_ID;
1820

1921
class HintDrivenSqlWalkerTest extends TestCase
2022
{
@@ -150,10 +152,17 @@ public static function walksProvider(): iterable
150152
private function createEntityManagerMock(): EntityManager
151153
{
152154
$config = new Configuration();
153-
$config->setProxyNamespace('Tmp\Doctrine\Tests\Proxies');
154-
$config->setProxyDir('/tmp/doctrine');
155+
156+
if (PHP_VERSION_ID >= 8_04_00 && method_exists($config, 'enableNativeLazyObjects')) {
157+
$config->enableNativeLazyObjects(true);
158+
159+
} else {
160+
$config->setProxyNamespace('Tmp\Doctrine\Tests\Proxies');
161+
$config->setProxyDir('/tmp/doctrine');
162+
$config->setAutoGenerateProxyClasses(false);
163+
}
164+
155165
$config->setQueryCache(new ArrayAdapter());
156-
$config->setAutoGenerateProxyClasses(false);
157166
$config->setSecondLevelCacheEnabled(false);
158167
$config->setMetadataDriverImpl(new AttributeDriver([__DIR__]));
159168
$config->setNamingStrategy(new UnderscoreNamingStrategy());

0 commit comments

Comments
 (0)