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 43
static string
plural(string $value, array|Countable|int $count = 2)
Get the plural form of an English word.
at line 61
static string
singular(string $value)
Get the singular form of an English word.
at line 71
static protected bool
uncountable(string $value)
Determine if the given value is uncountable.
at line 79
static protected string
matchCase(string $value, string $comparison)
Attempt to match the case on two strings.
at line 95
static Inflector
inflector()
Get the inflector instance.
at line 111
static void
useLanguage(string $language)
Specify the language that should be used by the inflector.
Boot-only. 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 120
static void
flushState()
Flush all static state.