diff --git a/lib/Worker/Internal/Job.php b/lib/Worker/Internal/Job.php index cc2029a..6dcdc3a 100644 --- a/lib/Worker/Internal/Job.php +++ b/lib/Worker/Internal/Job.php @@ -22,6 +22,11 @@ class Job { } public function getTask(): Task { + // Classes that cannot be autoloaded will be unserialized as an instance of __PHP_Incomplete_Class. + \assert( + $this->task instanceof Task, + \sprintf("Classes implementing %s must be autoloadable by the Composer autoloader", Task::class) + ); return $this->task; } }