8000 Merge branch '5.4' into 6.4 · symfony/symfony@504b507 · GitHub
[go: up one dir, main page]

Skip to content

Commit 504b507

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 c8f720c + 4e6d1b0 commit 504b507

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

src/Symfony/Component/Console/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
throw new InvalidArgumentException('An option name cannot be empty.');
7676
}
7777

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

src/Symfony/Component/Console/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 = new InputOption('foo', '0|z');
7575
$this->assertEquals('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');
7678
}
7779

7880
public function testModes()

src/Symfony/Component/String/Inflector/EnglishInflector.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@ final class EnglishInflector implements InflectorInterface
291291
// circuses (circus)
292292
['suc', 3, true, true, 'cuses'],
293293

294+
// hippocampi (hippocampus)
295+
['supmacoppih', 11, false, false, 'hippocampi'],
296+
297+
// campuses (campus)
298+
['sup', 3, true, true, 'puses'],
299+
294300
// status (status)
295301
['sutats', 6, true, true, ['status', 'statuses']],
296302

src/Symfony/Component/String/Tests/Inflector/EnglishInflectorTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ public static function pluralizeProvider()
298298
['waltz', 'waltzes'],
299299
['wife', 'wives'],
300300
['icon', 'icons'],
301+
['hippocampus', 'hippocampi'],
302+
['campus', 'campuses'],
301303

302304
// test casing: if the first letter was uppercase, it should remain so
303305
['Man', 'Men'],

0 commit comments

Comments
 (0)
0