Skip to content

Commit 28fb80a

Browse files
committed
CI: Fix deprecation failures with Symfony 6.4 and ORM
1 parent f28b1f7 commit 28fb80a

File tree

8 files changed

+34
-11
lines changed

8 files changed

+34
-11
lines changed

Resources/config/schema/doctrine-1.0.xsd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@
147147
<xsd:attribute name="proxy-dir" type="xsd:string" />
148148
<xsd:attribute name="proxy-namespace" type="xsd:string" />
149149
<xsd:attribute name="auto-generate-proxy-classes" type="xsd:string" default="false" />
150+
<xsd:attribute name="enable-lazy-ghost-objects" type="xsd:boolean" />
150151
<xsd:attributeGroup ref="entity-manager-config" />
151152
</xsd:complexType>
152153

Tests/DependencyInjection/Compiler/IdGeneratorPassTest.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ public function testRepositoryServiceWiring(): void
9595
'annotations' => [
9696
'enabled' => class_exists(AnnotationReader::class) && Kernel::VERSION_ID < 64000,
9797
],
98-
],
98+
'php_errors' => ['log' => true],
99+
] + (Kernel::VERSION_ID >= 62000 ? ['handle_all_throwables' => true] : []),
99100
], $container);
100101

101102
$extension = new DoctrineExtension();
@@ -107,7 +108,10 @@ public function testRepositoryServiceWiring(): void
107108
'charset' => 'UTF8',
108109
'schema_manager_factory' => 'doctrine.dbal.default_schema_manager_factory',
109110
],
110-
'orm' => ['mappings' => $mappings, 'report_fields_where_declared' => true],
111+
'orm' => [
112+
'mappings' => $mappings,
113+
'report_fields_where_declared' => true,
114+
],
111115
],
112116
], $container);
113117

Tests/DependencyInjection/Fixtures/TestKernel.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,9 @@ public function registerContainerConfiguration(LoaderInterface $loader): void
4242
$container->loadFromExtension('framework', [
4343
'secret' => 'F00',
4444
'http_method_override' => false,
45-
'annotations' => [
46-
'enabled' => class_exists(Annotation::class) && Kernel::VERSION_ID <= 64000,
47-
],
48-
]);
49-
45+
'annotations' => class_exists(Annotation::class) && Kernel::VERSION_ID <= 64000,
46+
'php_errors' => ['log' => true],
47+
] + (Kernel::VERSION_ID >= 62000 ? ['handle_all_throwables' => true] : []));
5048
$container->loadFromExtension('doctrine', [
5149
'dbal' => [
5250
'driver' => 'pdo_sqlite',

Tests/LockStoreSchemaListenerTest.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Symfony\Component\DependencyInjection\Alias;
1010
use Symfony\Component\DependencyInjection\ContainerBuilder;
1111
use Symfony\Component\DependencyInjection\ParameterBag\ParameterBag;
12+
use Symfony\Component\HttpKernel\Kernel;
1213

1314
use function class_exists;
1415
use function interface_exists;
@@ -51,7 +52,13 @@ public function testLockStoreSchemaSubscriberWiring(array $config, int $expected
5152

5253
$extension = new FrameworkExtension();
5354
$container->registerExtension($extension);
54-
$extension->load(['framework' => ['http_method_override' => false] + $config], $container);
55+
$extension->load(
56+
[
57+
'framework' => ['http_method_override' => false, 'php_errors' => ['log' => true]]
58+
+ (Kernel::VERSION_ID >= 62000 ? ['handle_all_throwables' => true] : []) + $config,
59+
],
60+
$container
61+
);
5562

5663
$extension = new DoctrineExtension();
5764
$container->registerExtension($extension);

Tests/ServiceRepositoryTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ public function testRepositoryServiceWiring(): void
7272
$extension->load([
7373
'framework' => [
7474
'http_method_override' => false,
75+
'php_errors' => ['log' => true],
7576
'annotations' => [
7677
'enabled' => class_exists(AnnotationReader::class) && Kernel::VERSION_ID < 64000,
7778
],
78-
],
79+
] + (Kernel::VERSION_ID >= 62000 ? ['handle_all_throwables' => true] : []),
7980
], $container);
8081

8182
$extension = new DoctrineExtension();
@@ -102,7 +103,7 @@ public function testRepositoryServiceWiring(): void
102103

103104
$def = $container->register(TestCustomServiceRepoRepository::class, TestCustomServiceRepoRepository::class)
104105
->setPublic(false);
105-
// create a public alias so we can use it below for testing
106+
// create a public alias, so we can use it below for testing
106107
$container->setAlias('test_alias__' . TestCustomServiceRepoRepository::class, new Alias(TestCustomServiceRepoRepository::class, true));
107108

108109
$def->setAutowired(true);

Tests/baseline-ignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
%Not enabling lazy ghost objects is deprecated and will not be supported in Doctrine ORM 3%

composer.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"doctrine/annotations": "^1 || ^2",
4848
"doctrine/coding-standard": "^9.0",
4949
"doctrine/deprecations": "^1.0",
50-
"doctrine/orm": "^2.11 || ^3.0",
50+
"doctrine/orm": "^2.14 || ^3.0",
5151
"friendsofphp/proxy-manager-lts": "^1.0",
5252
"phpunit/phpunit": "^9.5.26 || ^10.0",
5353
"psalm/plugin-phpunit": "^0.18.4",
@@ -57,6 +57,7 @@
5757
"symfony/property-info": "^5.4 || ^6.0",
5858
"symfony/proxy-manager-bridge": "^5.4 || ^6.0",
5959
"symfony/security-bundle": "^5.4 || ^6.0",
60+
"symfony/string": "^5.4 || ^6.0",
6061
"symfony/twig-bridge": "^5.4 || ^6.0",
6162
"symfony/validator": "^5.4 || ^6.0",
6263
"symfony/web-profiler-bundle": "^5.4 || ^6.0",
@@ -92,5 +93,11 @@
9293
"symfony/flex": true
9394
},
9495
"sort-packages": true
96+
},
97+
"scripts": {
98+
"auto-scripts": {
99+
"cache:clear": "symfony-cmd",
100+
"assets:install %PUBLIC_DIR%": "symfony-cmd"
101+
}
95102
}
96103
}

phpunit.xml.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
</testsuite>
88
</testsuites>
99

10+
<php>
11+
<env name="SYMFONY_DEPRECATIONS_HELPER" value="ignoreFile=./Tests/baseline-ignore"/>
12+
</php>
13+
1014
<filter>
1115
<whitelist>
1216
<directory>.</directory>

0 commit comments

Comments
 (0)