mtdowling / cron-expression

CRON for PHP: Calculate the next or previous run date and determine if a CRON expression is due
http://mtdowling.com/blog/2012/06/03/cron-expressions-in-php/
MIT License
4.9k stars 335 forks source link

Invalid CRON field value 1/2 at position 2 #181

Open 4meck opened 3 years ago

4meck commented 3 years ago

dragonmantank\cron-expression (v3.1.0)

$expr = '0 0 1/2 '; $cron = \Cron\CronExpression::factory($expr); echo $cron->getNextRunDate()->format('Y-m-d H:i:s');

InvalidArgumentException in C:\vendor\dragonmantank\cron-expression\src\Cron\CronExpression.phpat line 158 Invalid CRON field value 1/2 at position 2

mtdowling/cron-expression (v. 1.2.3) execute this code correct (w/o Exception)

dragonmantank commented 3 years ago

Hello! Could you please post this PR against dragonmantank/cron-expression, this version of the library is no longer maintained.

Thanks!