What's Changed
🚀 Highlights
- Requires PHP 8.2+ – leverages readonly properties, promoted params, improved typing.
- New exception hierarchy (
*Exception.php) + ParallelException DTO. - Refactored Scheduler, Runner, Task for stricter types and cleaner error propagation.
- GitHub Actions now test on 8.2 · 8.3 · 8.4.
⚠️ Breaking Change
Raising the minimum runtime from 8.0 to 8.2 is a SemVer-major change.
Projects on older PHP versions must stay on the 2.x line.
🆕 Added
- Domain-specific exceptions:
ActionNotImplementedException,InvalidMessageReceivedException,NoWorkerDefinedException,
WorkerAlreadyDefinedException,WorkerNotDefinedException,TaskExecutionFailedException. ParallelExceptionobject to serialise worker-side throwables.- Modern PHP 8.2 syntax throughout (readonly props, precise return types).
🔄 Changed
Scheduler::using()now throwsWorkerAlreadyDefinedExceptionwhen attempting to re-register a worker with constructor args.Scheduler::runTask()surfaces worker errors viaTaskExecutionFailedException.- Numerous PSR-12 / coding-style fixes and micro-optimisations.
🗑 Removed
- CI workflows for PHP 8.0 / 8.1.
- Generic
RuntimeExceptionbranches – replaced by specific exceptions.
🧭 Upgrade Guide
- Ensure your runtime is PHP 8.2+ with ZTS and
parallel≥ 1.2.5 installed. - Update composer constraint to
"hds-solutions/parallel-sdk": "^3.0". - Replace any
catch (RuntimeException)blocks for task failures withcatch (TaskExecutionFailedException). - Avoid re-registering workers with new ctor args; if needed, call
Scheduler::removeAllTasks()first.
Full Changelog: v2.1.4...v3.0.0