承接 psr/clock 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

psr/clock

最新稳定版本:1.0.0

Composer 安装命令:

composer require psr/clock

包简介

Common interface for reading the clock.

README 文档

README

This repository holds the interface for PSR-20.

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

composer require psr/clock

Usage

If you need a clock, you can use the interface like this:

<?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 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.jsons provide-section like this:

{
  "provide": {
    "psr/clock-implementation": "1.0"
  }
}

And please read the specification text for details on the interface.

统计信息

  • 总下载量: 298.41M
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 623
  • 点击次数: 3
  • 依赖项目数: 289
  • 推荐数: 1

GitHub 信息

  • Stars: 622
  • Watchers: 10
  • Forks: 5
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固