PHP Class Potsky\LaravelLocalizationHelpers\Factory\Tools

Datei anzeigen Open project: potsky/laravel-localization-helpers Class Usage Examples

Public Methods

Method Description
arraySetDotFirstLevel ( array &$array, string $key, mixed $value ) : array Set an array item to a given value using "dot" notation only fr the first token
getLaravelMajorVersion ( ) : integer
getLaravelVersion ( ) : string
getPlural ( float | integer | string $number ) : string Return char 's' if argument is greater than 1
isLaravel5 ( ) : boolean
isValidDirectory ( string $dir_lang, string $lang ) : boolean Check if the "$dir_lang/$lang" is a valid directory
minifyString ( $string ) : string Remove all whitesapces, line-breaks, and tabs from string for better regex recognition
unlinkGlobFiles ( string $glob ) : array

Method Details

arraySetDotFirstLevel() public static method

If no key is given to the method, the entire array will be replaced.
public static arraySetDotFirstLevel ( array &$array, string $key, mixed $value ) : array
$array array
$key string
$value mixed
return array

getLaravelMajorVersion() public static method

public static getLaravelMajorVersion ( ) : integer
return integer

getLaravelVersion() public static method

public static getLaravelVersion ( ) : string
return string

getPlural() public static method

Return char 's' if argument is greater than 1
public static getPlural ( float | integer | string $number ) : string
$number float | integer | string
return string

isLaravel5() public static method

public static isLaravel5 ( ) : boolean
return boolean

isValidDirectory() public static method

Check if the "$dir_lang/$lang" is a valid directory
public static isValidDirectory ( string $dir_lang, string $lang ) : boolean
$dir_lang string
$lang string
return boolean

minifyString() public static method

Remove all whitesapces, line-breaks, and tabs from string for better regex recognition
public static minifyString ( $string ) : string
$string
return string

unlinkGlobFiles() public static method

public static unlinkGlobFiles ( string $glob ) : array
$glob string a file glob
return array the list of deleted files