Skip to content

Commit ff21357

Browse files
[Clock] Implement PSR-20
1 parent bc5fea4 commit ff21357

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

composer.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"php-http/async-client-implementation": "*",
2020
"php-http/client-implementation": "*",
2121
"psr/cache-implementation": "2.0|3.0",
22+
"psr/clock-implementation": "1.0",
2223
"psr/container-implementation": "1.1|2.0",
2324
"psr/event-dispatcher-implementation": "1.0",
2425
"psr/http-client-implementation": "1.0",
@@ -40,6 +41,7 @@
4041
"doctrine/persistence": "^2|^3",
4142
"twig/twig": "^2.13|^3.0.4",
4243
"psr/cache": "^2.0|^3.0",
44+
"psr/clock": "^1.0",
4345
"psr/container": "^1.1|^2.0",
4446
"psr/event-dispatcher": "^1.0",
4547
"psr/link": "^1.1|^2.0",

src/Symfony/Component/Clock/ClockInterface.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,13 @@
1111

1212
namespace Symfony\Component\Clock;
1313

14+
use Psr\Clock\ClockInterface as PsrClockInterface;
15+
1416
/**
1517
* @author Nicolas Grekas <p@tchwork.com>
1618
*/
17-
interface ClockInterface
19+
interface ClockInterface extends PsrClockInterface
1820
{
19-
public function now(): \DateTimeImmutable;
20-
2121
public function sleep(float|int $seconds): void;
2222

2323
public function withTimeZone(\DateTimeZone|string $timezone): static;

src/Symfony/Component/Clock/composer.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515
"homepage": "https://symfony.com/contributors"
1616
}
1717
],
18+
"provide": {
19+
"psr/clock-implementation": "1.0"
20+
},
1821
"require": {
19-
"php": ">=8.1"
22+
"php": ">=8.1",
23+
"psr/clock": "^1.0"
2024
},
2125
"autoload": {
2226
"psr-4": { "Symfony\\Component\\Clock\\": "" },

0 commit comments

Comments
 (0)