class Pluralizer (View source)

Properties

static protected Pluralizer $inflector

The cached inflector instance.

static protected string $language

The language that should be used by the inflector.

static string[] $uncountable

Uncountable non-nouns word forms.

Methods

static string
plural(string $value, int|array|Countable $count = 2)

Get the plural form of an English word.

static string
singular(string $value)

Get the singular form of an English word.

static bool
uncountable(string $value)

Determine if the given value is uncountable.

static string
matchCase(string $value, string $comparison)

Attempt to match the case on two strings.

static Inflector
inflector()

Get the inflector instance.

static void
useLanguage(string $language)

Specify the language that should be used by the inflector.

Details

static string plural(string $value, int|array|Countable $count = 2)

Get the plural form of an English word.

Parameters

string $value
int|array|Countable $count

Return Value

string

static string singular(string $value)

Get the singular form of an English word.

Parameters

string $value

Return Value

string

static protected bool uncountable(string $value)

Determine if the given value is uncountable.

Parameters

string $value

Return Value

bool

static protected string matchCase(string $value, string $comparison)

Attempt to match the case on two strings.

Parameters

string $value
string $comparison

Return Value

string

static Inflector inflector()

Get the inflector instance.

Return Value

Inflector

static void useLanguage(string $language)

Specify the language that should be used by the inflector.

Parameters

string $language

Return Value

void