1 | <?php |
||
14 | class Preference implements PreferenceInterface |
||
15 | { |
||
16 | /** |
||
17 | * The variant name. |
||
18 | * |
||
19 | * @var string |
||
20 | */ |
||
21 | private $variant; |
||
22 | |||
23 | /** |
||
24 | * The quality factor associated with this variant. |
||
25 | * |
||
26 | * @var float |
||
27 | */ |
||
28 | private $qFactor; |
||
29 | |||
30 | /** |
||
31 | * Precedence of the variant (full > partial wildcard > wildcard > absent). |
||
32 | * |
||
33 | * @var int |
||
34 | */ |
||
35 | protected $precedence; |
||
36 | |||
37 | |||
38 | /** |
||
39 | * Constructor |
||
40 | * |
||
41 | * @param string $variant |
||
42 | * @param float $qFactor |
||
43 | * @param int $precedence |
||
44 | */ |
||
45 | 107 | public function __construct($variant, $qFactor, $precedence) |
|
51 | |||
52 | /** |
||
53 | * @inheritDoc |
||
54 | */ |
||
55 | 79 | public function getVariant() |
|
59 | |||
60 | /** |
||
61 | * @inheritDoc |
||
62 | */ |
||
63 | 68 | public function getPrecedence() |
|
67 | |||
68 | /** |
||
69 | * @inheritDoc |
||
70 | */ |
||
71 | 78 | public function getQualityFactor() |
|
75 | |||
76 | /** |
||
77 | * @inheritDoc |
||
78 | */ |
||
79 | 9 | public function __toString() |
|
87 | } |
||
88 |