Skip to content

Commit aeb388b

Browse files
lesstifStyleCIBot
andauthored
Apply fixes from StyleCI (#96)
Co-authored-by: StyleCI Bot <bot@styleci.io>
1 parent 256ec65 commit aeb388b

15 files changed

Lines changed: 22 additions & 21 deletions

src/Attachment/AttachmentService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class AttachmentService extends \JiraCloud\JiraClient
3030
*
3131
* @return Attachment
3232
*/
33-
public function get(int|string $id, string $outDir = null, bool $overwrite = false, int $mode = 0777, bool $recursive = true): Attachment
33+
public function get(int|string $id, ?string $outDir = null, bool $overwrite = false, int $mode = 0777, bool $recursive = true): Attachment
3434
{
3535
$ret = $this->exec($this->uri.$id, null);
3636

src/Auth/AuthService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public function getSessionCookieValue()
8080
* @throws \Exception
8181
* @throws \JiraCloud\JiraException
8282
*/
83-
public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './')
83+
public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './')
8484
{
8585
parent::__construct($configuration, $logger, $path);
8686
$this->setAPIUri($this->auth_api_uri);

src/Epic/EpicService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class EpicService extends \JiraCloud\JiraClient
1111
private $uri = '/epic';
1212
private $version = '1.0';
1313

14-
public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './')
14+
public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './')
1515
{
1616
parent::__construct($configuration, $logger, $path);
1717
$this->setAPIUri('/rest/agile/'.$this->version);

src/Issue/AgileIssueService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class AgileIssueService extends \JiraCloud\JiraClient
99
{
1010
private $uri = '/rest/agile/1.0';
1111

12-
public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './')
12+
public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './')
1313
{
1414
parent::__construct($configuration, $logger, $path);
1515
}

src/Issue/IssueField.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class IssueField implements \JsonSerializable
6161
public ?Reporter $assignee = null;
6262

6363
/** @var \JiraCloud\Issue\Version[]|null */
64-
public array|null $versions = null;
64+
public ?array $versions = null;
6565

6666
/** @var \JiraCloud\Issue\Attachment[] */
6767
public $attachment;

src/Issue/IssueService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function getIssueFromJSON($json): Issue
3939
*
4040
* @return Issue class
4141
*/
42-
public function get(int|string $issueIdOrKey, array $paramArray = [], Issue $issueObject = null): Issue
42+
public function get(int|string $issueIdOrKey, array $paramArray = [], ?Issue $issueObject = null): Issue
4343
{
4444
$issueObject = ($issueObject) ? $issueObject : new Issue();
4545

src/Issue/Reporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class Reporter implements \JsonSerializable
1414

1515
public ?string $emailAddress = null;
1616

17-
public array|null $avatarUrls;
17+
public ?array $avatarUrls;
1818

1919
public string $displayName;
2020

src/JiraClient.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class JiraClient
5959
*
6060
* @throws JiraException
6161
*/
62-
public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, string $path = './')
62+
public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, string $path = './')
6363
{
6464
if ($configuration === null) {
6565
if (!file_exists($path.'.env')) {
@@ -186,7 +186,7 @@ protected function filterNullVariable(array $haystack): array
186186
*
187187
* @return string|bool
188188
*/
189-
public function exec(string $context, array|string $post_data = null, string $custom_request = null, string $cookieFile = null): string|bool
189+
public function exec(string $context, array|string|null $post_data = null, ?string $custom_request = null, ?string $cookieFile = null): string|bool
190190
{
191191
$url = $this->createUrlByContext($context);
192192

@@ -236,8 +236,8 @@ public function exec(string $context, array|string $post_data = null, string $cu
236236
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
237237
}
238238

239-
// See https://github.com/php/php-src/issues/14184
240-
// curl_setopt($ch, CURLOPT_ENCODING, '');
239+
// See https://github.com/php/php-src/issues/14184
240+
// curl_setopt($ch, CURLOPT_ENCODING, '');
241241

242242
curl_setopt(
243243
$ch,
@@ -405,7 +405,7 @@ protected function createUrlByContext(string $context): string
405405
/**
406406
* Add authorize to curl request.
407407
*/
408-
protected function authorization(\CurlHandle $ch, array &$curl_http_headers, string $cookieFile = null): void
408+
protected function authorization(\CurlHandle $ch, array &$curl_http_headers, ?string $cookieFile = null): void
409409
{
410410
// use cookie
411411
if ($this->getConfiguration()->isCookieAuthorizationEnabled()) {
@@ -472,7 +472,7 @@ public function toHttpQueryParameter(array $paramArray): string
472472
/**
473473
* download and save into outDir.
474474
*/
475-
public function download(string $url, string $outDir, string $file, string $cookieFile = null): mixed
475+
public function download(string $url, string $outDir, string $file, ?string $cookieFile = null): mixed
476476
{
477477
$curl_http_header = [
478478
'Accept: */*',

src/JiraException.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class JiraException extends \Exception
1717
/**
1818
* Create a new Jira exception instance.
1919
*/
20-
public function __construct(?string $message = null, int $code = 0, \Throwable $previous = null, string $response = null)
20+
public function __construct(?string $message = null, int $code = 0, ?\Throwable $previous = null, ?string $response = null)
2121
{
2222
parent::__construct($message, $code, $previous);
2323

src/RapidCharts/ScopeChangeBurnDownChartService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class ScopeChangeBurnDownChartService extends \JiraCloud\JiraClient
1212

1313
private $uri = '/rapid/charts/scopechangeburndownchart';
1414

15-
public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './')
15+
public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './')
1616
{
1717
parent::__construct($configuration, $logger, $path);
1818
$this->setupAPIUri();

0 commit comments

Comments
 (0)