Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2dfe342

Browse filesBrowse files
committed
[Inflector] Fix Notice when argument is empty string
1 parent aa5ec20 commit 2dfe342
Copy full SHA for 2dfe342

File tree

Expand file treeCollapse file tree

2 files changed

+13
-0
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+13
-0
lines changed

‎src/Symfony/Component/Inflector/Inflector.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Inflector/Inflector.php
+1Lines 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

Copy file name to clipboardExpand all lines: src/Symfony/Component/Inflector/Tests/InflectorTest.php
+12Lines 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)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.