Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 23, 2024 via composer

psr/clock 1.0.0

Common interface for reading the clock.
Package summary
Share
0
issues
1
license
1
MIT
Package created
25 Nov 2022
Version published
25 Nov 2022
Maintainers
2
Total deps
1
Direct deps
0
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
psr/clock@1.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

0
All Dependencies CSV
β“˜ This is a list of psr/clock 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities

Visualizations

Frequently Asked Questions

What does psr/clock do?

The "psr/clock" is a composer package that provides a common interface for reading the clock in PHP. It's important to understand that psr/clock is not a clock on its own, but rather an interface that describes one. The purpose of this package is to provide a standard across PHP development for handling time and events that are based on a certain timeframe.

How do you use psr/clock?

To use psr/clock, you would first need to install it using the composer command: composer require psr/clock. Once installed, you can make use of it by implementing the Psr\Clock\ClockInterface into your class and use the now method to get the current date and time. Here is an example code snippet shows how it could be utilized:

<?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(); // fetches the current date and time
        // do something useful with that information
    }
}

Note, to create an implementation for the clock, you should add psr/clock-implementation to your composer.jsons provides-section to indicate that your code fulfills this functionality.

Where are the psr/clock docs?

The primary source of documentation for psr/clock is contained within the official GitHub repository available at https://github.com/php-fig/clock.git. In terms of more detailed implementation documentation, you'd want to check the specification text at https://github.com/php-fig/fig-standards/blob/master/proposed/clock.md. These sources should provide guidance on how to correctly integrate and use this composer package within your PHP development projects.

All Versions