@@ -145,7 +145,7 @@ public function app(): ?App
145145 /**
146146 * Bind command to the app.
147147 */
148- public function bind (App $ app = null ): self
148+ public function bind (? App $ app = null ): self
149149 {
150150 $ this ->_app = $ app ;
151151
@@ -189,7 +189,7 @@ public function argument(string $raw, string $desc = '', $default = null): self
189189 /**
190190 * Registers new option.
191191 */
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
193193 {
194194 $ option = new Option ($ raw , $ desc , $ default , $ filter );
195195
@@ -217,7 +217,7 @@ public function userOptions(): array
217217 *
218218 * @return string|self
219219 */
220- public function usage (string $ usage = null )
220+ public function usage (? string $ usage = null )
221221 {
222222 if (func_num_args () === 0 ) {
223223 return $ this ->_usage ;
@@ -235,7 +235,7 @@ public function usage(string $usage = null)
235235 *
236236 * @return string|self
237237 */
238- public function alias (string $ alias = null )
238+ public function alias (? string $ alias = null )
239239 {
240240 if (func_num_args () === 0 ) {
241241 return $ this ->_alias ;
@@ -249,7 +249,7 @@ public function alias(string $alias = null)
249249 /**
250250 * Sets event handler for last (or given) option.
251251 */
252- public function on (callable $ fn , string $ option = null ): self
252+ public function on (callable $ fn , ? string $ option = null ): self
253253 {
254254 $ names = array_keys ($ this ->allOptions ());
255255
@@ -271,7 +271,7 @@ public function onExit(callable $fn): self
271271 /**
272272 * {@inheritdoc}
273273 */
274- protected function handleUnknown (string $ arg , string $ value = null ): mixed
274+ protected function handleUnknown (string $ arg , ? string $ value = null ): mixed
275275 {
276276 if ($ this ->_allowUnknown ) {
277277 return $ this ->set ($ this ->toCamelCase ($ arg ), $ value );
@@ -338,7 +338,7 @@ public function emit(string $event, $value = null): mixed
338338 /**
339339 * Tap return given object or if that is null then app instance. This aids for chaining.
340340 */
341- public function tap (object $ object = null )
341+ public function tap (? object $ object = null )
342342 {
343343 return $ object ?? $ this ->_app ;
344344 }
@@ -358,7 +358,7 @@ public function interact(Interactor $io): void
358358 *
359359 * @return callable|self If $action provided then self, otherwise the preset action.
360360 */
361- public function action (callable $ action = null )
361+ public function action (? callable $ action = null )
362362 {
363363 if (func_num_args () === 0 ) {
364364 return $ this ->_action ;
@@ -388,7 +388,7 @@ protected function io(): Interactor
388388 /**
389389 * Get ProgressBar instance.
390390 */
391- protected function progress (int $ total = null ): ProgressBar
391+ protected function progress (? int $ total = null ): ProgressBar
392392 {
393393 return new ProgressBar ($ total , $ this ->writer ());
394394 }
0 commit comments