diff --git a/src/Attachment/AttachmentService.php b/src/Attachment/AttachmentService.php index 32873ff08a48ad1fed60e69080c3fe408bbe56cf..b7504babab4270eede4e944d2c9204b3369e1529 100644 --- a/src/Attachment/AttachmentService.php +++ b/src/Attachment/AttachmentService.php @@ -30,7 +30,7 @@ class AttachmentService extends \JiraCloud\JiraClient * * @return Attachment */ - public function get(int|string $id, string $outDir = null, bool $overwrite = false, int $mode = 0777, bool $recursive = true): Attachment + public function get(int|string $id, ?string $outDir = null, bool $overwrite = false, int $mode = 0777, bool $recursive = true): Attachment { $ret = $this->exec($this->uri.$id, null); diff --git a/src/Auth/AuthService.php b/src/Auth/AuthService.php index e9deafb1d49027d92c4374e0f33936a3797f2dfb..06490a761c74464302a5166a379f9b80befe7a1d 100644 --- a/src/Auth/AuthService.php +++ b/src/Auth/AuthService.php @@ -80,7 +80,7 @@ class AuthService extends \JiraCloud\JiraClient * @throws \Exception * @throws \JiraCloud\JiraException */ - public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './') + public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './') { parent::__construct($configuration, $logger, $path); $this->setAPIUri($this->auth_api_uri); diff --git a/src/Epic/EpicService.php b/src/Epic/EpicService.php index 5c1a83422fdab729910ecb19beef59aafe1f4bfe..b5a3bdc52fd1a00437837abe04be49696f903609 100644 --- a/src/Epic/EpicService.php +++ b/src/Epic/EpicService.php @@ -11,7 +11,7 @@ class EpicService extends \JiraCloud\JiraClient private $uri = '/epic'; private $version = '1.0'; - public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './') + public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './') { parent::__construct($configuration, $logger, $path); $this->setAPIUri('/rest/agile/'.$this->version); diff --git a/src/Issue/AgileIssueService.php b/src/Issue/AgileIssueService.php index 1de9adaeab27bcc02b2bb8e5ffdf44bc7f6a1822..dc2eefaf0398d9a057a17c8f747e7c208e61be60 100644 --- a/src/Issue/AgileIssueService.php +++ b/src/Issue/AgileIssueService.php @@ -9,7 +9,7 @@ class AgileIssueService extends \JiraCloud\JiraClient { private $uri = '/rest/agile/1.0'; - public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './') + public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './') { parent::__construct($configuration, $logger, $path); } diff --git a/src/Issue/IssueField.php b/src/Issue/IssueField.php index cdf3a7160b49262057c81f9538dd8a9611222a9f..0bd2925b488ce394da1f7ae6ce248febfdc95570 100644 --- a/src/Issue/IssueField.php +++ b/src/Issue/IssueField.php @@ -61,7 +61,7 @@ class IssueField implements \JsonSerializable public ?Reporter $assignee = null; /** @var \JiraCloud\Issue\Version[]|null */ - public array|null $versions = null; + public ?array $versions = null; /** @var \JiraCloud\Issue\Attachment[] */ public $attachment; diff --git a/src/Issue/IssueService.php b/src/Issue/IssueService.php index 62f6a86b5a48a1b3569374504b0d991135de2779..d0da5337a473adf11f001dc4b54103655513486c 100644 --- a/src/Issue/IssueService.php +++ b/src/Issue/IssueService.php @@ -39,7 +39,7 @@ class IssueService extends \JiraCloud\JiraClient * * @return Issue class */ - public function get(int|string $issueIdOrKey, array $paramArray = [], Issue $issueObject = null): Issue + public function get(int|string $issueIdOrKey, array $paramArray = [], ?Issue $issueObject = null): Issue { $issueObject = ($issueObject) ? $issueObject : new Issue(); diff --git a/src/Issue/Reporter.php b/src/Issue/Reporter.php index deb4b714bc87053ac85c5daaca6d6745964776c9..1727f2ac75a3e31eb5a4aa72ae43bba18d478dcb 100644 --- a/src/Issue/Reporter.php +++ b/src/Issue/Reporter.php @@ -14,7 +14,7 @@ class Reporter implements \JsonSerializable public ?string $emailAddress = null; - public array|null $avatarUrls; + public ?array $avatarUrls; public string $displayName; diff --git a/src/JiraClient.php b/src/JiraClient.php index 7ecd4145cab1001d47d8a2ab8bd59162ced6b4d2..6e9ce020e3b230c9e2deb34d6c7ce5b443f58cbe 100644 --- a/src/JiraClient.php +++ b/src/JiraClient.php @@ -59,7 +59,7 @@ class JiraClient * * @throws JiraException */ - public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, string $path = './') + public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, string $path = './') { if ($configuration === null) { if (!file_exists($path.'.env')) { @@ -186,7 +186,7 @@ class JiraClient * * @return string|bool */ - public function exec(string $context, array|string $post_data = null, string $custom_request = null, string $cookieFile = null): string|bool + public function exec(string $context, array|string|null $post_data = null, ?string $custom_request = null, ?string $cookieFile = null): string|bool { $url = $this->createUrlByContext($context); @@ -236,8 +236,8 @@ class JiraClient curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); } - // See https://github.com/php/php-src/issues/14184 - // curl_setopt($ch, CURLOPT_ENCODING, ''); + // See https://github.com/php/php-src/issues/14184 + // curl_setopt($ch, CURLOPT_ENCODING, ''); curl_setopt( $ch, @@ -405,7 +405,7 @@ class JiraClient /** * Add authorize to curl request. */ - protected function authorization(\CurlHandle $ch, array &$curl_http_headers, string $cookieFile = null): void + protected function authorization(\CurlHandle $ch, array &$curl_http_headers, ?string $cookieFile = null): void { // use cookie if ($this->getConfiguration()->isCookieAuthorizationEnabled()) { @@ -472,7 +472,7 @@ class JiraClient /** * download and save into outDir. */ - public function download(string $url, string $outDir, string $file, string $cookieFile = null): mixed + public function download(string $url, string $outDir, string $file, ?string $cookieFile = null): mixed { $curl_http_header = [ 'Accept: */*', diff --git a/src/JiraException.php b/src/JiraException.php index ec7aebf939b29f336d4fdb9024dff5366555f809..d69b1ce79db7b72ec752a137d2301d43f7f22b62 100644 --- a/src/JiraException.php +++ b/src/JiraException.php @@ -17,7 +17,7 @@ class JiraException extends \Exception /** * Create a new Jira exception instance. */ - public function __construct(?string $message = null, int $code = 0, \Throwable $previous = null, string $response = null) + public function __construct(?string $message = null, int $code = 0, ?\Throwable $previous = null, ?string $response = null) { parent::__construct($message, $code, $previous); diff --git a/src/RapidCharts/ScopeChangeBurnDownChartService.php b/src/RapidCharts/ScopeChangeBurnDownChartService.php index 7700a4ff047e0011d529f20a8ccd08f07bab8579..6a68b35446ca1c790769dc05c88e6ebe6e4d7704 100644 --- a/src/RapidCharts/ScopeChangeBurnDownChartService.php +++ b/src/RapidCharts/ScopeChangeBurnDownChartService.php @@ -12,7 +12,7 @@ class ScopeChangeBurnDownChartService extends \JiraCloud\JiraClient private $uri = '/rapid/charts/scopechangeburndownchart'; - public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './') + public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './') { parent::__construct($configuration, $logger, $path); $this->setupAPIUri(); diff --git a/src/Request/RequestService.php b/src/Request/RequestService.php index f346bf895c1ed156874f7144b93f08de25cfb2fe..9e87f925a01d2c5e58ec032e0f1796e3c998421b 100644 --- a/src/Request/RequestService.php +++ b/src/Request/RequestService.php @@ -23,7 +23,7 @@ class RequestService extends \JiraCloud\JiraClient * @throws JiraException * @throws \Exception */ - public function __construct(ConfigurationInterface $configuration = null, LoggerInterface $logger = null, $path = './') + public function __construct(?ConfigurationInterface $configuration = null, ?LoggerInterface $logger = null, $path = './') { parent::__construct($configuration, $logger, $path); $this->setupAPIUri(); diff --git a/src/ServiceDesk/Request/RequestService.php b/src/ServiceDesk/Request/RequestService.php index 007e445a2621f3b30c46ba3f4b9ee338390623e4..906498dc044095e49df112bcc81973ff4dc3b37c 100644 --- a/src/ServiceDesk/Request/RequestService.php +++ b/src/ServiceDesk/Request/RequestService.php @@ -65,7 +65,7 @@ class RequestService * * @see https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/request-getCustomerRequestByIdOrKey */ - public function get(string $issueId, array $expandParameters = [], Request $request = null): Request + public function get(string $issueId, array $expandParameters = [], ?Request $request = null): Request { $request = ($request) ?: new Request(); @@ -88,7 +88,7 @@ class RequestService * * @see https://docs.atlassian.com/jira-servicedesk/REST/3.6.2/#servicedeskapi/request-getMyCustomerRequests */ - public function getRequestsByCustomer(Customer $customer, array $searchParameters, int $serviceDeskId = null): array + public function getRequestsByCustomer(Customer $customer, array $searchParameters, ?int $serviceDeskId = null): array { $defaultSearchParameters = [ 'requestOwnership' => 'OWNED_REQUESTS', diff --git a/src/ServiceDesk/ServiceDeskClient.php b/src/ServiceDesk/ServiceDeskClient.php index 0ed2aa32a0ecb23d6c003ce32fa7003d677a535e..9cabdbb73a1fdaca9702ed27e73211611dd17055 100644 --- a/src/ServiceDesk/ServiceDeskClient.php +++ b/src/ServiceDesk/ServiceDeskClient.php @@ -12,8 +12,8 @@ use Psr\Log\LoggerInterface; class ServiceDeskClient extends JiraClient { public function __construct( - ConfigurationInterface $configuration = null, - LoggerInterface $logger = null, + ?ConfigurationInterface $configuration = null, + ?LoggerInterface $logger = null, string $path = './' ) { parent::__construct($configuration, $logger, $path); diff --git a/src/Sprint/SprintSearchResult.php b/src/Sprint/SprintSearchResult.php index 69805ef7fea80fe24458a23184cda2a0eea52d92..13635886143f56084532a75086855e853be0bd55 100644 --- a/src/Sprint/SprintSearchResult.php +++ b/src/Sprint/SprintSearchResult.php @@ -1,4 +1,5 @@ setAPIUri('/rest/agile/1.0');