Skip to content

Commit ecd1a10

Browse files
committed
Require PHP 8.4
It is going to be the requirement of the next versions of all our packages.
1 parent c42cacd commit ecd1a10

File tree

113 files changed

+337
-295
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+337
-295
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,7 @@ jobs:
3737
fail-fast: false
3838
matrix:
3939
php-version:
40-
- "8.1"
41-
- "8.2"
42-
- "8.3"
40+
- "8.4"
4341
dependencies:
4442
- "highest"
4543
stability:
@@ -52,7 +50,7 @@ jobs:
5250
# Tests the lowest set of dependencies
5351
- dependencies: "lowest"
5452
stability: "stable"
55-
php-version: "8.1"
53+
php-version: "8.4"
5654

5755
# Test LTS
5856
- symfony-require: "6.4.*"

UPGRADE-3.0.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ Compatibility
77
Configuring caching options to use services backed by `doctrine/cache` is no
88
longer supported. Migrate to PSR-6 services instead.
99

10+
The minimum required PHP version is now 8.4.
11+
1012
Support for the following major versions of the following packages has been dropped:
1113

1214
- `doctrine/dbal` 3
@@ -73,6 +75,12 @@ You should use stop passing an event manager argument.
7375
+ $connectionFactory->createConnection($params, $config, $mappingTypes)
7476
```
7577

78+
Type declarations
79+
-----------------
80+
81+
Native type declarations have been added to all constants, methods, and
82+
properties.
83+
7684
Types
7785
-----
7886

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
],
3030
"homepage": "https://www.doctrine-project.org",
3131
"require": {
32-
"php": "^8.1",
32+
"php": "^8.4",
3333
"doctrine/dbal": "^4.0",
3434
"doctrine/persistence": "^4",
3535
"doctrine/sql-formatter": "^1.0.1",

config/dbal.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
46

57
use Doctrine\Bundle\DoctrineBundle\Command\CreateDatabaseDoctrineCommand;
@@ -36,15 +38,15 @@
3638
->alias(Connection::class, 'database_connection')
3739
->alias(ManagerRegistry::class, 'doctrine')
3840

39-
->set('data_collector.doctrine', param('doctrine.data_collector.class'))
41+
->set('data_collector.doctrine', (string) param('doctrine.data_collector.class'))
4042
->args([
4143
service('doctrine'),
4244
true,
4345
service('doctrine.debug_data_holder')->nullOnInvalid(),
4446
])
4547
->tag('data_collector', ['template' => '@Doctrine/Collector/db.html.twig', 'id' => 'db', 'priority' => 250])
4648

47-
->set('doctrine.dbal.connection_factory', param('doctrine.dbal.connection_factory.class'))
49+
->set('doctrine.dbal.connection_factory', (string) param('doctrine.dbal.connection_factory.class'))
4850
->args([
4951
param('doctrine.dbal.connection_factory.types'),
5052
service('doctrine.dbal.connection_factory.dsn_parser'),
@@ -59,23 +61,23 @@
5961
->abstract()
6062
->factory([service('doctrine.dbal.connection_factory'), 'createConnection'])
6163

62-
->set('doctrine.dbal.connection.event_manager', param('doctrine.dbal.connection.event_manager.class'))
64+
->set('doctrine.dbal.connection.event_manager', (string) param('doctrine.dbal.connection.event_manager.class'))
6365
->abstract()
6466
->args([
6567
service('service_container'),
6668
])
6769

68-
->set('doctrine.dbal.connection.configuration', param('doctrine.dbal.configuration.class'))
70+
->set('doctrine.dbal.connection.configuration', (string) param('doctrine.dbal.configuration.class'))
6971
->abstract()
7072

71-
->set('doctrine', param('doctrine.class'))
73+
->set('doctrine', (string) param('doctrine.class'))
7274
->public()
7375
->args([
7476
service('service_container'),
75-
param('doctrine.connections'),
76-
param('doctrine.entity_managers'),
77-
param('doctrine.default_connection'),
78-
param('doctrine.default_entity_manager'),
77+
(string) param('doctrine.connections'),
78+
(string) param('doctrine.entity_managers'),
79+
(string) param('doctrine.default_connection'),
80+
(string) param('doctrine.default_entity_manager'),
7981
])
8082
->tag('kernel.reset', ['method' => 'reset'])
8183

config/messenger.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
46

57
use Symfony\Bridge\Doctrine\Messenger\DoctrineClearEntityManagerWorkerSubscriber;

config/middlewares.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
46

57
use ArrayObject;

config/orm.php

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Symfony\Component\DependencyInjection\Loader\Configurator;
46

57
use Doctrine\Bundle\DoctrineBundle\ManagerConfigurator;
@@ -114,13 +116,13 @@
114116

115117
->alias(EntityManagerInterface::class, 'doctrine.orm.entity_manager')
116118

117-
->set('doctrine.orm.proxy_cache_warmer', param('doctrine.orm.proxy_cache_warmer.class'))
119+
->set('doctrine.orm.proxy_cache_warmer', (string) param('doctrine.orm.proxy_cache_warmer.class'))
118120
->tag('kernel.cache_warmer')
119121
->args([
120122
service('doctrine'),
121123
])
122124

123-
->set('form.type_guesser.doctrine', param('form.type_guesser.doctrine.class'))
125+
->set('form.type_guesser.doctrine', (string) param('form.type_guesser.doctrine.class'))
124126
->tag('form.type_guesser')
125127
->args([
126128
service('doctrine'),
@@ -132,10 +134,10 @@
132134
service('doctrine'),
133135
])
134136

135-
->set('doctrine.orm.configuration', param('doctrine.orm.configuration.class'))
137+
->set('doctrine.orm.configuration', (string) param('doctrine.orm.configuration.class'))
136138
->abstract()
137139

138-
->set('doctrine.orm.entity_manager.abstract', param('doctrine.orm.entity_manager.class'))
140+
->set('doctrine.orm.entity_manager.abstract', (string) param('doctrine.orm.entity_manager.class'))
139141
->abstract()
140142
->lazy()
141143

@@ -146,32 +148,32 @@
146148
]),
147149
])
148150

149-
->set('doctrine.orm.manager_configurator.abstract', param('doctrine.orm.manager_configurator.class'))
151+
->set('doctrine.orm.manager_configurator.abstract', (string) param('doctrine.orm.manager_configurator.class'))
150152
->abstract()
151153
->args([
152154
[],
153155
[],
154156
])
155157

156-
->set('doctrine.orm.validator.unique', param('doctrine.orm.validator.unique.class'))
158+
->set('doctrine.orm.validator.unique', (string) param('doctrine.orm.validator.unique.class'))
157159
->tag('validator.constraint_validator', ['alias' => 'doctrine.orm.validator.unique'])
158160
->args([
159161
service('doctrine'),
160162
])
161163

162-
->set('doctrine.orm.validator_initializer', param('doctrine.orm.validator_initializer.class'))
164+
->set('doctrine.orm.validator_initializer', (string) param('doctrine.orm.validator_initializer.class'))
163165
->tag('validator.initializer')
164166
->args([
165167
service('doctrine'),
166168
])
167169

168-
->set('doctrine.orm.security.user.provider', param('doctrine.orm.security.user.provider.class'))
170+
->set('doctrine.orm.security.user.provider', (string) param('doctrine.orm.security.user.provider.class'))
169171
->abstract()
170172
->args([
171173
service('doctrine'),
172174
])
173175

174-
->set('doctrine.orm.listeners.resolve_target_entity', param('doctrine.orm.listeners.resolve_target_entity.class'))
176+
->set('doctrine.orm.listeners.resolve_target_entity', (string) param('doctrine.orm.listeners.resolve_target_entity.class'))
175177

176178
->set('doctrine.orm.listeners.doctrine_dbal_cache_adapter_schema_listener', DoctrineDbalCacheAdapterSchemaListener::class)
177179
->args([
@@ -197,21 +199,21 @@
197199
])
198200
->tag('doctrine.event_listener', ['event' => 'postGenerateSchema'])
199201

200-
->set('doctrine.orm.naming_strategy.default', param('doctrine.orm.naming_strategy.default.class'))
202+
->set('doctrine.orm.naming_strategy.default', (string) param('doctrine.orm.naming_strategy.default.class'))
201203

202-
->set('doctrine.orm.naming_strategy.underscore', param('doctrine.orm.naming_strategy.underscore.class'))
204+
->set('doctrine.orm.naming_strategy.underscore', (string) param('doctrine.orm.naming_strategy.underscore.class'))
203205

204-
->set('doctrine.orm.naming_strategy.underscore_number_aware', param('doctrine.orm.naming_strategy.underscore.class'))
206+
->set('doctrine.orm.naming_strategy.underscore_number_aware', (string) param('doctrine.orm.naming_strategy.underscore.class'))
205207
->args([
206208
CASE_LOWER,
207209
true,
208210
])
209211

210-
->set('doctrine.orm.quote_strategy.default', param('doctrine.orm.quote_strategy.default.class'))
212+
->set('doctrine.orm.quote_strategy.default', (string) param('doctrine.orm.quote_strategy.default.class'))
211213

212-
->set('doctrine.orm.quote_strategy.ansi', param('doctrine.orm.quote_strategy.ansi.class'))
214+
->set('doctrine.orm.quote_strategy.ansi', (string) param('doctrine.orm.quote_strategy.ansi.class'))
213215

214-
->set('doctrine.orm.typed_field_mapper.default', param('doctrine.orm.typed_field_mapper.default.class'))
216+
->set('doctrine.orm.typed_field_mapper.default', (string) param('doctrine.orm.typed_field_mapper.default.class'))
215217

216218
->set('doctrine.ulid_generator', 'Symfony\\Bridge\\Doctrine\\IdGenerator\\UlidGenerator')
217219
->args([

phpcs.xml.dist

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@
1111
<!-- Ignore warnings, show progress of the run and show sniff names -->
1212
<arg value="nps"/>
1313

14-
<config name="php_version" value="80100"/>
14+
<config name="php_version" value="80400"/>
1515

1616
<file>config</file>
1717
<file>src</file>
1818
<file>tests</file>
1919

2020
<rule ref="Doctrine">
21-
<exclude name="SlevomatCodingStandard.TypeHints.DeclareStrictTypes"/>
22-
<exclude name="SlevomatCodingStandard.TypeHints.ReturnTypeHint.MissingNativeTypeHint"/> <!-- we can do it in doctrine-bundle 3.0-->
23-
<exclude name="SlevomatCodingStandard.TypeHints.ParameterTypeHint.MissingNativeTypeHint"/> <!-- we can do it in doctrine-bundle 3.0 -->
2421
<exclude name="SlevomatCodingStandard.Classes.SuperfluousInterfaceNaming.SuperfluousSuffix"/>
2522
<exclude name="SlevomatCodingStandard.Classes.SuperfluousAbstractClassNaming.SuperfluousPrefix"/>
2623
</rule>

src/Attribute/AsDoctrineListener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Doctrine\Bundle\DoctrineBundle\Attribute;
46

57
use Attribute;

src/Attribute/AsEntityListener.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
namespace Doctrine\Bundle\DoctrineBundle\Attribute;
46

57
use Attribute;

0 commit comments

Comments
 (0)