Skip to content

Commit

Permalink
Add support for most recent PHP version
Browse files Browse the repository at this point in the history
  • Loading branch information
henriquemoody committed Dec 2, 2024
1 parent 308acfc commit 6c2f023
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 23 deletions.
16 changes: 7 additions & 9 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ jobs:
strategy:
matrix:
php-version:
- "7.1"
- "7.2"
- "7.3"
- "7.4"
- "8.0"
- "8.1"
- "8.2"
- "8.3"
- "8.4"

steps:
- uses: actions/checkout@v2
Expand All @@ -34,7 +32,7 @@ jobs:

- name: Cache Composer packages
id: composer-cache
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: ${{ runner.os }}-php-composer-${{ matrix.php-version }}-${{ hashFiles('**/composer.lock') }}
Expand All @@ -60,7 +58,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
php-version: "8.4"
ini-values: post_max_size=256M, max_execution_time=180
coverage: xdebug

Expand Down Expand Up @@ -91,7 +89,7 @@ jobs:
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: "7.4"
php-version: "8.4"
ini-values: post_max_size=256M, max_execution_time=180

- name: Install dependencies
Expand All @@ -102,4 +100,4 @@ jobs:
run: composer check-style

- name: Run static analyse
run: composer psalm
run: composer psalm
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,18 @@
}
],
"require": {
"php": ">=7.1",
"php": ">=8.1",
"ext-json": "*"
},
"require-dev": {
"ext-gettext": "*",
"php-coveralls/php-coveralls": "^2.7",
"phpmd/phpmd": "^2.15",
"phpunit/phpunit": "^9.6",
"sokil/php-isocodes-db-i18n": "^4.0.0",
"phpunit/phpunit": ">=7.5.20",
"php-coveralls/php-coveralls": "^2.1",
"squizlabs/php_codesniffer": "^3.4",
"phpmd/phpmd" : "@stable",
"symfony/translation": "^4.4.17|^5.2",
"vimeo/psalm": "^4.3",
"infection/infection": ">=0.11.5"
"squizlabs/php_codesniffer": "^3.11",
"symfony/translation": "^7.2",
"vimeo/psalm": "^4.30"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -53,6 +52,7 @@
"config": {
"allow-plugins": {
"infection/extension-installer": true
}
},
"sort-packages": true
}
}
4 changes: 2 additions & 2 deletions src/AbstractDatabase.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/IsoCodesFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tests/docker/docker-php-entrypoint
Original file line number Diff line number Diff line change
Expand Up @@ -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
/php-isocodes/vendor/bin/phpunit /php-isocodes/tests

0 comments on commit 6c2f023

Please sign in to comment.