1 | <?php namespace Neomerx\JsonApi\Http\Headers; |
||
26 | class AcceptMediaType extends MediaType implements AcceptMediaTypeInterface |
||
27 | { |
||
28 | /** |
||
29 | * @var float [0..1] |
||
30 | */ |
||
31 | private $quality; |
||
32 | |||
33 | /** |
||
34 | * @var int |
||
35 | */ |
||
36 | private $position; |
||
37 | |||
38 | /** |
||
39 | * @param int $position |
||
40 | * @param string $type |
||
41 | * @param string $subType |
||
42 | * @param array<string,string>|null $parameters |
||
43 | * @param float $quality |
||
44 | */ |
||
45 | 23 | public function __construct( |
|
68 | |||
69 | /** |
||
70 | * @inheritdoc |
||
71 | */ |
||
72 | 4 | public function getPosition(): int |
|
76 | |||
77 | /** |
||
78 | * @inheritdoc |
||
79 | */ |
||
80 | 16 | public function getQuality(): float |
|
84 | |||
85 | /** |
||
86 | * @return Closure |
||
87 | */ |
||
88 | public static function getCompare(): Closure |
||
114 | |||
115 | /** |
||
116 | * @param float $lhs |
||
117 | * @param float $rhs |
||
118 | * |
||
119 | * @return int |
||
120 | * |
||
121 | * @SuppressWarnings(PHPMD.ElseExpression) |
||
122 | */ |
||
123 | 10 | private static function compareQuality(float $lhs, float $rhs): int |
|
134 | |||
135 | /** |
||
136 | * @param string $lhs |
||
137 | * @param string $rhs |
||
138 | * |
||
139 | * @return int |
||
140 | */ |
||
141 | 7 | private static function compareStrings(string $lhs, string $rhs): int |
|
145 | |||
146 | /** |
||
147 | * @param array|null $lhs |
||
148 | * @param array|null $rhs |
||
149 | * |
||
150 | * @return int |
||
151 | */ |
||
152 | 5 | private static function compareParameters(?array $lhs, ?array $rhs): int |
|
156 | } |
||
157 |