File tree Expand file tree Collapse file tree 4 files changed +12
-12
lines changed
modules/openapi-generator/src/main/resources/php-nextgen
php-nextgen-streaming/src
petstore/php-nextgen/OpenAPIClient-php/src Expand file tree Collapse file tree 4 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -157,11 +157,11 @@ class HeaderSelector
157157
158158 /**
159159 * @param array[] $headers
160- * @param float $currentWeight
160+ * @param int $currentWeight
161161 * @param bool $hasMoreThan28Headers
162162 * @return string[] array of adjusted "Accept" headers
163163 */
164- private function adjustWeight(array $headers, float & $currentWeight, bool $hasMoreThan28Headers): array
164+ private function adjustWeight(array $headers, int & $currentWeight, bool $hasMoreThan28Headers): array
165165 {
166166 usort($headers , function (array $a , array $b ) {
167167 return $b [' weight' ] - $a [' weight' ];
@@ -230,6 +230,6 @@ class HeaderSelector
230230 return $currentWeight - 1;
231231 }
232232
233- return $currentWeight - 10 ** floor( log10($currentWeight - 1) );
233+ return (int) ( $currentWeight - 10 ** floor( log10($currentWeight - 1) ) );
234234 }
235235}
Original file line number Diff line number Diff line change @@ -166,11 +166,11 @@ private function getHeaderAndWeight(string $header): array
166166
167167 /**
168168 * @param array[] $headers
169- * @param float $currentWeight
169+ * @param int $currentWeight
170170 * @param bool $hasMoreThan28Headers
171171 * @return string[] array of adjusted "Accept" headers
172172 */
173- private function adjustWeight (array $ headers , float &$ currentWeight , bool $ hasMoreThan28Headers ): array
173+ private function adjustWeight (array $ headers , int &$ currentWeight , bool $ hasMoreThan28Headers ): array
174174 {
175175 usort ($ headers , function (array $ a , array $ b ) {
176176 return $ b ['weight ' ] - $ a ['weight ' ];
@@ -239,6 +239,6 @@ public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): i
239239 return $ currentWeight - 1 ;
240240 }
241241
242- return $ currentWeight - 10 ** floor ( log10 ($ currentWeight - 1 ) );
242+ return ( int ) ( $ currentWeight - 10 ** floor ( log10 ($ currentWeight - 1 ) ) );
243243 }
244244}
Original file line number Diff line number Diff line change @@ -166,11 +166,11 @@ private function getHeaderAndWeight(string $header): array
166166
167167 /**
168168 * @param array[] $headers
169- * @param float $currentWeight
169+ * @param int $currentWeight
170170 * @param bool $hasMoreThan28Headers
171171 * @return string[] array of adjusted "Accept" headers
172172 */
173- private function adjustWeight (array $ headers , float &$ currentWeight , bool $ hasMoreThan28Headers ): array
173+ private function adjustWeight (array $ headers , int &$ currentWeight , bool $ hasMoreThan28Headers ): array
174174 {
175175 usort ($ headers , function (array $ a , array $ b ) {
176176 return $ b ['weight ' ] - $ a ['weight ' ];
@@ -239,6 +239,6 @@ public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): i
239239 return $ currentWeight - 1 ;
240240 }
241241
242- return $ currentWeight - 10 ** floor ( log10 ($ currentWeight - 1 ) );
242+ return ( int ) ( $ currentWeight - 10 ** floor ( log10 ($ currentWeight - 1 ) ) );
243243 }
244244}
Original file line number Diff line number Diff line change @@ -165,11 +165,11 @@ private function getHeaderAndWeight(string $header): array
165165
166166 /**
167167 * @param array[] $headers
168- * @param float $currentWeight
168+ * @param int $currentWeight
169169 * @param bool $hasMoreThan28Headers
170170 * @return string[] array of adjusted "Accept" headers
171171 */
172- private function adjustWeight (array $ headers , float &$ currentWeight , bool $ hasMoreThan28Headers ): array
172+ private function adjustWeight (array $ headers , int &$ currentWeight , bool $ hasMoreThan28Headers ): array
173173 {
174174 usort ($ headers , function (array $ a , array $ b ) {
175175 return $ b ['weight ' ] - $ a ['weight ' ];
@@ -238,6 +238,6 @@ public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): i
238238 return $ currentWeight - 1 ;
239239 }
240240
241- return $ currentWeight - 10 ** floor ( log10 ($ currentWeight - 1 ) );
241+ return ( int ) ( $ currentWeight - 10 ** floor ( log10 ($ currentWeight - 1 ) ) );
242242 }
243243}
You can’t perform that action at this time.
0 commit comments