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);`
This commit will import the Guzzle library in
core. The imported libraries will be used in
the next commits to create an api for the http
client to be used in relevant locations.
Co-Authored-By: Andrew Nicols <andrew@nicols.co.uk>
Co-Authored-By: Safat Shahin <safat.shahin@moodle.com>