Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/CLI/CLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ class CLI
*
* @throws Exception
*/
public function __construct(Adapter $adapter = null, array $args = [])
public function __construct(?Adapter $adapter = null, array $args = [])
{
if (\php_sapi_name() !== 'cli') {
throw new Exception('CLI tasks can only work from the command line');
Expand Down
4 changes: 2 additions & 2 deletions src/CLI/Console.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public static function exit(int $status = 0): void
* @param int $timeout
* @return int
*/
public static function execute(array|string $cmd, string $input, string &$output, int $timeout = -1, callable $onProgress = null): int
public static function execute(array|string $cmd, string $input, string &$output, int $timeout = -1, ?callable $onProgress = null): int
{
// If the $cmd is passed as string, it will be wrapped into a subshell by \proc_open
// Forward stdout and exit codes from the subshell.
Expand Down Expand Up @@ -216,7 +216,7 @@ public static function isInteractive(): bool
*
* @throws \Exception
*/
public static function loop(callable $callback, int $sleep = 1 /* seconds */, int $delay = 0 /* seconds */, callable $onError = null): void
public static function loop(callable $callback, int $sleep = 1 /* seconds */, int $delay = 0 /* seconds */, ?callable $onError = null): void
{
gc_enable();

Expand Down