Skip to content

Commit f57ff57

Browse files
authored
Merge pull request #10 from ycrao/master
Make mode parameter nullable in addOption and addArgument
2 parents dd1fb8c + a773921 commit f57ff57

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/commands/AbstractBaseCommand.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ protected function setRunwayConfigValue(string $key, $value): void {
8888
*
8989
* @return $this
9090
*/
91-
public function addOption(string $name, $shortcut = null, int $mode = null, string $description = '', $default = null): self {
91+
public function addOption(string $name, $shortcut = null, ?int $mode = null, string $description = '', $default = null): self
92+
{
9293
// Build raw option format Ahc\Cli expects, e.g. "-s, --name" or "--name"
9394
$raw = '';
9495

@@ -139,7 +140,8 @@ public function addOption(string $name, $shortcut = null, int $mode = null, stri
139140
*
140141
* @return $this
141142
*/
142-
public function addArgument(string $name, int $mode = null, string $description = '', $default = null): self {
143+
public function addArgument(string $name, ?int $mode = null, string $description = '', $default = null): self
144+
{
143145
if ($mode === null) {
144146
$mode = self::OPTIONAL;
145147
}

0 commit comments

Comments
 (0)