arnapou/psr-clock
最新稳定版本:v1.2.0
Composer 安装命令:
composer require arnapou/psr-clock
包简介
Library - PSR-20.
README 文档
README
KISS (Keep It Simple Stupid) PSR (PHP Standards Recommendations) classes.
Installation
composer require arnapou/psr-clock
packagist 👉️ arnapou/psr-clock
When it is worth to use this library
- you need simple decorators, proxies, adapters, ... about PSR's
- you need simple implementations covering the basics
Example PSR-20 Clock Interface
One of the most simple PSR, but very powerful.
This repo uses this clock interface in loggers and caches.
It helps a lot for testing for example.
// Basic clock with date and timezone
$clock = new \Arnapou\Psr\Psr20Clock\NowClock();
echo $clock->now()->format('Y-m-d H:i:s') . "\n";
// This clock will always have the same "time".
$clock = \Arnapou\Psr\Psr20Clock\FixedClock::createFromTimestamp(time());
echo $clock->now()->format('Y-m-d H:i:s') . "\n";
Php versions
| Date | Ref | 8.5 | 8.4 | 8.3 | 8.2 |
|---|---|---|---|---|---|
| 25/10/2025 | 1.2.x, main | × | × | × | |
| 24/11/2024 | 1.1.x | × | × | × | |
| 09/09/2024 | 1.0.x | × | × |
统计信息
- 总下载量: 519
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-09-09