2017 © Pedro PelĂĄez
 

library clock

Provides a simple abstraction of a clock.

image

localheinz/clock

Provides a simple abstraction of a clock.

  • Tuesday, June 26, 2018
  • by localheinz
  • Repository
  • 1 Watchers
  • 1 Stars
  • 133 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 533 % Grown

The README.md

[WIP] PSR Clock

Work in Progress!

This repository holds the interface for PSR-20., (*1)

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., (*2)

CAVEAT: This is currently Work in Progress!, (*3)

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

Using this as long as the PSR is not officially released happens at your own risk!, (*5)

Installation

composer require psr/clock

Usage

If you need a clock, you can use the interface like this:, (*6)

<?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., (*7)

If you want to implement the interface, you can require this package and implement Psr\Clock\ClockInterface in your code., (*8)

Don't forget to add psr/clock-implementation to your composer.jsons provides-section like this:, (*9)

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

And please read the specification text for details on the interface., (*10)

The Versions

26/06 2018

dev-master

9999999-dev https://github.com/localheinz/clock

Provides a simple abstraction of a clock.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

clock system-clock test-clock

31/01 2018

dev-feature/reference

dev-feature/reference https://github.com/localheinz/clock

Provides a simple abstraction of a clock.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

clock system-clock test-clock

31/01 2018

1.0.0

1.0.0.0 https://github.com/localheinz/clock

Provides a simple abstraction of a clock.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

clock system-clock test-clock

31/01 2018

dev-feature/keywords

dev-feature/keywords https://github.com/localheinz/clock

Provides a simple abstraction of a clock.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

clock system-clock test-clock

31/01 2018

dev-feature/frozen-clock

dev-feature/frozen-clock https://github.com/localheinz/clock

Provides a simple abstraction of a clock.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller

31/01 2018

dev-feature/system-clock

dev-feature/system-clock https://github.com/localheinz/clock

Provides a simple abstraction of a clock.

  Sources   Download

MIT

The Requires

  • php ^7.0

 

The Development Requires

by Andreas Möller