2222class Seconds
2323{
2424 public const MINUTE = 60 ;
25+
2526 public const HOUR = 3600 ;
27+
2628 public const DAY = 86400 ;
29+
2730 public const WEEK = 604800 ;
31+
2832 public const MONTH = 2628288 ; // 30.42 days
33+
2934 public const YEAR = 31556736 ; // 365.24 days
3035
3136 /**
@@ -39,7 +44,7 @@ public static function __callStatic(string $method, array $parameters): int
3944 return static ::getConstantFromMethodName ($ method );
4045 }
4146
42- if (!isset ($ parameters [0 ]) || !is_int ($ parameters [0 ])) {
47+ if (! isset ($ parameters [0 ]) || ! is_int ($ parameters [0 ])) {
4348 throw new InvalidArgumentException (
4449 sprintf (
4550 '%s::%s(int $%s) expects an integer. ' ,
@@ -58,7 +63,7 @@ public static function __callStatic(string $method, array $parameters): int
5863 */
5964 protected static function isSingular (string $ method ): bool
6065 {
61- return !preg_match ('/s$/ ' , $ method );
66+ return ! preg_match ('/s$/ ' , $ method );
6267 }
6368
6469 /**
@@ -72,7 +77,7 @@ protected static function getConstantFromMethodName(string $method): int
7277 $ constant = preg_replace ('/s$/ ' , '' , $ constant );
7378 $ constant = strtoupper ($ constant );
7479
75- if (!defined ("static:: {$ constant }" )) {
80+ if (! defined ("static:: {$ constant }" )) {
7681 throw new BadMethodCallException (
7782 sprintf ('%s::%s() does not exist. ' , static ::class, $ method )
7883 );
0 commit comments