diff --git a/composer.json b/composer.json index eda77e963e5ef..782d739047416 100644 --- a/composer.json +++ b/composer.json @@ -19,6 +19,7 @@ "php-http/async-client-implementation": "*", "php-http/client-implementation": "*", "psr/cache-implementation": "2.0|3.0", + "psr/clock-implementation": "1.0", "psr/container-implementation": "1.1|2.0", "psr/event-dispatcher-implementation": "1.0", "psr/http-client-implementation": "1.0", @@ -40,6 +41,7 @@ "doctrine/persistence": "^2|^3", "twig/twig": "^2.13|^3.0.4", "psr/cache": "^2.0|^3.0", + "psr/clock": "^1.0", "psr/container": "^1.1|^2.0", "psr/event-dispatcher": "^1.0", "psr/link": "^1.1|^2.0", diff --git a/src/Symfony/Component/Clock/ClockInterface.php b/src/Symfony/Component/Clock/ClockInterface.php index af502a14ed6eb..435775a8f05d3 100644 --- a/src/Symfony/Component/Clock/ClockInterface.php +++ b/src/Symfony/Component/Clock/ClockInterface.php @@ -11,13 +11,13 @@ namespace Symfony\Component\Clock; +use Psr\Clock\ClockInterface as PsrClockInterface; + /** * @author Nicolas Grekas
*/ -interface ClockInterface +interface ClockInterface extends PsrClockInterface { - public function now(): \DateTimeImmutable; - public function sleep(float|int $seconds): void; public function withTimeZone(\DateTimeZone|string $timezone): static; diff --git a/src/Symfony/Component/Clock/composer.json b/src/Symfony/Component/Clock/composer.json index 897d57f4b307a..2ff68a82227fb 100644 --- a/src/Symfony/Component/Clock/composer.json +++ b/src/Symfony/Component/Clock/composer.json @@ -15,8 +15,12 @@ "homepage": "https://symfony.com/contributors" } ], + "provide": { + "psr/clock-implementation": "1.0" + }, "require": { - "php": ">=8.1" + "php": ">=8.1", + "psr/clock": "^1.0" }, "autoload": { "psr-4": { "Symfony\\Component\\Clock\\": "" },