trait CheckerPart

Methods

bool
isAlphabetic()

Check if the string contains only alphanumeric characters.

bool
isAlphanumeric()

Check if the string contains only alphanumeric characters.

bool
isEmpty()

Checks if the string is empty

bool
isLowerCase()

Check if the string contains only lower case characters.

bool
isNumeric()

Check if the string contains only numeric characters.

bool
isPlural(InflectorInterface|null $pluralizer = null)

Check if a string is plural form.

bool
isPunctuation()

Check if the string contains only characters which are not whitespace or an alphanumeric.

bool
isSingular(InflectorInterface|null $pluralizer = null)

Check if a string is singular form.

bool
isSpace()

Check if the string contains only space characters.

bool
isUpperCase()

Check if the string contains only upper case characters.

Details

at line 41
bool isAlphabetic()

Check if the string contains only alphanumeric characters.

Return Value

bool

at line 32
bool isAlphanumeric()

Check if the string contains only alphanumeric characters.

Return Value

bool

at line 23
bool isEmpty()

Checks if the string is empty

Return Value

bool

at line 85
bool isLowerCase()

Check if the string contains only lower case characters.

Spaces are considered non-lowercase characters, so lowercase strings with multiple words, separated by spaces, return false. E.g.:

$text = new Text('lowercase multi words string');
var_dump($text->isLowercase()); // false

Return Value

bool

at line 50
bool isNumeric()

Check if the string contains only numeric characters.

Return Value

bool

at line 128
bool isPlural(InflectorInterface|null $pluralizer = null)

Check if a string is plural form.

Parameters

InflectorInterface|null $pluralizer A custom pluralizer. Default is the Inflector

Return Value

bool

at line 59
bool isPunctuation()

Check if the string contains only characters which are not whitespace or an alphanumeric.

Return Value

bool

at line 114
bool isSingular(InflectorInterface|null $pluralizer = null)

Check if a string is singular form.

Parameters

InflectorInterface|null $pluralizer A custom pluralizer. Default is the Inflector

Return Value

bool

at line 68
bool isSpace()

Check if the string contains only space characters.

Return Value

bool

at line 102
bool isUpperCase()

Check if the string contains only upper case characters.

Spaces are considered non-uppercase characters, so uppercase strings with multiple words, separated by spaces, return false. E.g.:

$text = new Text('UPPERCASE MULTI WORDS STRING');
var_dump($text->isUppercase()); // false

Return Value

bool