Skip to content

Commit

Permalink
Drop support for Symfony < 5.4, add Symfony 6.4 and PHP 8.3 to CI, up…
Browse files Browse the repository at this point in the history
…date .gitattributes file
  • Loading branch information
ker0x committed Jan 29, 2024
1 parent 06c094c commit 5c911ef
Show file tree
Hide file tree
Showing 18 changed files with 241 additions and 144 deletions.
53 changes: 21 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,55 +55,44 @@ jobs:
run: vendor/bin/php-cs-fixer fix -v --dry-run --using-cache=no --format=checkstyle | cs2pr

phpunit:
name: PHPUnit (PHP ${{ matrix.php }}) (Symfony ${{ matrix.sf_version }}) (${{ matrix.dependencies }})
name: PHPUnit (PHP ${{ matrix.php }}) (Symfony ${{ matrix.sf_version }})
runs-on: ubuntu-latest
strategy:
max-parallel: 10
fail-fast: true
fail-fast: false
matrix:
dependencies: ['highest']
php: ['7.4', '8.0', '8.1', '8.2']
include:
- php: '7.4'
sf_version: '4.4.*'
dependencies: 'lowest'
- php: '7.4'
sf_version: '4.4.*'
- php: '7.4'
sf_version: '5.4.*'
dependencies: 'lowest'
- php: '8.0'
sf_version: '5.4.*'
- php: '8.1'
sf_version: '5.4.*'
- php: '8.0'
sf_version: '6.0.*'
- php: '8.1'
sf_version: '6.0.*'
- php: '8.2'
sf_version: '6.2.*'
- php: '8.2'
sf_version: '6.4.*'
- php: '8.2'
sf_version: '7.0.*'
php: [ '7.4', '8.0', '8.1', '8.2', '8.3' ]
sf_version: ['5.4.*', '6.4.*', '7.0.*']
exclude:
- php: '7.4'
sf_version: '6.4.*'
- php: '8.0'
sf_version: '6.4.*'
- php: '7.4'
sf_version: '7.0.*'
- php: '8.0'
sf_version: '7.0.*'
- php: '8.1'
sf_version: '7.0.*'
steps:
- name: "Checkout code"
uses: actions/checkout@v4

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
tools: flex
coverage: none

- name: "Checkout code"
uses: actions/checkout@v4

- name: "Install Composer dependencies"
uses: "ramsey/composer-install@v2"
env:
SYMFONY_REQUIRE: ${{ matrix.sf_version }}
with:
composer-options: "--optimize-autoloader"
dependency-versions: "${{ matrix.dependencies }}"

- name: "Run tests"
env:
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=3&max[indirect]=1'
SYMFONY_DEPRECATIONS_HELPER: 'baselineFile=./tests/allowed.json'
run: ./vendor/bin/simple-phpunit -v
22 changes: 12 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
"geocoder-php/plugin": "^1.5",
"php-http/curl-client": "^2.3",
"php-http/discovery": "^1.14",
"symfony/console": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/options-resolver": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/console": "^5.4 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^5.4 || ^6.0 || ^7.0",
"symfony/options-resolver": "^5.4 || ^6.0 || ^7.0",
"willdurand/geocoder": "^4.6"
},
"require-dev": {
Expand Down Expand Up @@ -58,16 +58,18 @@
"geoip/geoip": "~1.17",
"nyholm/nsa": "^1.3",
"nyholm/psr7": "^1.5",
"nyholm/symfony-bundle-test": "dev-master",
"php-http/mock-client": "^1.6",
"nyholm/symfony-bundle-test": "^2.0 || ^3.0",
"php-http/message": "^1.13",
"php-http/mock-client": "^1.6",
"phpstan/phpstan": "^1.9.2",
"psr/http-client": "^1.0",
"symfony/cache": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^5.2 || ^6.0 || ^7.0",
"symfony/validator": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/yaml": "^4.4 || ^5.0 || ^6.0 || ^7.0"
"psr/simple-cache": "^1.0 || ^2.0",
"symfony/cache": "^5.4 || ^6.0 || ^7.0",
"symfony/config": "^5.4 || ^6.0 || ^7.0",
"symfony/phpunit-bridge": "^5.4 || ^6.0 || ^7.0",
"symfony/validator": "^5.4 || ^6.0 || ^7.0",
"symfony/var-exporter": "^5.4 || ^6.0 || ^7.0",
"symfony/yaml": "^5.4 || ^6.0 || ^7.0"
},
"conflict": {
"geocoder-php/nominatim-provider": "<5.0"
Expand Down
14 changes: 2 additions & 12 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,12 @@ parameters:
path: src/DependencyInjection/BazingaGeocoderExtension.php

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

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

Expand All @@ -140,11 +140,6 @@ parameters:
count: 1
path: src/Doctrine/ORM/GeocoderListener.php

-
message: "#^Method Bazinga\\\\GeocoderBundle\\\\Plugin\\\\FakeIpPlugin\\:\\:handleQuery\\(\\) return type with generic interface Http\\\\Promise\\\\Promise does not specify its types\\: T$#"
count: 1
path: src/Plugin/FakeIpPlugin.php

-
message: "#^Parameter \\#1 \\$text of method Geocoder\\\\Query\\\\GeocodeQuery\\:\\:withText\\(\\) expects string, string\\|null given\\.$#"
count: 1
Expand All @@ -155,11 +150,6 @@ parameters:
count: 1
path: src/Plugin/FakeIpPlugin.php

-
message: "#^Method Bazinga\\\\GeocoderBundle\\\\Plugin\\\\ProfilingPlugin\\:\\:handleQuery\\(\\) return type with generic interface Http\\\\Promise\\\\Promise does not specify its types\\: T$#"
count: 1
path: src/Plugin/ProfilingPlugin.php

-
message: "#^Parameter \\#1 \\$accountId of class GeoIp2\\\\WebService\\\\Client constructor expects int, int\\|null given\\.$#"
count: 1
Expand Down
1 change: 0 additions & 1 deletion src/Validator/Constraint/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

/**
* @Annotation
*
* @Target({"PROPERTY", "METHOD", "ANNOTATION"})
*
* @author Tomas Norkūnas <[email protected]>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ protected function tearDown(): void
$reflection = new \ReflectionObject($this->compilerPass);
$prop = $reflection->getProperty('factoryServiceIds');
$prop->setAccessible(true);
$prop->setValue([]);
$prop->setValue(null, []);
}

public function testProcessThrows(): void
Expand Down
10 changes: 7 additions & 3 deletions tests/Functional/BundleInitializationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
namespace Bazinga\GeocoderBundle\Tests\Functional;

use Bazinga\GeocoderBundle\BazingaGeocoderBundle;
use Bazinga\GeocoderBundle\Tests\PublicServicePass;
use Geocoder\Dumper\GeoArray;
use Geocoder\Dumper\GeoJson;
use Geocoder\Dumper\Gpx;
Expand Down Expand Up @@ -44,8 +43,6 @@ protected static function createKernel(array $options = []): KernelInterface
*/
$kernel = parent::createKernel($options);
$kernel->addTestBundle(BazingaGeocoderBundle::class);
$kernel->addTestCompilerPass(new PublicServicePass('|[Bb]azinga:*|'));
$kernel->addTestCompilerPass(new PublicServicePass('|[gG]eocoder:*|'));
$kernel->handleOptions($options);

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

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

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

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

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

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

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

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

0 comments on commit 5c911ef

Please sign in to comment.