Remove deprecated Clock interface

This commit is contained in:
Jérôme Gamez
2026-08-22 23:24:55 +02:00
parent 9818902960
commit 0a55b7a019
9 changed files with 14 additions and 32 deletions
+4 -1
View File
@@ -2,9 +2,12 @@
## Unreleased ## Unreleased
Removed the deprecated `Beste\Clock` interface. Clock implementations now implement
`Psr\Clock\ClockInterface` directly.
## 3.1.0 - 2026-08-22 ## 3.1.0 - 2026-08-22
Deprecates `Beste\Clock` in favor of `Psr\Clock\ClockInterface`. The implementations continue to implement Deprecated `Beste\Clock` in favor of `Psr\Clock\ClockInterface`. The implementations continue to implement
the deprecated interface for backwards compatibility. Please type against `Psr\Clock\ClockInterface`. the deprecated interface for backwards compatibility. Please type against `Psr\Clock\ClockInterface`.
`Beste\Clock` will be removed in 4.0. `Beste\Clock` will be removed in 4.0.
+1 -4
View File
@@ -24,10 +24,7 @@
"autoload": { "autoload": {
"psr-4": { "psr-4": {
"Beste\\Clock\\": "src/Clock" "Beste\\Clock\\": "src/Clock"
}, }
"files": [
"src/Clock.php"
]
}, },
"autoload-dev": { "autoload-dev": {
"psr-4": { "psr-4": {
-15
View File
@@ -1,15 +0,0 @@
<?php
declare(strict_types=1);
namespace Beste;
use Psr\Clock\ClockInterface;
/**
* @deprecated since 3.1.0, use {@see ClockInterface} instead.
*/
interface Clock extends ClockInterface
{
}
+1 -2
View File
@@ -4,12 +4,11 @@ declare(strict_types=1);
namespace Beste\Clock; namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable; use DateTimeImmutable;
use DateTimeZone; use DateTimeZone;
use Psr\Clock\ClockInterface; use Psr\Clock\ClockInterface;
final class FrozenClock implements Clock final class FrozenClock implements ClockInterface
{ {
private DateTimeImmutable $frozenAt; private DateTimeImmutable $frozenAt;
+2 -2
View File
@@ -4,13 +4,13 @@ declare(strict_types=1);
namespace Beste\Clock; namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable; use DateTimeImmutable;
use DateTimeZone; use DateTimeZone;
use InvalidArgumentException; use InvalidArgumentException;
use Psr\Clock\ClockInterface;
use Throwable; use Throwable;
final class LocalizedClock implements Clock final class LocalizedClock implements ClockInterface
{ {
private DateTimeZone $timeZone; private DateTimeZone $timeZone;
+1 -2
View File
@@ -4,11 +4,10 @@ declare(strict_types=1);
namespace Beste\Clock; namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable; use DateTimeImmutable;
use Psr\Clock\ClockInterface; use Psr\Clock\ClockInterface;
final class MinuteClock implements Clock final class MinuteClock implements ClockInterface
{ {
private ClockInterface $clock; private ClockInterface $clock;
+2 -2
View File
@@ -4,10 +4,10 @@ declare(strict_types=1);
namespace Beste\Clock; namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable; use DateTimeImmutable;
use Psr\Clock\ClockInterface;
final class SystemClock implements Clock final class SystemClock implements ClockInterface
{ {
private function __construct() private function __construct()
{ {
+2 -2
View File
@@ -4,11 +4,11 @@ declare(strict_types=1);
namespace Beste\Clock; namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable; use DateTimeImmutable;
use DateTimeZone; use DateTimeZone;
use Psr\Clock\ClockInterface;
final class UTCClock implements Clock final class UTCClock implements ClockInterface
{ {
private DateTimeZone $timeZone; private DateTimeZone $timeZone;
+1 -2
View File
@@ -4,12 +4,11 @@ declare(strict_types=1);
namespace Beste\Clock; namespace Beste\Clock;
use Beste\Clock;
use DateTimeImmutable; use DateTimeImmutable;
use InvalidArgumentException; use InvalidArgumentException;
use Psr\Clock\ClockInterface; use Psr\Clock\ClockInterface;
final class WrappingClock implements Clock final class WrappingClock implements ClockInterface
{ {
private ClockInterface $wrappedClock; private ClockInterface $wrappedClock;