Skip to content

Commit

Permalink
Fix implicit nullable types to avoid PHP 8.4 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
eiriksm committed Sep 23, 2024
1 parent 71fec50 commit 9bd8e00
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion lib/Github/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Client
* @param string|null $apiVersion
* @param string|null $enterpriseUrl
*/
public function __construct(Builder $httpClientBuilder = null, $apiVersion = null, $enterpriseUrl = null)
public function __construct(?Builder $httpClientBuilder = null, $apiVersion = null, $enterpriseUrl = null)
{
$this->responseHistory = new History();
$this->httpClientBuilder = $builder = $httpClientBuilder ?? new Builder();
Expand Down
6 changes: 3 additions & 3 deletions lib/Github/HttpClient/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ class Builder
* @param StreamFactoryInterface|null $streamFactory
*/
public function __construct(
ClientInterface $httpClient = null,
RequestFactoryInterface $requestFactory = null,
StreamFactoryInterface $streamFactory = null
?ClientInterface $httpClient = null,
?RequestFactoryInterface $requestFactory = null,
?StreamFactoryInterface $streamFactory = null
) {
$this->httpClient = $httpClient ?? Psr18ClientDiscovery::find();
$this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory();
Expand Down
2 changes: 1 addition & 1 deletion lib/Github/ResultPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ResultPager implements ResultPagerInterface
*
* @return void
*/
public function __construct(Client $client, int $perPage = null)
public function __construct(?Client $client, ?int $perPage = null)

Check failure on line 62 in lib/Github/ResultPager.php

View workflow job for this annotation

GitHub Actions / Roave BC check

The parameter $client of Github\ResultPager#__construct() changed from Github\Client to Github\Client|null
{
if (null !== $perPage && ($perPage < 1 || $perPage > 100)) {
throw new ValueError(sprintf('%s::__construct(): Argument #2 ($perPage) must be between 1 and 100, or null', self::class));
Expand Down

0 comments on commit 9bd8e00

Please sign in to comment.