You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Related to ClientInterface itself and classes implementing it
PHP Deprecated: Optional parameter $data declared before required parameter $credential is implicitly treated as a required parameter in .../src/Jira/Api/Client/ClientInterface.php on line 53
PHP Deprecated: Optional parameter $data declared before required parameter $credential is implicitly treated as a required parameter in .../src/Jira/Api/Client/CurlClient.php on line 62
PHP Deprecated: Optional parameter $data declared before required parameter $credential is implicitly treated as a required parameter in .../src/Jira/Api/Client/PHPClient.php on line 95
PHP Deprecated: Optional parameter $method declared before required parameter $url is implicitly treated as a required parameter in .../src/Jira/Api.php on line 711
The @royarisse suggested some interesting ideas (see #205) about fixing:
remove the default value for the ClientInterface::sendRequest method's $data parameter
remove the default value for the Api::api method's $method parameter
I completely agree with 1st item (interface change) and I dare to remove default values from all parameters in the ClientInterface::sendRequest method signature, because:
when the Api class calls the class implementing the ClientInterface interface it will provide all parameters in each call
we're breaking BC anyway with the 2.0.0 release
I also agree with 2nd item, because the current library users (who use the master branch) are forced to specify the request method anyway.
The text was updated successfully, but these errors were encountered:
As @aik099 stated, even though these changes are good for getting it all working in >=8.1, it breaks <8.1.
I see the only solution would be a (dirty imo) compat loader.
This requires a change in composer.json, something like:
I currently don't have the time to complete this, but I think this is the only way for now, as the signatures for Iterator and Countable are changed in PHP>=8.1.
Currently, I'm getting a bunch of deprecations about methods having optional parameters declared before required ones ( see https://github.com/console-helpers/jira-api-restclient/actions/runs/12379854881/job/34554938237 ).
Related to
ClientInterface
itself and classes implementing itRelated to the
Api
classThe @royarisse suggested some interesting ideas (see #205) about fixing:
ClientInterface::sendRequest
method's$data
parameterApi::api
method's$method
parameterI completely agree with 1st item (interface change) and I dare to remove default values from all parameters in the
ClientInterface::sendRequest
method signature, because:Api
class calls the class implementing theClientInterface
interface it will provide all parameters in each callI also agree with 2nd item, because the current library users (who use the
master
branch) are forced to specify the request method anyway.The text was updated successfully, but these errors were encountered: