From 7d7db7a736d1649015bc29c0bd32ac500892a6fe Mon Sep 17 00:00:00 2001 From: Henrique Moody Date: Mon, 2 Dec 2024 13:50:38 +0100 Subject: [PATCH] Add support for most recent PHP version --- .github/workflows/continuous-integration.yml | 5 ++++- composer.json | 12 ++++++------ src/AbstractDatabase.php | 4 ++-- src/IsoCodesFactory.php | 4 ++-- tests/docker/docker-php-entrypoint | 2 +- 5 files changed, 15 insertions(+), 12 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 1e7d0a2e..21c29d05 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -19,6 +19,9 @@ jobs: - "7.4" - "8.0" - "8.1" + - "8.2" + - "8.3" + - "8.4" steps: - uses: actions/checkout@v2 @@ -102,4 +105,4 @@ jobs: run: composer check-style - name: Run static analyse - run: composer psalm \ No newline at end of file + run: composer psalm diff --git a/composer.json b/composer.json index d99c0b8b..0a4985de 100644 --- a/composer.json +++ b/composer.json @@ -14,14 +14,13 @@ }, "require-dev": { "ext-gettext": "*", - "sokil/php-isocodes-db-i18n": "^4.0.0", - "phpunit/phpunit": ">=7.5.20", "php-coveralls/php-coveralls": "^2.1", + "phpmd/phpmd": "@stable", + "phpunit/phpunit": "^9.6", + "sokil/php-isocodes-db-i18n": "^4.0.0", "squizlabs/php_codesniffer": "^3.4", - "phpmd/phpmd" : "@stable", "symfony/translation": "^4.4.17|^5.2", - "vimeo/psalm": "^4.3", - "infection/infection": ">=0.11.5" + "vimeo/psalm": "^4.3" }, "autoload": { "psr-4": { @@ -53,6 +52,7 @@ "config": { "allow-plugins": { "infection/extension-installer": true - } + }, + "sort-packages": true } } diff --git a/src/AbstractDatabase.php b/src/AbstractDatabase.php index 4ba3af19..86efd692 100644 --- a/src/AbstractDatabase.php +++ b/src/AbstractDatabase.php @@ -50,8 +50,8 @@ abstract class AbstractDatabase implements \Iterator, \Countable * @throws \RuntimeException when base directory not specified and directory can not be located automatically */ public function __construct( - string $baseDirectory = null, - TranslationDriverInterface $translationDriver = null + ?string $baseDirectory = null, + ?TranslationDriverInterface $translationDriver = null ) { if (empty($baseDirectory)) { // Require external database in "sokil/php-isocodes-db-*" packages diff --git a/src/IsoCodesFactory.php b/src/IsoCodesFactory.php index 7e55ce40..fb33cf99 100644 --- a/src/IsoCodesFactory.php +++ b/src/IsoCodesFactory.php @@ -61,8 +61,8 @@ class IsoCodesFactory private $translationDriver; public function __construct( - string $baseDirectory = null, - TranslationDriverInterface $translationDriver = null + ?string $baseDirectory = null, + ?TranslationDriverInterface $translationDriver = null ) { $this->baseDirectory = $baseDirectory; $this->translationDriver = $translationDriver ?? new GettextExtensionDriver(); diff --git a/tests/docker/docker-php-entrypoint b/tests/docker/docker-php-entrypoint index 421f949b..c776d20a 100755 --- a/tests/docker/docker-php-entrypoint +++ b/tests/docker/docker-php-entrypoint @@ -14,4 +14,4 @@ echo "uk_UA.UTF-8 UTF-8" > /etc/locale.gen locale-gen # run tests -/php-isocodes/vendor/bin/phpunit -c /php-isocodes/tests/phpunit.xml /php-isocodes/tests \ No newline at end of file +/php-isocodes/vendor/bin/phpunit /php-isocodes/tests