function taskDefined($task) { if (is_object($task) and !empty($task->name)) { $task = $task->name; } return (bool) $this['tasks'][$task]; }