1 | <?php |
||
18 | class PartialLanguageMatcher implements MatcherInterface |
||
19 | { |
||
20 | /** |
||
21 | * @inheritDoc |
||
22 | */ |
||
23 | 54 | public function hasMatch($fromField, array $matchingList, PreferenceInterface $clientPref) |
|
27 | |||
28 | /** |
||
29 | * @inheritDoc |
||
30 | */ |
||
31 | 6 | public function match($fromField, array $matchingList, PreferenceInterface $clientPref) |
|
45 | |||
46 | /** |
||
47 | * Returns an array of indexes for of matches of higher precedence than the existing pairing. |
||
48 | * |
||
49 | * @param string $fromField |
||
50 | * @param MatchedPreferenceInterface[] $matchingList |
||
51 | * @param PreferenceInterface $clientPref |
||
52 | * |
||
53 | * @return int[] |
||
54 | */ |
||
55 | 54 | private function getMatchingIndexes($fromField, array $matchingList, PreferenceInterface $clientPref) |
|
67 | |||
68 | /** |
||
69 | * Returns true if the server preference contains a partial language that matches the language in the client |
||
70 | * preference. |
||
71 | * |
||
72 | * e.g. An server variant of en-* would match en, en-US but not es-ES |
||
73 | * |
||
74 | * @param string $fromField |
||
75 | * @param MatchedPreferenceInterface $matchedPreference |
||
76 | * @param PreferenceInterface $newClientPref |
||
77 | * |
||
78 | * @return bool |
||
79 | */ |
||
80 | 53 | private function partialLangMatches( |
|
98 | } |
||
99 |