File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
tests/application/app/Console/Commands Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff 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 {}
Original file line number Diff line number Diff 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 ' ));
You can’t perform that action at this time.
0 commit comments