diff --git a/system/Helpers/inflector_helper.php b/system/Helpers/inflector_helper.php index 16bbf75e7b..dad58ad864 100755 --- a/system/Helpers/inflector_helper.php +++ b/system/Helpers/inflector_helper.php @@ -60,7 +60,7 @@ if ( ! function_exists('singular')) { $result = strval($string); - if ( ! is_countable($result)) + if ( ! is_pluralizable($result)) { return $result; } @@ -128,7 +128,7 @@ if ( ! function_exists('plural')) { $result = strval($string); - if ( ! is_countable($result)) + if ( ! is_pluralizable($result)) { return $result; } @@ -242,7 +242,7 @@ if ( ! function_exists('humanize')) // ------------------------------------------------------------------------ -if ( ! function_exists('is_countable')) +if ( ! function_exists('is_pluralizable')) { /** @@ -251,7 +251,7 @@ if ( ! function_exists('is_countable')) * @param string $word Word to check * @return bool */ - function is_countable($word): bool + function is_pluralizable($word): bool { $uncountables = in_array ( diff --git a/tests/system/Helpers/InflectorHelperTest.php b/tests/system/Helpers/InflectorHelperTest.php index 54c7deabd6..410a14a341 100755 --- a/tests/system/Helpers/InflectorHelperTest.php +++ b/tests/system/Helpers/InflectorHelperTest.php @@ -156,8 +156,8 @@ final class InflectorHelperTest extends \CIUnitTestCase foreach ($words as $countable => $unCountable) { - $this->assertTrue(is_countable($countable)); - $this->assertFalse(is_countable($unCountable)); + $this->assertTrue(is_pluralizable($countable)); + $this->assertFalse(is_pluralizable($unCountable)); } } diff --git a/user_guide_src/source/helpers/inflector_helper.rst b/user_guide_src/source/helpers/inflector_helper.rst index 3f67c4b505..634293778c 100755 --- a/user_guide_src/source/helpers/inflector_helper.rst +++ b/user_guide_src/source/helpers/inflector_helper.rst @@ -84,7 +84,7 @@ The following functions are available: echo humanize('my-dog-spot', '-'); // Prints 'My Dog Spot' -.. php:function:: is_countable($word) +.. php:function:: is_pluralizable($word) :param string $word: Input string :returns: TRUE if the word is countable or FALSE if not @@ -92,7 +92,7 @@ The following functions are available: Checks if the given word has a plural version. Example:: - is_countable('equipment'); // Returns FALSE + is_pluralizable('equipment'); // Returns FALSE .. php:function:: dasherize($string)