class Str extends Str

Methods

static string
ordinal(int $number)

Converts number to its ordinal English form.

static string|string[]|null
normalizeEol(string|string[] $string)

Converts line breaks to a standard \r\n pattern.

static mixed|string
normalizeClassName(mixed $name)

Removes the starting slash from a class namespace \

static string
getClassId($name)

Generates a class ID from either an object or a string of the class name.

static bool|string
getClassNamespace($name)

Returns a class namespace

static int
getPrecedingSymbols(string $string, string $symbol)

If $string begins with any number of consecutive symbols, returns the number, otherwise returns 0

Details

at line 17
static string ordinal(int $number)

Converts number to its ordinal English form.

This method converts 13 to 13th, 2 to 2nd ...

Parameters

int $number

Number to get its ordinal value

Return Value

string

Ordinal representation of given string.

at line 40
static string|string[]|null normalizeEol(string|string[] $string)

Converts line breaks to a standard \r\n pattern.

Parameters

string|string[] $string

Return Value

string|string[]|null

at line 50
static mixed|string normalizeClassName(mixed $name)

Removes the starting slash from a class namespace \

Parameters

mixed $name

Return Value

mixed|string

at line 65
static string getClassId($name)

Generates a class ID from either an object or a string of the class name.

Parameters

$name

Return Value

string

at line 81
static bool|string getClassNamespace($name)

Returns a class namespace

Parameters

$name

Return Value

bool|string

at line 96
static int getPrecedingSymbols(string $string, string $symbol)

If $string begins with any number of consecutive symbols, returns the number, otherwise returns 0

Parameters

string $string
string $symbol

Return Value

int