Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/Auth/AuthService.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function getSessionCookieValue()
* @throws \Exception
* @throws \JiraRestApi\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);
Expand Down
9 changes: 6 additions & 3 deletions src/Board/BoardService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BoardService extends \JiraRestApi\JiraClient

private $agileVersion = '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->agileVersion);
Expand Down Expand Up @@ -51,20 +51,22 @@ public function getBoardList($paramArray = []): ?\ArrayObject
*
* @param array $paramArray
*
* @return PaginatedResult|null array of Board class
*@throws \JiraRestApi\JiraException
* @throws \JiraRestApi\JiraException
*
* @return PaginatedResult|null array of Board class
*/
public function getBoards($paramArray = []): ?PaginatedResult
{
$json = $this->exec($this->uri.$this->toHttpQueryParameter($paramArray), null);

try {
return $this->json_mapper->map(
json_decode($json, false, 512, $this->getJsonOptions()),
new PaginatedResult()
);
} catch (\JsonException $exception) {
$this->log->error("Response cannot be decoded from json\nException: {$exception->getMessage()}");

return null;
}
}
Expand Down Expand Up @@ -165,6 +167,7 @@ public function getSprintsForBoard($boardId, $paramArray = []): ?PaginatedResult
);
} catch (\JsonException $exception) {
$this->log->error("Response cannot be decoded from json\nException: {$exception->getMessage()}");

return null;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Board/PaginatedResult.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace JiraRestApi\Board;

/**
* Paginated Result object for BoardService
* Paginated Result object for BoardService.
*/
class PaginatedResult
{
Expand Down
1 change: 1 addition & 0 deletions src/Configuration/ArrayConfiguration.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: keanor
Expand Down
1 change: 1 addition & 0 deletions src/Configuration/ConfigurationInterface.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: keanor
Expand Down
2 changes: 1 addition & 1 deletion src/Epic/EpicService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class EpicService extends \JiraRestApi\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);
Expand Down
2 changes: 1 addition & 1 deletion src/Issue/AgileIssueService.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class AgileIssueService extends \JiraRestApi\JiraClient

private $agileVersion = '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->agileVersion);
Expand Down
1 change: 1 addition & 0 deletions src/Issue/IssueSearchResult.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: keanor
Expand Down
1 change: 1 addition & 0 deletions src/Issue/TimeTracking.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: keanor
Expand Down
8 changes: 4 additions & 4 deletions src/JiraClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down Expand Up @@ -188,7 +188,7 @@ protected function filterNullVariable(array $haystack): array
*
* @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);

Expand Down Expand Up @@ -441,7 +441,7 @@ protected function createUrlByContext(string $context): string
/**
* 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()) {
Expand Down Expand Up @@ -516,7 +516,7 @@ public function toHttpQueryParameter(array $paramArray, bool $dropNullKey = true
/**
* 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: */*',
Expand Down
3 changes: 2 additions & 1 deletion src/JiraException.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: keanor
Expand All @@ -23,7 +24,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);

Expand Down
2 changes: 1 addition & 1 deletion src/RapidCharts/ScopeChangeBurnDownChartService.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class ScopeChangeBurnDownChartService extends \JiraRestApi\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();
Expand Down
2 changes: 1 addition & 1 deletion src/Request/RequestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class RequestService extends \JiraRestApi\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();
Expand Down
4 changes: 2 additions & 2 deletions src/ServiceDesk/Request/RequestService.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public function getRequestFromJSON(object $jsonData): Request
*
* @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();

Expand All @@ -88,7 +88,7 @@ public function get(string $issueId, array $expandParameters = [], Request $requ
*
* @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',
Expand Down
4 changes: 2 additions & 2 deletions src/ServiceDesk/ServiceDeskClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
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);
Expand Down
1 change: 1 addition & 0 deletions src/Sprint/SprintSearchResult.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

/**
* Created by PhpStorm.
* User: keanor
Expand Down
2 changes: 1 addition & 1 deletion src/Sprint/SprintService.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class SprintService extends JiraClient
{
private $uri = '/sprint';

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/1.0');
Expand Down