From 14d73c766fcf611a91e93d5abfd5bc2cd8240dcf Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 25 Apr 2025 11:08:02 +0100 Subject: [PATCH 1/2] fix: implicit nullable --- src/CLI/Console.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CLI/Console.php b/src/CLI/Console.php index 8014859..b025b52 100644 --- a/src/CLI/Console.php +++ b/src/CLI/Console.php @@ -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. @@ -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(); From fedb446f32ca612c873b65b2602169190413774e Mon Sep 17 00:00:00 2001 From: loks0n <22452787+loks0n@users.noreply.github.com> Date: Fri, 25 Apr 2025 11:09:56 +0100 Subject: [PATCH 2/2] fix: implicit nullable --- src/CLI/CLI.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CLI/CLI.php b/src/CLI/CLI.php index e8d5e25..8cbfa0a 100644 --- a/src/CLI/CLI.php +++ b/src/CLI/CLI.php @@ -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');