Skip to content
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

Fix implicit nullable types to avoid PHP 8.4 warnings #1144

Merged
merged 6 commits into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
{
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