-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f728649
commit 52f771a
Showing
7 changed files
with
37 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace MatthewDavis\Duration; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,34 @@ | ||
<?php | ||
declare(strict_types=1); | ||
|
||
declare(strict_types = 1); | ||
|
||
namespace MatthewDavis\Duration; | ||
|
||
interface DurationInterface | ||
{ | ||
const SECONDS_IN_MINUTE = 60; | ||
const SECONDS_IN_HOUR = 60 * self::SECONDS_IN_MINUTE; | ||
const SECONDS_IN_DAY = 24 * self::SECONDS_IN_HOUR; | ||
const SECONDS_IN_WEEK = 7 * self::SECONDS_IN_DAY; | ||
|
||
public static function second(): DurationInterface; | ||
|
||
public static function seconds(int $seconds): DurationInterface; | ||
|
||
public static function minute(): DurationInterface; | ||
|
||
public static function minutes(int $minutes): DurationInterface; | ||
const SECONDS_IN_HOUR = 60 * self::SECONDS_IN_MINUTE; | ||
const SECONDS_IN_DAY = 24 * self::SECONDS_IN_HOUR; | ||
const SECONDS_IN_WEEK = 7 * self::SECONDS_IN_DAY; | ||
|
||
public static function hour(): DurationInterface; | ||
public static function second(): self; | ||
public static function seconds(int $seconds): self; | ||
|
||
public static function hours(int $hours): DurationInterface; | ||
public static function minute(): self; | ||
public static function minutes(int $minutes): self; | ||
|
||
public static function day(): DurationInterface; | ||
public static function hour(): self; | ||
public static function hours(int $hours): self; | ||
|
||
public static function days(int $days): DurationInterface; | ||
public static function day(): self; | ||
public static function days(int $days): self; | ||
|
||
public static function week(): DurationInterface; | ||
|
||
public static function weeks(int $weeks): DurationInterface; | ||
public static function week(): self; | ||
public static function weeks(int $weeks): self; | ||
|
||
public function inSeconds(): int; | ||
|
||
public function inMinutes(): float; | ||
|
||
public function inHours(): float; | ||
|
||
public function inDays(): float; | ||
|
||
public function inWeeks(): float; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters