-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
628721c
commit 797dbcd
Showing
11 changed files
with
188 additions
and
140 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd" bootstrap="test/bootstrap.php" colors="true"> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="mezzio-swoole"> | ||
<directory>./test</directory> | ||
</testsuite> | ||
</testsuites> | ||
<phpunit | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" | ||
bootstrap="test/bootstrap.php" | ||
convertDeprecationsToExceptions="true" | ||
colors="true"> | ||
<coverage processUncoveredFiles="true"> | ||
<include> | ||
<directory suffix=".php">./src</directory> | ||
</include> | ||
</coverage> | ||
|
||
<testsuites> | ||
<testsuite name="mezzio-swoole"> | ||
<directory>./test</directory> | ||
</testsuite> | ||
</testsuites> | ||
</phpunit> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace MezzioTest\Swoole; | ||
|
||
use DateTimeImmutable; | ||
use DateTimeZone; | ||
use IntlDateFormatter; | ||
|
||
trait FormatTimestampTrait | ||
{ | ||
public function formatTimestamp(int $timestamp): string | ||
{ | ||
$dateTime = new DateTimeImmutable('@' . $timestamp, new DateTimeZone('GMT')); | ||
return IntlDateFormatter::formatObject( | ||
$dateTime, | ||
'EEEE dd-MMM-yy HH:mm:ss z' | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters