Skip to content

Commit 86386d4

Browse files
Merge branch '5.4' into 6.4
* 5.4: [Console] Allow false as a $shortcut in InputOption Fix plurial of word ending by pus
2 parents 2aaf83b + 37774e6 commit 86386d4

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

‎Input/InputOption.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public function __construct(string $name, string|array|null $shortcut = null, ?i
7575
thrownewInvalidArgumentException('An option name cannot be empty.');
7676
}
7777

78-
if ('' === $shortcut || [] === $shortcut) {
78+
if ('' === $shortcut || [] === $shortcut || false === $shortcut) {
7979
$shortcut = null;
8080
}
8181

‎Tests/Input/InputOptionTest.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public function testShortcut()
7373
$this->assertEquals('0|z', $option->getShortcut(), '-0 is an acceptable shortcut value when embedded in an array');
7474
$option = newInputOption('foo', '0|z');
7575
$this->assertEquals('0|z', $option->getShortcut(), '-0 is an acceptable shortcut value when embedded in a string-list');
76+
$option = newInputOption('foo', false);
77+
$this->assertNull($option->getShortcut(), '__construct() makes the shortcut null when given a false as value');
7678
}
7779

7880
publicfunctiontestModes()

0 commit comments

Comments
 (0)