1
0
mirror of https://github.com/danog/parallel.git synced 2025-01-22 14:01:14 +01:00

Assert autoload of Task class did not fail

Fixes #27.
This commit is contained in:
Aaron Piotrowski 2017-11-22 20:42:56 -06:00
parent bcfb30fa35
commit 689de9a28b
No known key found for this signature in database
GPG Key ID: ADD1EF783EDE9EEB

View File

@ -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;
}
}