1 | <?php declare(strict_types=1); |
||
28 | class AcceptMediaType extends MediaType implements AcceptMediaTypeInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var float [0..1] |
||
32 | */ |
||
33 | private $quality; |
||
34 | |||
35 | /** |
||
36 | * @var int |
||
37 | */ |
||
38 | private $position; |
||
39 | |||
40 | /** |
||
41 | * @param int $position |
||
42 | * @param string $type |
||
43 | * @param string $subType |
||
44 | * @param array<string,string>|null $parameters |
||
45 | * @param float $quality |
||
46 | */ |
||
47 | 24 | public function __construct( |
|
70 | |||
71 | /** |
||
72 | * @inheritdoc |
||
73 | */ |
||
74 | 4 | public function getPosition(): int |
|
78 | |||
79 | /** |
||
80 | * @inheritdoc |
||
81 | */ |
||
82 | 16 | public function getQuality(): float |
|
86 | |||
87 | /** |
||
88 | * @return Closure |
||
89 | */ |
||
90 | 10 | public static function getCompare(): Closure |
|
116 | |||
117 | /** |
||
118 | * @param float $lhs |
||
119 | * @param float $rhs |
||
120 | * |
||
121 | * @return int |
||
122 | * |
||
123 | * @SuppressWarnings(PHPMD.ElseExpression) |
||
124 | */ |
||
125 | 10 | private static function compareQuality(float $lhs, float $rhs): int |
|
136 | |||
137 | /** |
||
138 | * @param string $lhs |
||
139 | * @param string $rhs |
||
140 | * |
||
141 | * @return int |
||
142 | */ |
||
143 | 7 | private static function compareStrings(string $lhs, string $rhs): int |
|
147 | |||
148 | /** |
||
149 | * @param array|null $lhs |
||
150 | * @param array|null $rhs |
||
151 | * |
||
152 | * @return int |
||
153 | */ |
||
154 | 5 | private static function compareParameters(?array $lhs, ?array $rhs): int |
|
158 | } |
||
159 |