Skip to content

'Timer' is a class to help build time interval value in seconds by object-oriented style

License

Notifications You must be signed in to change notification settings

manchenkoff/timer-helper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Timer

Latest Stable Version Total Downloads License PHP Version Require

Timer is a class to help build time interval value in seconds by object-oriented style

Installation

You have to run following command to add a dependency to your project

composer require manchenkov/timer

or you can add this line to require section of composer.json

"manchenkov/timer": "*"

Usage

use Manchenkov\Timer\Timer;

$timer = Timer::get()->hours(5)->minutes(10)->seconds(34);

$intervalValue = $timer->asNumber(); // <int> -> 18634 = 34 + (10 * 60) + (5 * 3600)

$intervalString = $timer->asString(); // <string> -> 05:10:34
// or
$intervalString = (string)$timer; // <string> -> 05:10:34

Testing

To run test cases you should execute the following command

./vendor/bin/phpunit tests --testdox

About

'Timer' is a class to help build time interval value in seconds by object-oriented style

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages