zakharov / cron-validators
There is no license information available for the latest version (1.1.1) of this package.
cron time format validators
1.1.1
2023-03-11 09:01 UTC
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2024-12-11 12:46:01 UTC
README
Примеры
Проверка по частям:
(new \Zakharov\CronValidators\MinutesFieldValidator())->isValid('0-50/5');
(new \Zakharov\CronValidators\HoursFieldValidator())->isValid('*');
(new \Zakharov\CronValidators\DayOfMonthFieldValidator())->isValid('31');
(new \Zakharov\CronValidators\MonthFieldValidator())->isValid('JAN');
(new \Zakharov\CronValidators\DayOfWeekFieldValidator())->isValid('SUN');
Проверка выражений
(new \Zakharov\CronValidators\CronExpressionValidator())->isValid('* * * * *');
Проверка строки crontab
(new \Zakharov\CronValidators\LineValidator())->isValid('* * * * * echo 1 >> /logs/test.log');