Skip to content

Commit c9837b6

Browse files
committed
fix: tests
1 parent 768879f commit c9837b6

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

stubs/common/Console/Command.stub

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,22 @@ namespace Illuminate\Console
1212
* @throws \Illuminate\Console\ManuallyFailedException|\Throwable
1313
*/
1414
public function fail(\Throwable|string|null $exception = null) {}
15+
16+
/**
17+
* Get the value of a command argument.
18+
*
19+
* @param string|null $key
20+
* @return ($key is null ? array<array<mixed>|string|float|int|bool|null> : array<mixed>|string|float|int|bool|null)
21+
*/
22+
public function argument($key = null);
23+
24+
/**
25+
* Get the value of a command option.
26+
*
27+
* @param string|null $key
28+
* @return ($key is null ? array<array<mixed>|string|float|int|bool|null> : array<mixed>|string|float|int|bool|null)
29+
*/
30+
public function option($key = null);
1531
}
1632

1733
class ManuallyFailedException extends \RuntimeException {}

tests/application/app/Console/Commands/FooCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public function handle(): void
1919
assertType('string', $this->argument('argument'));
2020
assertType('string|null', $this->argument('optionalArg'));
2121
assertType('string', $this->argument('optionalArgWithDefault'));
22-
assertType('array|bool|string|null', $this->argument('foobar'));
22+
assertType('array<mixed>|bool|float|int|string|null', $this->argument('foobar'));
2323

2424
assertType('true', $this->hasArgument('argument'));
2525
assertType('true', $this->hasArgument('optionalArg'));
@@ -33,7 +33,7 @@ public function handle(): void
3333
assertType('string|null', $this->option('optionWithValue'));
3434
assertType('bool', $this->option('help'));
3535
assertType('bool', $this->option('v'));
36-
assertType('array|bool|string|null', $this->option('foobar'));
36+
assertType('array<mixed>|bool|float|int|string|null', $this->option('foobar'));
3737

3838
assertType('true', $this->hasOption('O'));
3939
assertType('true', $this->hasOption('option'));

0 commit comments

Comments
 (0)