Skip to content

Commit

Permalink
Allow PHP 8.4
Browse files Browse the repository at this point in the history
  • Loading branch information
veewee committed Oct 25, 2024
1 parent 77af041 commit 94c99cd
Show file tree
Hide file tree
Showing 13 changed files with 21 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.3"
- "8.4"
operating-system:
- "ubuntu-latest"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: "installing PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
php-version: "8.4"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr
extensions: bcmath, mbstring, intl, sodium, json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/coding-standards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: "installing PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
php-version: "8.4"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr
extensions: bcmath, mbstring, intl, sodium, json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/documentation-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: "installing PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
php-version: "8.4"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr
extensions: bcmath, mbstring, intl, sodium, json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mutation-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
matrix:
php-version:
- "8.3"
- "8.4"
operating-system:
- "ubuntu-latest"

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/preload-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: "installing PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
php-version: "8.4"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr
extensions: bcmath, mbstring, intl, sodium, json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/security-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: "installing PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
php-version: "8.4"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr
extensions: bcmath, mbstring, intl, sodium, json
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/static-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: "installing PHP"
uses: "shivammathur/setup-php@v2"
with:
php-version: "8.3"
php-version: "8.4"
ini-values: memory_limit=-1
tools: composer:v2, cs2pr
extensions: bcmath, mbstring, intl, sodium, json
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
php-version:
- "8.2"
- "8.3"
- "8.4"
operating-system:
- "macos-latest"
- "ubuntu-latest"
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ help:
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_\-\.]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

install: ## install all dependencies for a development environment
composer install
COMPOSER_IGNORE_PLATFORM_REQ=php+ composer install

coding-standard-fix: ## apply automated coding standard fixes
PHP_CS_FIXER_IGNORE_ENV=1 ./vendor/bin/php-cs-fixer fix --config=config/.php_cs.dist.php
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
}
],
"require": {
"php": "~8.2.0 || ~8.3.0",
"php": "~8.2.0 || ~8.3.0 || ~8.4.0",
"ext-bcmath": "*",
"ext-json": "*",
"ext-mbstring": "*",
Expand Down
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion src/Psl/DateTime/DateTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,12 @@ public static function fromParts(Timezone $timezone, int $year, Month|int $month
Internal\to_intl_timezone($timezone),
);

$calendar->set($year, $month - 1, $day, $hours, $minutes, $seconds);
if (PHP_VERSION_ID >= 80300) {

Check warning on line 182 in src/Psl/DateTime/DateTime.php

View workflow job for this annotation

GitHub Actions / mutation tests (8.4, ubuntu-latest)

Escaped Mutant for Mutator "GreaterThanOrEqualTo": --- Original +++ New @@ @@ * @var IntlCalendar $calendar */ $calendar = IntlCalendar::createInstance(Internal\to_intl_timezone($timezone)); - if (PHP_VERSION_ID >= 80300) { + if (PHP_VERSION_ID > 80300) { $calendar->setDateTime($year, $month - 1, $day, $hours, $minutes, $seconds); } else { // @codeCoverageIgnore

Check warning on line 182 in src/Psl/DateTime/DateTime.php

View workflow job for this annotation

GitHub Actions / mutation tests (8.4, ubuntu-latest)

Escaped Mutant for Mutator "GreaterThanOrEqualToNegotiation": --- Original +++ New @@ @@ * @var IntlCalendar $calendar */ $calendar = IntlCalendar::createInstance(Internal\to_intl_timezone($timezone)); - if (PHP_VERSION_ID >= 80300) { + if (PHP_VERSION_ID < 80300) { $calendar->setDateTime($year, $month - 1, $day, $hours, $minutes, $seconds); } else { // @codeCoverageIgnore
$calendar->setDateTime($year, $month - 1, $day, $hours, $minutes, $seconds);
} else {
// @codeCoverageIgnore
$calendar->set($year, $month - 1, $day, $hours, $minutes, $seconds);
}

if ($seconds !== $calendar->get(IntlCalendar::FIELD_SECOND)) {
throw Exception\UnexpectedValueException::forSeconds($seconds, $calendar->get(IntlCalendar::FIELD_SECOND));
Expand Down

0 comments on commit 94c99cd

Please sign in to comment.