diff --git a/README.md b/README.md index 49c31a3..deae5cb 100644 --- a/README.md +++ b/README.md @@ -11,11 +11,11 @@ Parse cron expressions and match them against time. ```json { "require": { - "heartsentwined/cron-expr-parser": "dev-master" + "heartsentwined/cron-expr-parser": "1.*" } } ``` # Usage -todo +Parse in a Cron expression and a time, and determine if the given time falls within the given cron expression diff --git a/src/Heartsentwined/CronExprParser/Parser.php b/src/Heartsentwined/CronExprParser/Parser.php index a49c730..1d18b2d 100644 --- a/src/Heartsentwined/CronExprParser/Parser.php +++ b/src/Heartsentwined/CronExprParser/Parser.php @@ -9,7 +9,9 @@ class Parser /** * determine whether a given time falls within the given cron expr * - * @param string $frequency + * @param string|numeric $time + * timestamp or strtotime()-compatible string + * @param string $expr * any valid cron expression, in addition supporting: * range: '0-5' * range + interval: '10-59/5' @@ -27,14 +29,12 @@ class Parser * every day between day 2-10 and day 15-25 * every 2nd month between January-June * Monday-Friday - * @param string|int $time - * timestamp or strtotime()-compatible string * @throws Exception\InvalidArgumentException on invalid cron expression * @return bool */ public static function matchTime($time, $expr) { - ArgValidator::assert($time, array('string', 'int')); + ArgValidator::assert($time, array('string', 'numeric')); ArgValidator::assert($expr, 'string'); $cronExpr = preg_split('/\s+/', $expr, null, PREG_SPLIT_NO_EMPTY);