moodle/lib/psr
Andrew Nicols 298c13ac3b
MDL-80838 core: Add PSR-20/Clock support
This commit adds the PSR-20 ClockInterface to core, with a
moodle-specific extension to the Interface at `\core\clock`, and a
standard clock at `\core\system_clock`.

Further clocks are provided as `\incrementing_clock` and `\frozen_clock`
which are available to unit tests using:

- `$this->mock_clock_with_incrementing(?int $starttime = null);`
- `$this->mock_clock_with_frozen(?int $time = null);`

For the incrementing clock, every call to fetch the time will bump the
current time by one second.

For the frozen clock the time will not change, but can be modified with:
- `$clock->set_to(int $time);`; and
- `$clock->bump(int $seconds = 1);`
2024-04-02 10:24:54 +08:00
..
clock MDL-80838 core: Add PSR-20/Clock support 2024-04-02 10:24:54 +08:00
container MDL-80072 core: Add PSR-11 interfaces 2024-02-09 15:03:57 +08:00
event-dispatcher
http-client
http-factory
http-message