Skip to content

Commit a6a96c0

Browse files
lesstifStyleCIBot
andauthored
Apply fixes from StyleCI (#546)
[ci skip] [skip ci] Co-authored-by: StyleCI Bot <bot@styleci.io>
1 parent 46b2040 commit a6a96c0

17 files changed

+28
-19
lines changed

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 \JiraRestApi\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/Board/BoardService.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class BoardService extends \JiraRestApi\JiraClient
1414

1515
private $agileVersion = '1.0';
1616

17-
public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './')
17+
public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './')
1818
{
1919
parent::__construct($configuration, $logger, $path);
2020
$this->setAPIUri('/rest/agile/'.$this->agileVersion);
@@ -51,20 +51,22 @@ public function getBoardList($paramArray = []): ?\ArrayObject
5151
*
5252
* @param array $paramArray
5353
*
54-
* @return PaginatedResult|null array of Board class
55-
*@throws \JiraRestApi\JiraException
54+
* @throws \JiraRestApi\JiraException
5655
*
56+
* @return PaginatedResult|null array of Board class
5757
*/
5858
public function getBoards($paramArray = []): ?PaginatedResult
5959
{
6060
$json = $this->exec($this->uri.$this->toHttpQueryParameter($paramArray), null);
61+
6162
try {
6263
return $this->json_mapper->map(
6364
json_decode($json, false, 512, $this->getJsonOptions()),
6465
new PaginatedResult()
6566
);
6667
} catch (\JsonException $exception) {
6768
$this->log->error("Response cannot be decoded from json\nException: {$exception->getMessage()}");
69+
6870
return null;
6971
}
7072
}
@@ -165,6 +167,7 @@ public function getSprintsForBoard($boardId, $paramArray = []): ?PaginatedResult
165167
);
166168
} catch (\JsonException $exception) {
167169
$this->log->error("Response cannot be decoded from json\nException: {$exception->getMessage()}");
170+
168171
return null;
169172
}
170173
}

src/Board/PaginatedResult.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
namespace JiraRestApi\Board;
44

55
/**
6-
* Paginated Result object for BoardService
6+
* Paginated Result object for BoardService.
77
*/
88
class PaginatedResult
99
{

src/Configuration/ArrayConfiguration.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Created by PhpStorm.
45
* User: keanor

src/Configuration/ConfigurationInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Created by PhpStorm.
45
* User: keanor

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 \JiraRestApi\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
@@ -11,7 +11,7 @@ class AgileIssueService extends \JiraRestApi\JiraClient
1111

1212
private $agileVersion = '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->agileVersion);

src/Issue/IssueSearchResult.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Created by PhpStorm.
45
* User: keanor

src/Issue/TimeTracking.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Created by PhpStorm.
45
* User: keanor

src/JiraClient.php

Lines changed: 4 additions & 4 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')) {
@@ -188,7 +188,7 @@ protected function filterNullVariable(array $haystack): array
188188
*
189189
* @return string|bool
190190
*/
191-
public function exec(string $context, array|string $post_data = null, string $custom_request = null, string $cookieFile = null): string|bool
191+
public function exec(string $context, array|string|null $post_data = null, ?string $custom_request = null, ?string $cookieFile = null): string|bool
192192
{
193193
$url = $this->createUrlByContext($context);
194194

@@ -441,7 +441,7 @@ protected function createUrlByContext(string $context): string
441441
/**
442442
* Add authorize to curl request.
443443
*/
444-
protected function authorization(\CurlHandle $ch, array &$curl_http_headers, string $cookieFile = null): void
444+
protected function authorization(\CurlHandle $ch, array &$curl_http_headers, ?string $cookieFile = null): void
445445
{
446446
// use cookie
447447
if ($this->getConfiguration()->isCookieAuthorizationEnabled()) {
@@ -516,7 +516,7 @@ public function toHttpQueryParameter(array $paramArray, bool $dropNullKey = true
516516
/**
517517
* download and save into outDir.
518518
*/
519-
public function download(string $url, string $outDir, string $file, string $cookieFile = null): mixed
519+
public function download(string $url, string $outDir, string $file, ?string $cookieFile = null): mixed
520520
{
521521
$curl_http_header = [
522522
'Accept: */*',

0 commit comments

Comments
 (0)