|
40 | 40 | * @author OpenAPI Generator team |
41 | 41 | * |
42 | 42 | * @see https://openapi-generator.tech |
| 43 | + * |
| 44 | + * @no-named-arguments |
43 | 45 | */ |
44 | 46 | class HeaderSelector |
45 | 47 | { |
@@ -176,7 +178,7 @@ private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headers |
176 | 178 | ]; |
177 | 179 |
|
178 | 180 | foreach ($accept as $header) { |
179 | | - $headerData = $this->getHeaderAndWeight($header); |
| 181 | + $headerData = self::getHeaderAndWeight($header); |
180 | 182 |
|
181 | 183 | if (str_starts_with(strtolower($headerData['header']), strtolower('application/json'))) { |
182 | 184 | $processedHeaders['withApplicationJson'][] = $headerData; |
@@ -210,7 +212,7 @@ private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headers |
210 | 212 | * |
211 | 213 | * @return array with the header and its weight |
212 | 214 | */ |
213 | | - private function getHeaderAndWeight(string $header): array |
| 215 | + private static function getHeaderAndWeight(string $header): array |
214 | 216 | { |
215 | 217 | // matches headers with weight, splitting the header and the weight in $outputArray |
216 | 218 | if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { |
@@ -249,15 +251,15 @@ private function adjustWeight(array $headers, int &$currentWeight, bool $hasMore |
249 | 251 |
|
250 | 252 | $weight = $currentWeight; |
251 | 253 |
|
252 | | - $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); |
| 254 | + $acceptHeaders[] = self::buildAcceptHeader($header['header'], $weight); |
253 | 255 | } |
254 | 256 |
|
255 | 257 | $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); |
256 | 258 |
|
257 | 259 | return $acceptHeaders; |
258 | 260 | } |
259 | 261 |
|
260 | | - private function buildAcceptHeader(string $header, int $weight): string |
| 262 | + private static function buildAcceptHeader(string $header, int $weight): string |
261 | 263 | { |
262 | 264 | if ($weight === 1000) { |
263 | 265 | return $header; |
|
0 commit comments