5 Commits
Author SHA1 Message Date
Jérôme Gamez 2ba952cc73 Release 2.3.0 2022-11-25 19:02:11 +01:00
Jérôme Gamez 2861280adc Re-introduce support for PHP ^8.0 (instead of only 8.1.x and 8.2.x) 2022-11-25 19:02:11 +01:00
Jérôme Gamez a5e62affe0 Switch to the now released psr/clock-interface 2022-11-25 18:08:55 +01:00
github-actions[bot] 5acec1192d Merge pull request #4 from beste/dependabot/github_actions/ramsey/composer-install-2
github-actions(deps): bump ramsey/composer-install from 1 to 2
2022-11-17 18:20:41 +00:00
dependabot[bot] fd2e55f899 github-actions(deps): bump ramsey/composer-install from 1 to 2
Bumps [ramsey/composer-install](https://github.com/ramsey/composer-install) from 1 to 2.
- [Release notes](https://github.com/ramsey/composer-install/releases)
- [Commits](https://github.com/ramsey/composer-install/compare/v1...v2)

---
updated-dependencies:
- dependency-name: ramsey/composer-install
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-17 18:20:16 +00:00
9 changed files with 18 additions and 19 deletions
+2 -7
View File
@@ -15,11 +15,9 @@ jobs:
strategy:
matrix:
php:
- "8.0"
- "8.1"
- "8.2"
dependencies:
- "lowest"
- "highest"
steps:
- name: Checkout code
@@ -33,10 +31,7 @@ jobs:
env:
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: "ramsey/composer-install@v1"
with:
dependency-versions: "${{ matrix.dependencies }}"
composer-options: "${{ matrix.composer-options }}"
- uses: "ramsey/composer-install@v2"
- name: Setup problem matchers for PHP
run: echo "::add-matcher::${{ runner.tool_cache }}/php.json"
+3
View File
@@ -1,5 +1,8 @@
# CHANGELOG
## 2.3.0 - 2022-11-25
This release re-introduces support for PHP ^8.0 and implements the freshly released `psr/clock` (PSR-20) directly.
## 2.2.0 - 2022-11-04
This release drops support for PHP <8.1.
+2 -2
View File
@@ -11,8 +11,8 @@
}
],
"require": {
"php": "~8.1.0 || ~8.2.0",
"stella-maris/clock": "^0.1.6"
"php": "^8.0",
"psr/clock": "^1.0"
},
"require-dev": {
"phpstan/extension-installer": "^1.2",
+1 -1
View File
@@ -4,7 +4,7 @@ declare(strict_types=1);
namespace Beste;
use StellaMaris\Clock\ClockInterface;
use Psr\Clock\ClockInterface;
interface Clock extends ClockInterface
{
+1 -1
View File
@@ -7,7 +7,7 @@ namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable;
use DateTimeZone;
use StellaMaris\Clock\ClockInterface;
use Psr\Clock\ClockInterface;
final class FrozenClock implements Clock
{
+1 -1
View File
@@ -6,7 +6,7 @@ namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable;
use StellaMaris\Clock\ClockInterface;
use Psr\Clock\ClockInterface;
final class MinuteClock implements Clock
{
+6 -5
View File
@@ -6,7 +6,8 @@ namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable;
use StellaMaris\Clock\ClockInterface;
use InvalidArgumentException;
use Psr\Clock\ClockInterface;
final class WrappingClock implements Clock
{
@@ -24,11 +25,11 @@ final class WrappingClock implements Clock
}
if (!method_exists($clock, 'now')) {
throw new \InvalidArgumentException('$clock must implement StellaMaris\Clock\ClockInterface or have a now() method');
throw new InvalidArgumentException('$clock must implement '.ClockInterface::class.' or have a now() method');
}
if (!($clock->now() instanceof DateTimeImmutable)) {
throw new \InvalidArgumentException('$clock->now() must return a DateTimeImmutable');
throw new InvalidArgumentException('$clock->now() must return a DateTimeImmutable');
}
$wrappedClock = new class($clock) implements ClockInterface {
@@ -39,13 +40,13 @@ final class WrappingClock implements Clock
$this->clock = $clock;
}
public function now(): \DateTimeImmutable
public function now(): DateTimeImmutable
{
assert(method_exists($this->clock, 'now'));
$now = $this->clock->now();
assert($now instanceof \DateTimeImmutable);
assert($now instanceof DateTimeImmutable);
return $now;
}
+1 -1
View File
@@ -7,7 +7,7 @@ namespace Beste\Clock\Tests;
use Beste\Clock\FrozenClock;
use DateTimeImmutable;
use PHPUnit\Framework\TestCase;
use StellaMaris\Clock\ClockInterface;
use Psr\Clock\ClockInterface;
/**
* @internal
+1 -1
View File
@@ -7,7 +7,7 @@ namespace Beste\Clock\Tests;
use Beste\Clock\MinuteClock;
use DateTimeImmutable;
use PHPUnit\Framework\TestCase;
use StellaMaris\Clock\ClockInterface;
use Psr\Clock\ClockInterface;
/**
* @internal