Skip to content

Commit 5c911ef

Browse files
committed
Drop support for Symfony < 5.4, add Symfony 6.4 and PHP 8.3 to CI, update .gitattributes file
1 parent 06c094c commit 5c911ef

18 files changed

+241
-144
lines changed

.github/workflows/ci.yml

+21-32
Original file line numberDiff line numberDiff line change
@@ -55,55 +55,44 @@ jobs:
5555
run: vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no --format=checkstyle | cs2pr
5656

5757
phpunit:
58-
name: PHPUnit (PHP ${{ matrix.php }}) (Symfony ${{ matrix.sf_version }}) (${{ matrix.dependencies }})
58+
name: PHPUnit (PHP ${{ matrix.php }}) (Symfony ${{ matrix.sf_version }})
5959
runs-on: ubuntu-latest
6060
strategy:
6161
max-parallel: 10
62-
fail-fast: true
62+
fail-fast: false
6363
matrix:
64-
dependencies: ['highest']
65-
php: ['7.4', '8.0', '8.1', '8.2']
66-
include:
67-
- php: '7.4'
68-
sf_version: '4.4.*'
69-
dependencies: 'lowest'
70-
- php: '7.4'
71-
sf_version: '4.4.*'
72-
- php: '7.4'
73-
sf_version: '5.4.*'
74-
dependencies: 'lowest'
75-
- php: '8.0'
76-
sf_version: '5.4.*'
77-
- php: '8.1'
78-
sf_version: '5.4.*'
79-
- php: '8.0'
80-
sf_version: '6.0.*'
81-
- php: '8.1'
82-
sf_version: '6.0.*'
83-
- php: '8.2'
84-
sf_version: '6.2.*'
85-
- php: '8.2'
86-
sf_version: '6.4.*'
87-
- php: '8.2'
88-
sf_version: '7.0.*'
64+
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
65+
sf_version: ['5.4.*', '6.4.*', '7.0.*']
66+
exclude:
67+
- php: '7.4'
68+
sf_version: '6.4.*'
69+
- php: '8.0'
70+
sf_version: '6.4.*'
71+
- php: '7.4'
72+
sf_version: '7.0.*'
73+
- php: '8.0'
74+
sf_version: '7.0.*'
75+
- php: '8.1'
76+
sf_version: '7.0.*'
8977
steps:
78+
- name: "Checkout code"
79+
uses: actions/checkout@v4
80+
9081
- name: "Setup PHP"
9182
uses: shivammathur/setup-php@v2
9283
with:
9384
php-version: ${{ matrix.php }}
9485
tools: flex
9586
coverage: none
9687

97-
- name: "Checkout code"
98-
uses: actions/checkout@v4
99-
10088
- name: "Install Composer dependencies"
10189
uses: "ramsey/composer-install@v2"
90+
env:
91+
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
10292
with:
10393
composer-options: "--optimize-autoloader"
104-
dependency-versions: "${{ matrix.dependencies }}"
10594

10695
- name: "Run tests"
10796
env:
108-
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=3&max[indirect]=1'
97+
SYMFONY_DEPRECATIONS_HELPER: 'baselineFile=./tests/allowed.json'
10998
run: ./vendor/bin/simple-phpunit -v

composer.json

+12-10
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
"geocoder-php/plugin": "^1.5",
1616
"php-http/curl-client": "^2.3",
1717
"php-http/discovery": "^1.14",
18-
"symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0",
19-
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
20-
"symfony/options-resolver": "^4.4 || ^5.0 || ^6.0 || ^7.0",
18+
"symfony/console": "^5.4 || ^6.0 || ^7.0",
19+
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
20+
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
2121
"willdurand/geocoder": "^4.6"
2222
},
2323
"require-dev": {
@@ -58,16 +58,18 @@
5858
"geoip/geoip": "~1.17",
5959
"nyholm/nsa": "^1.3",
6060
"nyholm/psr7": "^1.5",
61-
"nyholm/symfony-bundle-test": "dev-master",
62-
"php-http/mock-client": "^1.6",
61+
"nyholm/symfony-bundle-test": "^2.0 || ^3.0",
6362
"php-http/message": "^1.13",
63+
"php-http/mock-client": "^1.6",
6464
"phpstan/phpstan": "^1.9.2",
6565
"psr/http-client": "^1.0",
66-
"symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0",
67-
"symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0",
68-
"symfony/phpunit-bridge": "^5.2 || ^6.0 || ^7.0",
69-
"symfony/validator": "^4.4 || ^5.0 || ^6.0 || ^7.0",
70-
"symfony/yaml": "^4.4 || ^5.0 || ^6.0 || ^7.0"
66+
"psr/simple-cache": "^1.0 || ^2.0",
67+
"symfony/cache": "^5.4 || ^6.0 || ^7.0",
68+
"symfony/config": "^5.4 || ^6.0 || ^7.0",
69+
"symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0",
70+
"symfony/validator": "^5.4 || ^6.0 || ^7.0",
71+
"symfony/var-exporter": "^5.4 || ^6.0 || ^7.0",
72+
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
7173
},
7274
"conflict": {
7375
"geocoder-php/nominatim-provider": "<5.0"

phpstan-baseline.neon

+2-12
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,12 @@ parameters:
121121
path: src/DependencyInjection/BazingaGeocoderExtension.php
122122

123123
-
124-
message: "#^Cannot call method end\\(\\) on Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\|null\\.$#"
124+
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:end\\(\\)\\.$#"
125125
count: 2
126126
path: src/DependencyInjection/Configuration.php
127127

128128
-
129-
message: "#^Cannot call method variableNode\\(\\) on Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\|null\\.$#"
129+
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeParentInterface\\:\\:variableNode\\(\\)\\.$#"
130130
count: 1
131131
path: src/DependencyInjection/Configuration.php
132132

@@ -140,11 +140,6 @@ parameters:
140140
count: 1
141141
path: src/Doctrine/ORM/GeocoderListener.php
142142

143-
-
144-
message: "#^Method Bazinga\\\\GeocoderBundle\\\\Plugin\\\\FakeIpPlugin\\:\\:handleQuery\\(\\) return type with generic interface Http\\\\Promise\\\\Promise does not specify its types\\: T$#"
145-
count: 1
146-
path: src/Plugin/FakeIpPlugin.php
147-
148143
-
149144
message: "#^Parameter \\#1 \\$text of method Geocoder\\\\Query\\\\GeocodeQuery\\:\\:withText\\(\\) expects string, string\\|null given\\.$#"
150145
count: 1
@@ -155,11 +150,6 @@ parameters:
155150
count: 1
156151
path: src/Plugin/FakeIpPlugin.php
157152

158-
-
159-
message: "#^Method Bazinga\\\\GeocoderBundle\\\\Plugin\\\\ProfilingPlugin\\:\\:handleQuery\\(\\) return type with generic interface Http\\\\Promise\\\\Promise does not specify its types\\: T$#"
160-
count: 1
161-
path: src/Plugin/ProfilingPlugin.php
162-
163153
-
164154
message: "#^Parameter \\#1 \\$accountId of class GeoIp2\\\\WebService\\\\Client constructor expects int, int\\|null given\\.$#"
165155
count: 1

src/Validator/Constraint/Address.php

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
/**
1818
* @Annotation
19-
*
2019
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
2120
*
2221
* @author Tomas Norkūnas <[email protected]>

tests/DependencyInjection/Compiler/FactoryValidatorPassTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function tearDown(): void
3434
$reflection = new \ReflectionObject($this->compilerPass);
3535
$prop = $reflection->getProperty('factoryServiceIds');
3636
$prop->setAccessible(true);
37-
$prop->setValue([]);
37+
$prop->setValue(null, []);
3838
}
3939

4040
public function testProcessThrows(): void

tests/Functional/BundleInitializationTest.php

+7-3
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
namespace Bazinga\GeocoderBundle\Tests\Functional;
1414

1515
use Bazinga\GeocoderBundle\BazingaGeocoderBundle;
16-
use Bazinga\GeocoderBundle\Tests\PublicServicePass;
1716
use Geocoder\Dumper\GeoArray;
1817
use Geocoder\Dumper\GeoJson;
1918
use Geocoder\Dumper\Gpx;
@@ -44,8 +43,6 @@ protected static function createKernel(array $options = []): KernelInterface
4443
*/
4544
$kernel = parent::createKernel($options);
4645
$kernel->addTestBundle(BazingaGeocoderBundle::class);
47-
$kernel->addTestCompilerPass(new PublicServicePass('|[Bb]azinga:*|'));
48-
$kernel->addTestCompilerPass(new PublicServicePass('|[gG]eocoder:*|'));
4946
$kernel->handleOptions($options);
5047

5148
return $kernel;
@@ -55,6 +52,7 @@ public function testInitBundle(): void
5552
{
5653
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
5754
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
55+
$kernel->addTestConfig(__DIR__.'/config/framework_'.($kernel::VERSION_ID >= 60000 ? 'sf6' : 'sf5').'.yml');
5856
}]);
5957

6058
$container = method_exists(__CLASS__, 'getContainer') ? self::getContainer() : $kernel->getContainer();
@@ -69,6 +67,7 @@ public function testBundleWithOneProviderConfiguration(): void
6967
{
7068
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
7169
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
70+
$kernel->addTestConfig(__DIR__.'/config/framework_'.($kernel::VERSION_ID >= 60000 ? 'sf6' : 'sf5').'.yml');
7271
$kernel->addTestConfig(__DIR__.'/config/simple.yml');
7372
}]);
7473

@@ -84,6 +83,7 @@ public function testBundleWithCachedProvider(): void
8483
{
8584
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
8685
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
86+
$kernel->addTestConfig(__DIR__.'/config/framework_'.($kernel::VERSION_ID >= 60000 ? 'sf6' : 'sf5').'.yml');
8787
$kernel->addTestConfig(__DIR__.'/config/cache.yml');
8888
}]);
8989

@@ -101,6 +101,7 @@ public function testCacheLifetimeCanBeNull(): void
101101
{
102102
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
103103
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
104+
$kernel->addTestConfig(__DIR__.'/config/framework_'.($kernel::VERSION_ID >= 60000 ? 'sf6' : 'sf5').'.yml');
104105
$kernel->addTestConfig(__DIR__.'/config/cache_without_lifetime.yml');
105106
}]);
106107

@@ -126,6 +127,7 @@ public function testBundleWithPluginsYml(): void
126127
{
127128
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
128129
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
130+
$kernel->addTestConfig(__DIR__.'/config/framework_'.($kernel::VERSION_ID >= 60000 ? 'sf6' : 'sf5').'.yml');
129131
$kernel->addTestConfig(__DIR__.'/config/service_plugin.yml');
130132
}]);
131133

@@ -143,6 +145,7 @@ public function testBundleWithPluginXml(): void
143145
{
144146
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
145147
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
148+
$kernel->addTestConfig(__DIR__.'/config/framework_'.($kernel::VERSION_ID >= 60000 ? 'sf6' : 'sf5').'.yml');
146149
$kernel->addTestConfig(__DIR__.'/config/service_plugin.xml');
147150
}]);
148151

@@ -160,6 +163,7 @@ public function testBundleHasRegisteredDumpers(): void
160163
{
161164
$kernel = self::bootKernel(['config' => static function (TestKernel $kernel) {
162165
$kernel->addTestConfig(__DIR__.'/config/framework.yml');
166+
$kernel->addTestConfig(__DIR__.'/config/framework_'.($kernel::VERSION_ID >= 60000 ? 'sf6' : 'sf5').'.yml');
163167
}]);
164168

165169
$container = method_exists(__CLASS__, 'getContainer') ? self::getContainer() : $kernel->getContainer();

0 commit comments

Comments
 (0)