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 4, 2024 via composer

lcobucci/clock 3.2.0

Yet another clock abstraction
Package summary
Share
0
issues
1
license
2
MIT
Package created
7 May 2017
Version published
17 Nov 2023
Maintainers
1
Total deps
2
Direct deps
1
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
2 Packages, Including:
lcobucci/clock@3.2.0
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

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

Visualizations

Frequently Asked Questions

What does lcobucci/clock do?

The lcobucci/clock package is essentially a clock abstraction. Its purpose is to decouple projects from the DateTimeImmutable instantiation method, thereby facilitating the testing process. This package can return the current system time based on a specific timezone, or it can return a fixed time (for testing) when using the FrozenClock function.

How do you use lcobucci/clock?

The lcobucci/clock package can be installed and used easily. To install this PHP composer package, you can use the following command in your terminal:

composer require lcobucci/clock

Usage examples show how this package can be incorporated into your code to retrieve the current time or a specific time. For example:

// import the Lcobucci\Clock namespace
use Lcobucci\Clock\SystemClock;
use Lcobucci\Clock\FrozenClock;

// Create an object that will return the current time based on the given timezone
$clock = new SystemClock(new DateTimeZone('America/Sao_Paulo'));

// Test object that always returns a fixed time object
$clock = new FrozenClock(new DateTimeImmutable('2017-05-07 18:49:30'));

// Or creating a frozen clock from the current time on UTC (uncomment to use)
// $clock = FrozenClock::fromUTC();

Where are the lcobucci/clock docs?

The lcobucci/clock package does not have a specific documentation page, but you can find further guidance on how to use it on the official GitHub page. There, you can view code examples and general package information that explain the purpose and functions of the lcobucci/clock package in detail. You can also find official digital badges that provide information about the build status, code coverage, and version details of this Composer package.