PHP Class Potsky\LaravelLocalizationHelpers\Factory\Tools

Afficher le fichier Open project: potsky/laravel-localization-helpers Class Usage Examples

Méthodes publiques

Méthode 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 méthode

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
Résultat array

getLaravelMajorVersion() public static méthode

public static getLaravelMajorVersion ( ) : integer
Résultat integer

getLaravelVersion() public static méthode

public static getLaravelVersion ( ) : string
Résultat string

getPlural() public static méthode

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

isLaravel5() public static méthode

public static isLaravel5 ( ) : boolean
Résultat boolean

isValidDirectory() public static méthode

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

minifyString() public static méthode

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

unlinkGlobFiles() public static méthode

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