@@ -145,7 +145,7 @@ public function app(): ?App
145
145
/**
146
146
* Bind command to the app.
147
147
*/
148
- public function bind (App $ app = null ): self
148
+ public function bind (? App $ app = null ): self
149
149
{
150
150
$ this ->_app = $ app ;
151
151
@@ -189,7 +189,7 @@ public function argument(string $raw, string $desc = '', $default = null): self
189
189
/**
190
190
* Registers new option.
191
191
*/
192
- public function option (string $ raw , string $ desc = '' , callable $ filter = null , $ default = null ): self
192
+ public function option (string $ raw , string $ desc = '' , ? callable $ filter = null , $ default = null ): self
193
193
{
194
194
$ option = new Option ($ raw , $ desc , $ default , $ filter );
195
195
@@ -217,7 +217,7 @@ public function userOptions(): array
217
217
*
218
218
* @return string|self
219
219
*/
220
- public function usage (string $ usage = null )
220
+ public function usage (? string $ usage = null )
221
221
{
222
222
if (func_num_args () === 0 ) {
223
223
return $ this ->_usage ;
@@ -235,7 +235,7 @@ public function usage(string $usage = null)
235
235
*
236
236
* @return string|self
237
237
*/
238
- public function alias (string $ alias = null )
238
+ public function alias (? string $ alias = null )
239
239
{
240
240
if (func_num_args () === 0 ) {
241
241
return $ this ->_alias ;
@@ -249,7 +249,7 @@ public function alias(string $alias = null)
249
249
/**
250
250
* Sets event handler for last (or given) option.
251
251
*/
252
- public function on (callable $ fn , string $ option = null ): self
252
+ public function on (callable $ fn , ? string $ option = null ): self
253
253
{
254
254
$ names = array_keys ($ this ->allOptions ());
255
255
@@ -271,7 +271,7 @@ public function onExit(callable $fn): self
271
271
/**
272
272
* {@inheritdoc}
273
273
*/
274
- protected function handleUnknown (string $ arg , string $ value = null ): mixed
274
+ protected function handleUnknown (string $ arg , ? string $ value = null ): mixed
275
275
{
276
276
if ($ this ->_allowUnknown ) {
277
277
return $ this ->set ($ this ->toCamelCase ($ arg ), $ value );
@@ -338,7 +338,7 @@ public function emit(string $event, $value = null): mixed
338
338
/**
339
339
* Tap return given object or if that is null then app instance. This aids for chaining.
340
340
*/
341
- public function tap (object $ object = null )
341
+ public function tap (? object $ object = null )
342
342
{
343
343
return $ object ?? $ this ->_app ;
344
344
}
@@ -358,7 +358,7 @@ public function interact(Interactor $io): void
358
358
*
359
359
* @return callable|self If $action provided then self, otherwise the preset action.
360
360
*/
361
- public function action (callable $ action = null )
361
+ public function action (? callable $ action = null )
362
362
{
363
363
if (func_num_args () === 0 ) {
364
364
return $ this ->_action ;
@@ -388,7 +388,7 @@ protected function io(): Interactor
388
388
/**
389
389
* Get ProgressBar instance.
390
390
*/
391
- protected function progress (int $ total = null ): ProgressBar
391
+ protected function progress (? int $ total = null ): ProgressBar
392
392
{
393
393
return new ProgressBar ($ total , $ this ->writer ());
394
394
}
0 commit comments