Skip to content

Commit

Permalink
feat: PHP 8.1 support
Browse files Browse the repository at this point in the history
This patch provides PHP 8.1 support, via the following changes:

- Adds `~8.1.0` to the list of allowed PHP versions.
- Marks a conflict with symfony/console versions prior to 5.3.11 (first version supporting PHP 8.1)
- Replaces usage of `gmstrftime()` with a combination of casting timestamps to `DateTimeImmutable` objects with a GMT timezone, and using `IntlDateFormatter::formatObject()` with an equivalent date/time format to what was used with `gmstrftime()`.
- Adds `#[\ReturnTimeWillChange]` attributes to classes implementing `JsonSerialize` to ensure they remain both backwards and forwards compatible.

Signed-off-by: Matthew Weier O'Phinney <matthew@weierophinney.net>
  • Loading branch information
weierophinney committed Dec 1, 2021
1 parent 628721c commit 3f7b5bf
Show file tree
Hide file tree
Showing 12 changed files with 192 additions and 141 deletions.
5 changes: 4 additions & 1 deletion .laminas-ci.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
"extensions": [
"inotify",
"swoole"
]
],
"ignore_php_platform_requirements": {
"8.1": true
}
}
9 changes: 5 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"extra": {
},
"require": {
"php": "^7.4 || ~8.0.0",
"php": "^7.4 || ~8.0.0 || ~8.1.0",
"composer/package-versions-deprecated": "^1.11",
"dflydev/fig-cookies": "^2.0.1 || ^3.0",
"laminas/laminas-cli": "^0.1.5 || ^1.0",
Expand All @@ -48,7 +48,7 @@
"filp/whoops": "^2.1",
"laminas/laminas-coding-standard": "~2.2.0",
"laminas/laminas-servicemanager": "^3.3",
"phpunit/phpunit": "^9.3.10",
"phpunit/phpunit": "^9.5.5",
"psalm/plugin-phpunit": "^0.13.0",
"swoole/ide-helper": "^4.5.5",
"vimeo/psalm": "^4.0"
Expand Down Expand Up @@ -79,7 +79,8 @@
"test": "phpunit --colors=always",
"test-coverage": "phpunit --colors=always --coverage-clover clover.xml"
},
"replace": {
"zendframework/zend-expressive-swoole": "^2.5.0"
"conflict": {
"symfony/console": "<5.3.11",
"zendframework/zend-expressive-swoole": "*"
}
}
Loading

0 comments on commit 3f7b5bf

Please sign in to comment.