public function __construct($definedTask) { if (!$definedTask->hasClosure()) { throw new \RuntimeException("The task don't have a closure"); } parent::__construct($definedTask); }