8000 [Inflector] Fix Notice when argument is empty string · symfony/symfony@2dfe342 · GitHub
[go: up one dir, main page]

Skip to content

Commit 2dfe342

Browse files
committed
[Inflector] Fix Notice when argument is empty string
1 parent aa5ec20 commit 2dfe342

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

src/Symfony/Component/Inflector/Inflector.php

8000 Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,7 @@ final class Inflector
310310
* A list of words which should not be inflected, reversed.
311311
*/
312312
private static $uninflected = [
313+
'',
313314
'atad',
314315
'reed',
315316
'kcabdeef',

src/Symfony/Component/Inflector/Tests/InflectorTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,4 +320,16 @@ public function testPluralize($singular, $expectedPlural)
320320

321321
$this->assertEquals($expectedPlural, $plural);
322322
}
323+
324+
public function testPluralizeEmptyString()
325+
{
326+
$plural = Inflector::pluralize('');
327+
$this->assertSame('', $plural);
328+
}
329+
330+
public function testSingularizeEmptyString()
331+
{
332+
$singular = Inflector::singularize('');
333+
$this->assertSame('', $singular);
334+
}
323335
}

0 commit comments

Comments
 (0)
0