Skip to content

Commit e41c8d0

Browse files
Merge pull request #45 from utopia-php/fix-implicit-nullable
fix: implicit nullable
2 parents 9a51925 + fedb446 commit e41c8d0

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/CLI/CLI.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class CLI
8787
*
8888
* @throws Exception
8989
*/
90-
public function __construct(Adapter $adapter = null, array $args = [])
90+
public function __construct(?Adapter $adapter = null, array $args = [])
9191
{
9292
if (\php_sapi_name() !== 'cli') {
9393
throw new Exception('CLI tasks can only work from the command line');

src/CLI/Console.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ public static function exit(int $status = 0): void
130130
* @param int $timeout
131131
* @return int
132132
*/
133-
public static function execute(array|string $cmd, string $input, string &$output, int $timeout = -1, callable $onProgress = null): int
133+
public static function execute(array|string $cmd, string $input, string &$output, int $timeout = -1, ?callable $onProgress = null): int
134134
{
135135
// If the $cmd is passed as string, it will be wrapped into a subshell by \proc_open
136136
// Forward stdout and exit codes from the subshell.
@@ -216,7 +216,7 @@ public static function isInteractive(): bool
216216
*
217217
* @throws \Exception
218218
*/
219-
public static function loop(callable $callback, int $sleep = 1 /* seconds */, int $delay = 0 /* seconds */, callable $onError = null): void
219+
public static function loop(callable $callback, int $sleep = 1 /* seconds */, int $delay = 0 /* seconds */, ?callable $onError = null): void
220220
{
221221
gc_enable();
222222

0 commit comments

Comments
 (0)