mirror of
https://github.com/beste/clock.git
synced 2026-10-17 19:27:35 +00:00
Update README
This commit is contained in:
@@ -114,8 +114,8 @@ printf("\nAfter turning back the clock 5 minutes, it's %s", $frozenClock->now()-
|
|||||||
|
|
||||||
### `MinuteClock`
|
### `MinuteClock`
|
||||||
|
|
||||||
In some cases, microseconds, milliseconds, or even seconds are too precise for some use cases - sometimes it's just
|
In some cases, microseconds, milliseconds, or even seconds are too precise. Sometimes it is enough to know that
|
||||||
enough if something happened in the same minute. Using the minute
|
something happened within the same minute. `MinuteClock` removes seconds and fractions of a second from another clock.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
# examples/minute_clock.php
|
# examples/minute_clock.php
|
||||||
@@ -141,10 +141,8 @@ printf("For %s, the minute clock still returns %s\n",
|
|||||||
|
|
||||||
### `WrappingClock`
|
### `WrappingClock`
|
||||||
|
|
||||||
If you already have an object with a `now()` method returning a `DateTimeImmutable` object, you can wrap it
|
If you already have an object with a `now()` method returning a `DateTimeImmutable`, you can wrap it in a
|
||||||
in a `WrappingClock` to make it a "real" Clock.
|
`WrappingClock` to make it a PSR-20 clock.
|
||||||
|
|
||||||
as a "real" clock.
|
|
||||||
|
|
||||||
```php
|
```php
|
||||||
# examples/wrapping_clock.php
|
# examples/wrapping_clock.php
|
||||||
|
|||||||
Reference in New Issue
Block a user