diff --git a/docs/api.md b/docs/api.md index 240c9e97..c55637fc 100755 --- a/docs/api.md +++ b/docs/api.md @@ -140,7 +140,7 @@ Alternatively get a defined task. Name of current task. - ### body - **type**: `callable|array|string|null ` + **type**: `callable|array|null ` Callable task, array of other tasks names or nothing to get a defined tasks diff --git a/src/functions.php b/src/functions.php index 8b5641fb..fcc2f636 100644 --- a/src/functions.php +++ b/src/functions.php @@ -159,7 +159,7 @@ function desc(?string $title = null): ?string * Alternatively get a defined task. * * @param string $name Name of current task. - * @param callable|array|string|null $body Callable task, array of other tasks names or nothing to get a defined tasks + * @param callable|array|null $body Callable task, array of other tasks names or nothing to get a defined tasks */ function task(string $name, $body = null): Task { @@ -174,7 +174,7 @@ function task(string $name, $body = null): Task } elseif (is_array($body)) { $task = new GroupTask($name, $body); } else { - throw new \InvalidArgumentException('Task should be a closure or array of other tasks.'); + throw new \InvalidArgumentException('Task body should be a function or an array.'); } $task->saveSourceLocation();