[WIP] PSR-20 repository

Related tags

Miscellaneous clock
Overview

[WIP] PSR Clock

Work in Progress!

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.

CAVEAT: This is currently Work in Progress!

Do not (I repeat: Do NOT) rely on this interface being stable!

Using this as long as the PSR is not officially released happens at your own risk!

Installation

# Remember: This PSR is not yet proposed and 
# might change at any time 
# without prior notice
composer require psr/clock

Usage

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

<?php

/*
 * Remember: This PSR is not yet proposed and 
 * might change at any time 
 * without prior notice
 */
use Psr\Clock\ClockInterface;

class Foo
{
    private $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. Please read the specification text for details.

You might also like...
🙈 Code style configuration for `php-cs-fixer` based on PSR-12.

php-code-style Code style configuration for friendsofphp/php-cs-fixer based on PSR-12. Installation Step 1 of 3 Install gomzyakov/php-code-style via c

Simple yet powerful, PSR-compliant, Symfony-driven PHP Blog engine.
Simple yet powerful, PSR-compliant, Symfony-driven PHP Blog engine.

brodaty-blog ✒️ Simple Blog Engine based on pure Markdown files. 💕 Works without database, caches HTML templates from Markdown files. 🚀 Fast and ext

Port of the Java Content Repository (JCR) to PHP.

PHP Content Repository PHPCR This repository contains interfaces for the PHPCR standard. The JSR-283 specification defines an API for a Content Reposi

Your private self hosted composer repository with user management

Devliver Your private self-hosted composer repository. Requirements Docker MariaDB/MySQL the running docker container has access to private git reposi

This repository contains research materials and dev notes for the DSM research

DSM Research This repository contains a loosely-organized information regarding the processes of DSM loading. A lot of information present here was co

Repman - PHP Repository Manager: packagist proxy and host for private packages

Repman - PHP Repository Manager Repman is a PHP repository manager. Main features: free and open source works as a proxy for packagist.org (speeds up

Repository untuk kuliah rekayasa web ss 2021

About Laravel Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experie

This is the code repository for The Art of Modern PHP 8, published by Packt.
This is the code repository for The Art of Modern PHP 8, published by Packt.

The Art of Modern PHP 8 This is the code repository for The Art of Modern PHP 8, published by Packt. Your practical and essential guide to getting up

This repository includes direct links to Genshin Impact updates

GenshinRepository This repository includes direct links to Genshin Impact updates, with this, it allows you to download Genshin Impact updates without

Comments
  • Update Readme and composer.json

    Update Readme and composer.json

    This update adds a more descriptive text to the readme (borrowed from psr/log) and – most important at the current state – adds caveats throughout the README and the composer.json to make clear that this is currently Work in Progress and might change at any time without prior notice

    opened by heiglandreas 0
Releases(1.0.0)
Owner
PHP-FIG
PHP-FIG
A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package.

Net A small, modern, PSR-7 compatible PSR-17 and PSR-18 network library for PHP, inspired by Go's net package. Features: No hard dependencies; Favours

Minibase 16 Jun 7, 2022
Testing utilities for the psr/log package that backs the PSR-3 specification.

FIG - Log Test Testing utilities for the psr/log package that backs the PSR-3 specification. Psr\Log\Test\LoggerInterfaceTest provides a base test cla

PHP-FIG 3 Nov 19, 2022
🍪 bakes cookies for PSR-7 messages

?? bakes cookies for PSR-7 messages

Hans Ott 35 Jul 13, 2022
PHP транслит с русского на латиницу с поддержкой PSR

PHP PSR Transliterator По-русски Особенности Транслит с русского на латиницу; Поддержка ISO9 вариант Б (ГОСТ 7.79—2000); Поддержка ЧПУ; Полное покрыти

null 1 Nov 25, 2021
The Cache component provides an extended PSR-6 implementation for adding cache to your applications.

Symfony PSR-6 implementation for caching The Cache component provides an extended PSR-6 implementation for adding cache to your applications. It is de

Symfony 3.8k Jan 3, 2023
A simple implementation of the api-problem specification. Includes PSR-15 support.

ApiProblem This library provides a simple and straightforward implementation of the IETF Problem Details for HTTP APIs, RFC 7807. RFC 7807 is a simple

Larry Garfield 236 Dec 21, 2022
This is an implementation of PSR specification. It allows you to send and consume message with Redis store as a broker.

This is an implementation of PSR specification. It allows you to send and consume message with Redis store as a broker.

Enqueue 35 Nov 4, 2022
This package provides a set of factories to be used with containers using the PSR-11 standard for an easy Doctrine integration in a project

psr-container-doctrine: Doctrine Factories for PSR-11 Containers Doctrine factories for PSR-11 containers. This package provides a set of factories to

Roave, LLC 84 Dec 14, 2022
Error handler with PSR-7 support

Jasny Error Handler Error handler with PSR-7 support. Installation The Jasny Error Handler package is available on packagist. Install it using compose

Arnold Daniels 6 Jun 23, 2022
Pug Renderer - a (heavily based on the PhpRenderer) renderer for rendering Pug view scripts into a PSR-7 Response object

Pug Renderer This is a (heavily based on the PhpRenderer) renderer for rendering Pug view scripts into a PSR-7 Response object. It works well with Sli

Marcello Duarte 6 Oct 27, 2020