Skip to content

Commit 5f129d6

Browse files
feat: allow symfony 8 (geocoder-php#387)
* feat: allow symfony 8 * feat: allow symfony 8 --------- Co-authored-by: Christopher Georg <[email protected]>
1 parent 6ceaf27 commit 5f129d6

File tree

10 files changed

+45
-33
lines changed

10 files changed

+45
-33
lines changed

.github/workflows/ci.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,22 @@ jobs:
6262
fail-fast: false
6363
matrix:
6464
php: [ '8.0', '8.1', '8.2', '8.3', '8.4', '8.5' ]
65-
sf_version: [ '6.4.*', '7.3.*', '7.4.*' ]
65+
sf_version: [ '6.4.*', '7.3.*', '7.4.*', '8.0.*' ]
6666
exclude:
6767
- php: '8.0'
6868
sf_version: '6.4.*'
6969
- php: '8.0'
7070
sf_version: '7.3.*'
7171
- php: '8.1'
7272
sf_version: '7.3.*'
73+
- php: '8.0'
74+
sf_version: '8.0.*'
75+
- php: '8.1'
76+
sf_version: '8.0.*'
77+
- php: '8.2'
78+
sf_version: '8.0.*'
79+
- php: '8.3'
80+
sf_version: '8.0.*'
7381
- php: '8.0'
7482
sf_version: '7.4.*'
7583
- php: '8.1'

composer.json

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,9 @@
1717
"php": "^8.1",
1818
"geocoder-php/plugin": "^1.5",
1919
"php-http/discovery": "^1.14",
20-
"symfony/console": "^5.4 || ^6.4 || ^7.0",
21-
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.0",
22-
"symfony/options-resolver": "^5.4 || ^6.4 || ^7.0",
20+
"symfony/console": "^5.4 || ^6.4 || ^7.0 || ^8.0",
21+
"symfony/framework-bundle": "^5.4 || ^6.4 || ^7.0 || ^8.0",
22+
"symfony/options-resolver": "^5.4 || ^6.4 || ^7.0 || ^8.0",
2323
"willdurand/geocoder": "^4.6|^5.0"
2424
},
2525
"require-dev": {
@@ -60,13 +60,13 @@
6060
"phpstan/phpstan": "^1.9.2",
6161
"psr/http-client": "^1.0",
6262
"psr/simple-cache": "^1.0 || ^2.0",
63-
"symfony/cache": "^5.4 || ^6.4 || ^7.0",
64-
"symfony/config": "^5.4 || ^6.4 || ^7.0",
65-
"symfony/http-client": "^5.4 || ^6.4 || ^7.0",
66-
"symfony/phpunit-bridge": "^5.4 || ^6.4 || ^7.0",
67-
"symfony/validator": "^5.4 || ^6.4 || ^7.0",
68-
"symfony/var-exporter": "^5.4 || ^6.4 || ^7.0",
69-
"symfony/yaml": "^5.4 || ^6.4 || ^7.0"
63+
"symfony/cache": "^5.4 || ^6.4 || ^7.0 || ^8.0",
64+
"symfony/config": "^5.4 || ^6.4 || ^7.0 || ^8.0",
65+
"symfony/http-client": "^5.4 || ^6.4 || ^7.0 || ^8.0",
66+
"symfony/phpunit-bridge": "^5.4 || ^6.4 || ^7.0 || ^8.0",
67+
"symfony/validator": "^5.4 || ^6.4 || ^7.0 || ^8.0",
68+
"symfony/var-exporter": "^5.4 || ^6.4 || ^7.0 || ^8.0",
69+
"symfony/yaml": "^5.4 || ^6.4 || ^7.0 || ^8.0"
7070
},
7171
"autoload": {
7272
"psr-4": {

src/Command/GeocodeCommand.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,7 @@ public function __construct(ProviderAggregator $geocoder)
3636
parent::__construct();
3737
}
3838

39-
/**
40-
* @return void
41-
*/
42-
protected function configure()
39+
protected function configure(): void
4340
{
4441
$this
4542
->addArgument('address', InputArgument::REQUIRED, 'The address')

src/Validator/Constraint/AddressValidator.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,8 @@ public function __construct(Provider $addressGeocoder)
3737

3838
/**
3939
* @param mixed $value
40-
*
41-
* @return void
4240
*/
43-
public function validate($value, Constraint $constraint)
41+
public function validate($value, Constraint $constraint): void
4442
{
4543
if (!$constraint instanceof Address) {
4644
throw new UnexpectedTypeException($constraint, Address::class);

tests/Functional/BundleInitializationTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function testInitBundle(): void
5454
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
5555

5656
if ($kernel::VERSION_ID >= 60000) {
57-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
57+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
5858
}
5959
}]);
6060

@@ -72,7 +72,7 @@ public function testBundleWithOneProviderConfiguration(): void
7272
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
7373

7474
if ($kernel::VERSION_ID >= 60000) {
75-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
75+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
7676
}
7777

7878
$kernel->addTestConfig(__DIR__.'/config/simple.yml');
@@ -92,7 +92,7 @@ public function testBundleWithCachedProvider(): void
9292
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
9393

9494
if ($kernel::VERSION_ID >= 60000) {
95-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
95+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
9696
}
9797

9898
$kernel->addTestConfig(__DIR__.'/config/cache.yml');
@@ -114,7 +114,7 @@ public function testCacheLifetimeCanBeNull(): void
114114
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
115115

116116
if ($kernel::VERSION_ID >= 60000) {
117-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
117+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
118118
}
119119

120120
$kernel->addTestConfig(__DIR__.'/config/cache_without_lifetime.yml');
@@ -144,7 +144,7 @@ public function testBundleWithPluginsYml(): void
144144
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
145145

146146
if ($kernel::VERSION_ID >= 60000) {
147-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
147+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
148148
}
149149

150150
$kernel->addTestConfig(__DIR__.'/config/service_plugin.yml');
@@ -166,7 +166,7 @@ public function testBundleHasRegisteredDumpers(): void
166166
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
167167

168168
if ($kernel::VERSION_ID >= 60000) {
169-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
169+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
170170
}
171171
}]);
172172

tests/Functional/GeocoderListenerTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ public function testPersistForProperty(): void
108108
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
109109

110110
if ($kernel::VERSION_ID >= 60000) {
111-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
111+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
112112
}
113113

114114
$kernel->addTestConfig(__DIR__.'/config/listener.yml');
@@ -148,7 +148,7 @@ public function testPersistForGetter(): void
148148
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
149149

150150
if ($kernel::VERSION_ID >= 60000) {
151-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
151+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
152152
}
153153

154154
$kernel->addTestConfig(__DIR__.'/config/listener.yml');
@@ -188,7 +188,7 @@ public function testPersistForStringableGetter(): void
188188
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
189189

190190
if ($kernel::VERSION_ID >= 60000) {
191-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
191+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
192192
}
193193

194194
$kernel->addTestConfig(__DIR__.'/config/listener.yml');
@@ -228,7 +228,7 @@ public function testPersistForInvalidGetter(): void
228228
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
229229

230230
if ($kernel::VERSION_ID >= 60000) {
231-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
231+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
232232
}
233233

234234
$kernel->addTestConfig(__DIR__.'/config/listener.yml');
@@ -261,7 +261,7 @@ public function testPersistForEmptyProperty(): void
261261
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
262262

263263
if ($kernel::VERSION_ID >= 60000) {
264-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
264+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
265265
}
266266

267267
$kernel->addTestConfig(__DIR__.'/config/listener.yml');
@@ -294,7 +294,7 @@ public function testDoesNotGeocodeIfAddressNotChanged(): void
294294
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
295295

296296
if ($kernel::VERSION_ID >= 60000) {
297-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
297+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
298298
}
299299

300300
$kernel->addTestConfig(__DIR__.'/config/listener.yml');

tests/Functional/PluginInteractionTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function testCachePluginUsesIpFromFakeIpPlugin(): void
5959
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
6060

6161
if ($kernel::VERSION_ID >= 60000) {
62-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
62+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
6363
}
6464

6565
$kernel->addTestConfig(__DIR__.'/config/cache_symfony.yml');
@@ -85,7 +85,7 @@ public function testCachePluginUsesIpFromFakeIpPlugin(): void
8585
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
8686

8787
if ($kernel::VERSION_ID >= 60000) {
88-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
88+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
8989
}
9090

9191
$kernel->addTestConfig(__DIR__.'/config/cache_symfony.yml');

tests/Functional/ProviderFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public function testProviderConfiguration(string $class, array $serviceNames): v
7878
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
7979

8080
if ($kernel::VERSION_ID >= 60000) {
81-
$kernel->addTestConfig(__DIR__.'/config/framework_sf6.yml');
81+
$kernel->addTestConfig(__DIR__.'/config/framework_sf'.$kernel::MAJOR_VERSION.'.yml');
8282
}
8383

8484
$kernel->addTestConfig(__DIR__.'/config/provider/'.strtolower(substr($class, strrpos($class, '\\') + 1)).'.yml');
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
framework:
2+
annotations: false
3+
handle_all_throwables: true
4+
php_errors:
5+
log: true
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
framework:
2+
handle_all_throwables: true
3+
php_errors:
4+
log: true

0 commit comments

Comments
 (0)