Skip to content
Closed
Show file tree
Hide file tree
Changes from all 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
4 changes: 2 additions & 2 deletions src/Api/Groups.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function show($id)
*
* @return mixed
*/
public function create(string $name, string $path, string $description = null, string $visibility = 'private', bool $lfs_enabled = null, bool $request_access_enabled = null, int $parent_id = null, int $shared_runners_minutes_limit = null)
public function create(string $name, string $path, ?string $description = null, string $visibility = 'private', ?bool $lfs_enabled = null, ?bool $request_access_enabled = null, ?int $parent_id = null, ?int $shared_runners_minutes_limit = null)
{
$params = [
'name' => $name,
Expand Down Expand Up @@ -917,7 +917,7 @@ private function getSubgroupSearchResolver()
*
* @return mixed
*/
public function deployTokens($group_id, bool $active = null)
public function deployTokens($group_id, ?bool $active = null)
{
return $this->get('groups/'.self::encodePath($group_id).'/deploy_tokens', (null !== $active) ? ['active' => $active] : []);
}
Expand Down
8 changes: 4 additions & 4 deletions src/Api/Projects.php
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ public function pipelineTestReportSummary($project_id, int $pipeline_id)
*
* @return mixed
*/
public function createPipeline($project_id, string $commit_ref, array $variables = null)
public function createPipeline($project_id, string $commit_ref, ?array $variables = null)
{
$parameters = [];

Expand Down Expand Up @@ -588,7 +588,7 @@ public function allMember($project_id, int $user_id)
*
* @return mixed
*/
public function addMember($project_id, int $user_id, int $access_level, string $expires_at = null)
public function addMember($project_id, int $user_id, int $access_level, ?string $expires_at = null)
{
$params = [
'user_id' => $user_id,
Expand All @@ -609,7 +609,7 @@ public function addMember($project_id, int $user_id, int $access_level, string $
*
* @return mixed
*/
public function saveMember($project_id, int $user_id, int $access_level, string $expires_at = null)
public function saveMember($project_id, int $user_id, int $access_level, ?string $expires_at = null)
{
$params = [
'access_level' => $access_level,
Expand Down Expand Up @@ -868,7 +868,7 @@ public function enableDeployKey($project_id, int $key_id)
*
* @return mixed
*/
public function deployTokens($project_id, bool $active = null)
public function deployTokens($project_id, ?bool $active = null)
{
return $this->get($this->getProjectPath($project_id, 'deploy_tokens'), (null !== $active) ? ['active' => $active] : []);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Api/Repositories.php
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ public function postCommitBuildStatus($project_id, string $sha, string $state, a
*
* @return mixed
*/
public function compare($project_id, string $fromShaOrMaster, string $toShaOrMaster, bool $straight = false, string $fromProjectId = null)
public function compare($project_id, string $fromShaOrMaster, string $toShaOrMaster, bool $straight = false, ?string $fromProjectId = null)
{
$params = [
'from' => $fromShaOrMaster,
Expand Down
4 changes: 2 additions & 2 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class Client
*
* @return void
*/
public function __construct(Builder $httpClientBuilder = null)
public function __construct(?Builder $httpClientBuilder = null)
{
$this->httpClientBuilder = $builder = $httpClientBuilder ?? new Builder();
$this->responseHistory = new History();
Expand Down Expand Up @@ -425,7 +425,7 @@ public function wiki(): Wiki
*
* @return void
*/
public function authenticate(string $token, string $authMethod, string $sudo = null): void
public function authenticate(string $token, string $authMethod, ?string $sudo = null): void
{
$this->getHttpClientBuilder()->removePlugin(Authentication::class);
$this->getHttpClientBuilder()->addPlugin(new Authentication($authMethod, $token, $sudo));
Expand Down
8 changes: 4 additions & 4 deletions src/HttpClient/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,10 @@ final class Builder
* @return void
*/
public function __construct(
ClientInterface $httpClient = null,
RequestFactoryInterface $requestFactory = null,
StreamFactoryInterface $streamFactory = null,
UriFactoryInterface $uriFactory = null
?ClientInterface $httpClient = null,
?RequestFactoryInterface $requestFactory = null,
?StreamFactoryInterface $streamFactory = null,
?UriFactoryInterface $uriFactory = null
) {
$this->httpClient = $httpClient ?? Psr18ClientDiscovery::find();
$this->requestFactory = $requestFactory ?? Psr17FactoryDiscovery::findRequestFactory();
Expand Down
4 changes: 2 additions & 2 deletions src/HttpClient/Plugin/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ final class Authentication implements Plugin
*
* @return void
*/
public function __construct(string $method, string $token, string $sudo = null)
public function __construct(string $method, string $token, ?string $sudo = null)
{
$this->headers = self::buildHeaders($method, $token, $sudo);
}
Expand Down Expand Up @@ -77,7 +77,7 @@ public function handleRequest(RequestInterface $request, callable $next, callabl
*
* @return array<string,string>
*/
private static function buildHeaders(string $method, string $token, string $sudo = null): array
private static function buildHeaders(string $method, string $token, ?string $sudo = null): array
{
$headers = [];

Expand Down
2 changes: 1 addition & 1 deletion src/ResultPager.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ final 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