Rename inflector_helper's is_countable to is_pluralizable to avoid PHP7.3 conflict

This commit is contained in:
Master Yoda 2018-07-06 13:38:49 -07:00
parent c9a0413ee3
commit 8ab9b697aa
No known key found for this signature in database
GPG Key ID: CED549230775AD5B
3 changed files with 8 additions and 8 deletions

View File

@ -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
(

View File

@ -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));
}
}

View File

@ -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)