Skip to content

Commit

Permalink
Compatibility with PHP 8.4 deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
srjlewis committed Oct 10, 2024
1 parent 47da3ff commit 90a8f44
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 19 deletions.
10 changes: 5 additions & 5 deletions src/JsonRPC/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,16 @@ class Client
* Constructor
*
* @access public
* @param string $url Server URL
* @param bool $returnException Return exceptions
* @param HttpClient $httpClient HTTP client object
* @param string $url Server URL
* @param bool $returnException Return exceptions
* @param HttpClient|null $httpClient HTTP client object
* @param ResponseParserInterface|null $responseParser
*/
public function __construct(
$url = '',
$returnException = false,
HttpClient $httpClient = null,
ResponseParserInterface $responseParser = null
?HttpClient $httpClient = null,
?ResponseParserInterface $responseParser = null
) {
$this->httpClient = $httpClient ?: new HttpClient($url);
$this->returnException = $returnException;
Expand Down
28 changes: 14 additions & 14 deletions src/JsonRPC/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -129,24 +129,24 @@ class Server
* Constructor
*
* @access public
* @param string $request
* @param array $server
* @param ResponseBuilder $responseBuilder
* @param RequestParser $requestParser
* @param BatchRequestParser $batchRequestParser
* @param ProcedureHandler $procedureHandler
* @param MiddlewareHandler $middlewareHandler
* @param LoggerInterface $logger
* @param string $request
* @param array $server
* @param ResponseBuilder|null $responseBuilder
* @param RequestParser|null $requestParser
* @param BatchRequestParser|null $batchRequestParser
* @param ProcedureHandler|null $procedureHandler
* @param MiddlewareHandler|null $middlewareHandler
* @param LoggerInterface|null $logger
*/
public function __construct(
$request = '',
array $server = array(),
ResponseBuilder $responseBuilder = null,
RequestParser $requestParser = null,
BatchRequestParser $batchRequestParser = null,
ProcedureHandler $procedureHandler = null,
MiddlewareHandler $middlewareHandler = null,
LoggerInterface $logger = null
?ResponseBuilder $responseBuilder = null,
?RequestParser $requestParser = null,
?BatchRequestParser $batchRequestParser = null,
?ProcedureHandler $procedureHandler = null,
?MiddlewareHandler $middlewareHandler = null,
?LoggerInterface $logger = null
) {
if ($request !== '') {
$this->payload = json_decode($request, true);
Expand Down

0 comments on commit 90a8f44

Please sign in to comment.