first commit
This commit is contained in:
11
vendor/psr/clock/CHANGELOG.md
vendored
Normal file
11
vendor/psr/clock/CHANGELOG.md
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file, in reverse chronological order by release.
|
||||
|
||||
## 1.0.0
|
||||
|
||||
First stable release after PSR-20 acceptance
|
||||
|
||||
## 0.1.0
|
||||
|
||||
First release
|
19
vendor/psr/clock/LICENSE
vendored
Normal file
19
vendor/psr/clock/LICENSE
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2017 PHP Framework Interoperability Group
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
61
vendor/psr/clock/README.md
vendored
Normal file
61
vendor/psr/clock/README.md
vendored
Normal file
@ -0,0 +1,61 @@
|
||||
# PSR Clock
|
||||
|
||||
This repository holds the interface for [PSR-20][psr-url].
|
||||
|
||||
Note that this is not a clock of its own. It is merely an interface that
|
||||
describes a clock. See the specification for more details.
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
composer require psr/clock
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
If you need a clock, you can use the interface like this:
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
use Psr\Clock\ClockInterface;
|
||||
|
||||
class Foo
|
||||
{
|
||||
private ClockInterface $clock;
|
||||
|
||||
public function __construct(ClockInterface $clock)
|
||||
{
|
||||
$this->clock = $clock;
|
||||
}
|
||||
|
||||
public function doSomething()
|
||||
{
|
||||
/** @var DateTimeImmutable $currentDateAndTime */
|
||||
$currentDateAndTime = $this->clock->now();
|
||||
// do something useful with that information
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
You can then pick one of the [implementations][implementation-url] of the interface to get a clock.
|
||||
|
||||
If you want to implement the interface, you can require this package and
|
||||
implement `Psr\Clock\ClockInterface` in your code.
|
||||
|
||||
Don't forget to add `psr/clock-implementation` to your `composer.json`s `provides`-section like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"provides": {
|
||||
"psr/clock-implementation": "1.0"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
And please read the [specification text][specification-url] for details on the interface.
|
||||
|
||||
[psr-url]: https://www.php-fig.org/psr/psr-20
|
||||
[package-url]: https://packagist.org/packages/psr/clock
|
||||
[implementation-url]: https://packagist.org/providers/psr/clock-implementation
|
||||
[specification-url]: https://github.com/php-fig/fig-standards/blob/master/proposed/clock.md
|
21
vendor/psr/clock/composer.json
vendored
Normal file
21
vendor/psr/clock/composer.json
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "psr/clock",
|
||||
"description": "Common interface for reading the clock.",
|
||||
"keywords": ["psr", "psr-20", "time", "clock", "now"],
|
||||
"homepage": "https://github.com/php-fig/clock",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "PHP-FIG",
|
||||
"homepage": "https://www.php-fig.org/"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.0 || ^8.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Psr\\Clock\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
13
vendor/psr/clock/src/ClockInterface.php
vendored
Normal file
13
vendor/psr/clock/src/ClockInterface.php
vendored
Normal file
@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Psr\Clock;
|
||||
|
||||
use DateTimeImmutable;
|
||||
|
||||
interface ClockInterface
|
||||
{
|
||||
/**
|
||||
* Returns the current time as a DateTimeImmutable Object
|
||||
*/
|
||||
public function now(): DateTimeImmutable;
|
||||
}
|
Reference in New Issue
Block a user