Skip to content

Commit cef0da8

Browse files
committed
minor symfony#61202 [Console] cleanup (nicolas-grekas)
This PR was merged into the 7.4 branch. Discussion ---------- [Console] cleanup | Q | A | ------------- | --- | Branch? | 7.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT The argument already rejects/auto-casts booleans. Commits ------- a3eca77 [Console] cleanup
2 parents 8150927 + a3eca77 commit cef0da8

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

src/Symfony/Component/Console/Input/InputOption.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function __construct(
7979
throw new InvalidArgumentException('An option name cannot be empty.');
8080
}
8181

82-
if ('' === $shortcut || [] === $shortcut || false === $shortcut) {
82+
if ('' === $shortcut || [] === $shortcut) {
8383
$shortcut = null;
8484
}
8585

src/Symfony/Component/Console/Tests/Input/InputOptionTest.php

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

8078
public function testModes()

0 commit comments

Comments
 (0)