arnapou/psr-clock 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

arnapou/psr-clock

最新稳定版本:v1.2.0

Composer 安装命令:

composer require arnapou/psr-clock

包简介

Library - PSR-20.

README 文档

README

pipeline coverage

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

DateRef8.58.48.38.2
25/10/20251.2.x, main×××
24/11/20241.1.x×××
09/09/20241.0.x××

统计信息

  • 总下载量: 519
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 3
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-09-09