mirror of
https://github.com/codeigniter4/CodeIgniter4.git
synced 2025-02-20 11:44:28 +08:00
Rename inflector_helper's is_countable to is_pluralizable to avoid PHP7.3 conflict
This commit is contained in:
parent
c9a0413ee3
commit
8ab9b697aa
@ -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
|
||||
(
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user