crazy-goat/workerman-bundle
Symfony bundle integrating Workerman to run a high-performance async HTTP server, scheduler and supervisor in pure PHP. Keeps the Symfony kernel/container alive between requests for faster apps. Supports SO_REUSEPORT and optional direct Request creation for speed.
Date: 2026-04-14 Issue: #34 Status: Approved
TriggerFactory::create() uses a fragile heuristic to detect cron expressions:
is_string($expression) && count(explode(' ', $expression)) === 5 && str_contains($expression, '*')
This fails for valid cron expressions without asterisks, such as 0 0 1 1 1 (January 1st at midnight, on Monday).
Replace the fragile heuristic with CronExpression::isValidExpression() from the dragonmantank/cron-expression library, which is already a dependency.
File: src/Scheduler/Trigger/TriggerFactory.php
use Cron\CronExpression;is_string($expression) && CronExpression::isValidExpression($expression) => new CronExpressionTrigger($expression),
The str_starts_with($expression, '@') check is no longer needed because CronExpression::isValidExpression() handles alias expressions (@daily, @hourly, etc.).
File: tests/TriggerFactoryTest.php
0 0 1 1 1 to cronExpressionProvidertestFivePartNonCronExpressionThrowsException - remove or adjust since 1 2 3 4 5 is now considered a valid cron expression by the library (which is correct - it's a valid cron expression for 1:02:03 on April 5th)Run existing tests to ensure no regressions:
./vendor/bin/phpunit tests/TriggerFactoryTest.php
How can I help you explore Laravel packages today?