Pluralizer
class Pluralizer
Constants
| protected DEFAULT_UNCOUNTABLE |
Default uncountable non-nouns word forms. |
Properties
| static protected Inflector|null | $inflector | The cached inflector instance. |
|
| static protected string | $language | The language that should be used by the inflector. |
|
| static list<string> | $uncountable | Uncountable non-nouns word forms. |
Methods
Get the singular form of an English word.
Determine if the given value is uncountable.
Attempt to match the case on two strings.
Get the inflector instance.
Specify the language that should be used by the inflector.
Flush all static state.
Details
at line 44
static string
plural(string $value, array|Countable|int $count = 2)
Get the plural form of an English word.
at line 62
static string
singular(string $value)
Get the singular form of an English word.
at line 72
static protected bool
uncountable(string $value)
Determine if the given value is uncountable.
at line 80
static protected string
matchCase(string $value, string $comparison)
Attempt to match the case on two strings.
at line 96
static Inflector
inflector()
Get the inflector instance.
at line 112
static void
useLanguage(string $language)
Specify the language that should be used by the inflector.
The language and inflector instance persist in static properties for the worker lifetime and are used by every Str::plural() / Str::singular() call across all coroutines.
at line 122
static void
flushState()
Flush all static state.