PHP Class Tools\Utility\Language

Datei anzeigen Open project: dereuromark/cakephp-tools Class Usage Examples

Public Methods

Method Description
findFirstMatch ( array $accepted, array $available = [] ) : string | null Compares two parsed arrays of language tags and find the matches
findMatches ( array $accepted, array $available = [] ) : array Compares two parsed arrays of language tags and find the matches
parseLanguageList ( string | null $languageList = null ) : array

Protected Methods

Method Description
_matchLanguage ( string $a, string $b ) : float Compare two language tags and distinguish the degree of matching

Method Details

_matchLanguage() protected static method

Compare two language tags and distinguish the degree of matching
protected static _matchLanguage ( string $a, string $b ) : float
$a string
$b string
return float

findFirstMatch() public static method

Compares two parsed arrays of language tags and find the matches
public static findFirstMatch ( array $accepted, array $available = [] ) : string | null
$accepted array
$available array
return string | null

findMatches() public static method

Compares two parsed arrays of language tags and find the matches
public static findMatches ( array $accepted, array $available = [] ) : array
$accepted array
$available array
return array

parseLanguageList() public static method

public static parseLanguageList ( string | null $languageList = null ) : array
$languageList string | null
return array