-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change RequestInterface::getCurlPostFields()
return type from ?array
to array
#92
Conversation
RequestInterface::getCurlPostFields()
return type from `?arr…RequestInterface::getCurlPostFields()
return type from ?array
to array
#[Depends('testCanBeCrated')] | ||
public function testGetCurlPostFields(Request $request): void | ||
{ | ||
$this->assertIsArray($request->getCurlPostFields()); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not needed anymore, at is always an array
0e33d8b
to
dd3f3ee
Compare
src/Client/Request/Request.php
Outdated
*/ | ||
public function __construct( | ||
private readonly string $apiUrl, | ||
private readonly string $method, | ||
private readonly ?array $curlPostFields = null, | ||
private readonly ?array $curlPostFields = [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here no need for ?
, just array
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can review all instances of $request = new Request($client->buildApiUrl(), Request::GET);
and add []
as a third argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here no need for ?, just array?
Good catch
Maybe we can review all instances of $request = new Request($client->buildApiUrl(), Request::GET); and add [] as a third argument?
We can, but I would not, we need to keep the default value anyway, otherwise it is a BC break
dd3f3ee
to
92216ac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
Technically a BC break, but only if you created your own
Request
class, so low chance