Browse Source

Merge pull request #18628 from kjusupov/inflextor_fixes

Added 'software' and 'hardware' string to BaseInflector $specials.
tags/2.0.43
Bizley 3 years ago committed by GitHub
parent
commit
56d8ca6ccb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      framework/CHANGELOG.md
  2. 2
      framework/helpers/BaseInflector.php
  3. 4
      tests/framework/helpers/InflectorTest.php

2
framework/CHANGELOG.md

@ -4,7 +4,7 @@ Yii Framework 2 Change Log
2.0.43 under development
------------------------
- no changes in this release.
- Enh #18628: Added strings "software", and "hardware" to `$specials` array in `yii\helpers\BaseInflector` (kjusupov)
2.0.42.1 May 06, 2021

2
framework/helpers/BaseInflector.php

@ -219,6 +219,8 @@ class BaseInflector
'whiting' => 'whiting',
'wildebeest' => 'wildebeest',
'Yengeese' => 'Yengeese',
'software' => 'software',
'hardware' => 'hardware',
];
/**
* @var array fallback map for transliteration used by [[transliterate()]] when intl isn't available.

4
tests/framework/helpers/InflectorTest.php

@ -44,6 +44,8 @@ class InflectorTest extends TestCase
'car' => 'cars',
'netherlands' => 'netherlands',
'currency' => 'currencies',
'software' => 'software',
'hardware' => 'hardware',
];
foreach ($testData as $testIn => $testOut) {
@ -73,6 +75,8 @@ class InflectorTest extends TestCase
'cars' => 'car',
'Netherlands' => 'Netherlands',
'currencies' => 'currency',
'software' => 'software',
'hardware' => 'hardware',
];
foreach ($testData as $testIn => $testOut) {
$this->assertEquals($testOut, Inflector::singularize($testIn));

Loading…
Cancel
Save