mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Fix inflection rules for curves.
Remove curve from the uninflected list and update rules so it, wolves, and lives are still properly handled. Fixes #2148
This commit is contained in:
parent
935a51c892
commit
1ae470a284
2 changed files with 4 additions and 3 deletions
|
@ -122,6 +122,7 @@ class InflectorTest extends CakeTestCase {
|
|||
$this->assertEquals(Inflector::singularize('briefs'), 'brief');
|
||||
$this->assertEquals(Inflector::singularize('quotas'), 'quota');
|
||||
$this->assertEquals(Inflector::singularize('curves'), 'curve');
|
||||
$this->assertEquals(Inflector::singularize('body_curves'), 'body_curve');
|
||||
$this->assertEquals(Inflector::singularize(''), '');
|
||||
}
|
||||
|
||||
|
@ -185,6 +186,7 @@ class InflectorTest extends CakeTestCase {
|
|||
$this->assertEquals(Inflector::pluralize('brief'), 'briefs');
|
||||
$this->assertEquals(Inflector::pluralize('quota'), 'quotas');
|
||||
$this->assertEquals(Inflector::pluralize('curve'), 'curves');
|
||||
$this->assertEquals(Inflector::pluralize('body_curve'), 'body_curves');
|
||||
$this->assertEquals(Inflector::pluralize(''), '');
|
||||
}
|
||||
|
||||
|
|
|
@ -129,8 +129,8 @@ class Inflector {
|
|||
'/(tive)s$/i' => '\1',
|
||||
'/(hive)s$/i' => '\1',
|
||||
'/(drive)s$/i' => '\1',
|
||||
'/([lre])ves$/i' => '\1f',
|
||||
'/([^fo])ves$/i' => '\1fe',
|
||||
'/([le])ves$/i' => '\1f',
|
||||
'/([^rfo])ves$/i' => '\1fe',
|
||||
'/(^analy)ses$/i' => '\1sis',
|
||||
'/(analy|diagno|^ba|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i' => '\1\2sis',
|
||||
'/([ti])a$/i' => '\1um',
|
||||
|
@ -148,7 +148,6 @@ class Inflector {
|
|||
'irregular' => array(
|
||||
'foes' => 'foe',
|
||||
'waves' => 'wave',
|
||||
'curves' => 'curve'
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue