1
0
Fork 0
mirror of https://github.com/DanielnetoDotCom/YouPHPTube synced 2025-10-03 01:39:24 +02:00

Refactor and enhance type hinting across various classes in the Swagger-PHP library

- Updated error handling in TokenScanner to use more descriptive variable names.
- Added return type declarations for methods in Analysis, AbstractAnnotation, Components, Items, License, OpenApi, Operation, Parameter, Response, Schema, Context, Generator, and several processors to improve code clarity and type safety.
- Introduced new PipeOperatorEmulator and VoidCastEmulator classes to support PHP 8.5 features.
- Implemented Pipe binary operator and Void cast node classes to enhance the parser's capabilities.
- Improved array filtering and lambda function type hints for better readability and performance.
- Enhanced the handling of annotations and context in various processors to ensure consistent behavior and reduce potential errors.
This commit is contained in:
Daniel Neto 2025-08-12 11:19:47 -03:00
parent 4a540ee196
commit 7c9f95b33d
106 changed files with 4068 additions and 3509 deletions

View file

@ -267,6 +267,11 @@ class CurlClient implements ClientInterface, StreamingClientInterface
if ($body) {
$opts[\CURLOPT_POSTFIELDS] = $body;
}
// inspired by https://github.com/stripe/stripe-php/issues/1817#issuecomment-2670463182
elseif (isset($opts[\CURLOPT_POST]) && 1 === $opts[\CURLOPT_POST]) {
$opts[\CURLOPT_POSTFIELDS] = '';
}
// this is a little verbose, but makes v1 vs v2 behavior really clear
if (!$this->hasHeader($headers, 'Idempotency-Key')) {
// all v2 requests should have an IK