1 | <?php |
||
19 | class ExactMatcher implements MatcherInterface |
||
20 | { |
||
21 | /** |
||
22 | * @var MatchedPreferenceComparator |
||
23 | */ |
||
24 | private $comparator; |
||
25 | |||
26 | |||
27 | /** |
||
28 | * Constructor. |
||
29 | * |
||
30 | * @param MatchedPreferenceComparator $comparator |
||
31 | */ |
||
32 | 76 | public function __construct(MatchedPreferenceComparator $comparator) |
|
36 | |||
37 | /** |
||
38 | * @inheritDoc |
||
39 | */ |
||
40 | 54 | public function hasMatch($fromField, array $matchingList, PreferenceInterface $clientPref) |
|
44 | |||
45 | /** |
||
46 | * @inheritDoc |
||
47 | */ |
||
48 | 36 | public function match($fromField, array $matchingList, PreferenceInterface $clientPref) |
|
66 | |||
67 | /** |
||
68 | * Returns the first index containing a matching variant, or -1 if not present. |
||
69 | * |
||
70 | * @param MatchedPreferenceInterface[] $matchingList |
||
71 | * @param PreferenceInterface $pref |
||
72 | * |
||
73 | * @return int |
||
74 | */ |
||
75 | 54 | private function getMatchingIndex(array $matchingList, PreferenceInterface $pref) |
|
87 | } |
||
88 |