Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

list not supported by separate fields #124

Closed
holtkamp opened this issue Sep 21, 2021 · 2 comments
Closed

list not supported by separate fields #124

holtkamp opened this issue Sep 21, 2021 · 2 comments

Comments

@holtkamp
Copy link

holtkamp commented Sep 21, 2021

When using the public functions of separate Cron fields (like MinutesField, HoursField, DayOfWeekField, etc), it seems "lists" are not respected / supported

For example:

$weekdayField = new DayOfWeekField();
var_dump($weekdayField->isSatisfied(5, '5,6')); //Returns TRUE
var_dump($weekdayField->isSatisfied(6, '5,6')); //Returns FALSE while TRUE is expected

It seems that support for lists is implemented as part of CronExpression::getRunDate() which is part of using CronExpression::isDue() and thereby CronExpression::getNextRunDate().

Maybe this is on purpose, it might be good to document then? And maybe functions like "isSatisfied" and "isSatisfiedBy" need to be marked as @internal?

Or even better: add support for lists at "field" level...

@dragonmantank
Copy link
Owner

Yeah, I think ultimately this would be better marked as @internal. There be all sorts of weird stuff going on in there (which is actually an impetus for the upcoming v4 rewrite, there's a lot of weird code that isn't shared across various checks). I'll update master here in a moment, and close this once I push out an official release for it.

I would figure out a way to make it work, but a ton of code is getting refactored and the whole validate/should-I-run stuff is rewritten.

@dragonmantank
Copy link
Owner

This should be fixed with v3.2.2

@holtkamp holtkamp changed the title list not supported of separate fields list not supported by separate fields Jan 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants