| Total Complexity | 6 |
| Total Lines | 72 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 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) |
|
| 46 | { |
||
| 47 | 107 | $this->variant = $variant; |
|
| 48 | 107 | $this->qFactor = $qFactor; |
|
| 49 | 107 | $this->precedence = $precedence; |
|
| 50 | 107 | } |
|
| 51 | |||
| 52 | /** |
||
| 53 | * @inheritDoc |
||
| 54 | */ |
||
| 55 | 79 | public function getVariant() |
|
| 58 | } |
||
| 59 | |||
| 60 | /** |
||
| 61 | * @inheritDoc |
||
| 62 | */ |
||
| 63 | 68 | public function getPrecedence() |
|
| 64 | { |
||
| 65 | 68 | return $this->precedence; |
|
| 66 | } |
||
| 67 | |||
| 68 | /** |
||
| 69 | * @inheritDoc |
||
| 70 | */ |
||
| 71 | 78 | public function getQualityFactor() |
|
| 74 | } |
||
| 75 | |||
| 76 | /** |
||
| 77 | * @inheritDoc |
||
| 78 | */ |
||
| 79 | 9 | public function __toString() |
|
| 88 |