From d970aa5ebb86a0447b12b1a0349a8dde61338594 Mon Sep 17 00:00:00 2001 From: KwangSeob Jeong Date: Sat, 4 Jun 2022 22:02:47 +0900 Subject: [PATCH] Apply fixes from StyleCI (#437) [ci skip] [skip ci] Co-authored-by: StyleCI Bot --- src/AssigneeTypeEnum.php | 6 +- src/ClassSerialize.php | 4 +- src/Component/Component.php | 17 ++-- src/Configuration/AbstractConfiguration.php | 66 ++++++--------- src/Configuration/ConfigurationInterface.php | 21 ----- src/Configuration/DotEnvConfiguration.php | 9 +- src/Epic/EpicService.php | 1 - src/Issue/Issue.php | 1 - src/Issue/IssueField.php | 29 +++---- src/JiraClient.php | 89 ++++++++------------ src/JiraException.php | 4 +- src/Project/Project.php | 6 -- src/Project/ProjectService.php | 3 +- 13 files changed, 88 insertions(+), 168 deletions(-) diff --git a/src/AssigneeTypeEnum.php b/src/AssigneeTypeEnum.php index 27384ff..3444bbc 100644 --- a/src/AssigneeTypeEnum.php +++ b/src/AssigneeTypeEnum.php @@ -11,9 +11,9 @@ enum AssigneeTypeEnum public function type(): string { return match ($this) { - AssigneeTypeEnum::PROJECT_LEAD => 'PROJECT_LEAD', + AssigneeTypeEnum::PROJECT_LEAD => 'PROJECT_LEAD', AssigneeTypeEnum::COMPONENT_LEAD => 'COMPONENT_LEAD', - AssigneeTypeEnum::UNASSIGNED => 'UNASSIGNED', + AssigneeTypeEnum::UNASSIGNED => 'UNASSIGNED', }; } -} \ No newline at end of file +} diff --git a/src/ClassSerialize.php b/src/ClassSerialize.php index 2170b5c..7a540a8 100644 --- a/src/ClassSerialize.php +++ b/src/ClassSerialize.php @@ -12,7 +12,7 @@ trait ClassSerialize * * @return array */ - public function toArray(array $ignoreProperties = [], bool $excludeMode = true) : array + public function toArray(array $ignoreProperties = [], bool $excludeMode = true): array { $tmp = (get_object_vars($this)); $retAr = null; @@ -40,7 +40,7 @@ public function toArray(array $ignoreProperties = [], bool $excludeMode = true) * * @return string */ - public function toString(array $ignoreProperties = [], bool $excludeMode = true) :string + public function toString(array $ignoreProperties = [], bool $excludeMode = true): string { $ar = $this->toArray($ignoreProperties, $excludeMode); diff --git a/src/Component/Component.php b/src/Component/Component.php index 7ec83b2..f2be0a9 100644 --- a/src/Component/Component.php +++ b/src/Component/Component.php @@ -4,7 +4,6 @@ use JiraRestApi\AssigneeTypeEnum; use JiraRestApi\ClassSerialize; -use JiraRestApi\Project\Project; use JiraRestApi\User\User; /** @@ -38,54 +37,54 @@ class Component implements \JsonSerializable public bool $isAssigneeTypeValid; - public function getName() : string + public function getName(): string { return $this->name; } - public function setName(string $name) : static + public function setName(string $name): static { $this->name = $name; return $this; } - public function setDescription($description) : static + public function setDescription($description): static { $this->description = $description; return $this; } - public function setLeadUserName(string $leadUserName) : static + public function setLeadUserName(string $leadUserName): static { $this->leadUserName = $leadUserName; return $this; } - public function setAssigneeType(string $assigneeType) : static + public function setAssigneeType(string $assigneeType): static { $this->assigneeType = $assigneeType; return $this; } - public function setAssigneeTypeAsEnum(AssigneeTypeEnum $assigneeType) : static + public function setAssigneeTypeAsEnum(AssigneeTypeEnum $assigneeType): static { $this->assigneeType = $assigneeType->type(); return $this; } - public function setProjectKey(string $projectKey) : static + public function setProjectKey(string $projectKey): static { $this->project = $projectKey; return $this; } - public function setProject(string $project) : static + public function setProject(string $project): static { $this->project = $project; diff --git a/src/Configuration/AbstractConfiguration.php b/src/Configuration/AbstractConfiguration.php index f0b8da1..3105f91 100644 --- a/src/Configuration/AbstractConfiguration.php +++ b/src/Configuration/AbstractConfiguration.php @@ -21,73 +21,61 @@ abstract class AbstractConfiguration implements ConfigurationInterface /** * Curl options CURLOPT_SSL_VERIFYHOST. - * */ protected bool $curlOptSslVerifyHost; /** * Curl options CURLOPT_SSL_VERIFYPEER. - * */ protected bool $curlOptSslVerifyPeer; /** * Curl option CURLOPT_USERAGENT. - * */ protected string $curlOptUserAgent; /** * Curl options CURLOPT_VERBOSE. - * */ protected bool $curlOptVerbose; /** * HTTP header 'Authorization: Bearer {token}' for OAuth. - * */ protected ?string $oauthAccessToken; /** * enable cookie authorization. - * */ protected bool $cookieAuthEnabled; /** * HTTP cookie file name. - * */ protected ?string $cookieFile; /** * Proxy server. - * */ protected ?string $proxyServer; /** * Proxy port. - * */ protected ?string $proxyPort; /** * Proxy user. - * */ protected ?string $proxyUser; /** * Proxy password. - * */ protected ?string $proxyPassword; /** * Use Jira Cloud REST API v3. - * */ protected bool $useV3RestApi; @@ -105,142 +93,140 @@ abstract class AbstractConfiguration implements ConfigurationInterface protected ?string $personalAccessToken; - public function getJiraHost() :string + public function getJiraHost(): string { return $this->jiraHost; } - public function getJiraUser() :string + public function getJiraUser(): string { return $this->jiraUser; } - public function getJiraPassword() :string + public function getJiraPassword(): string { return $this->jiraPassword; } - public function getJiraLogEnabled() :bool + public function getJiraLogEnabled(): bool { return $this->jiraLogEnabled; } - public function getJiraLogFile() :string + public function getJiraLogFile(): string { return $this->jiraLogFile; } - public function getJiraLogLevel() :string + public function getJiraLogLevel(): string { return $this->jiraLogLevel; } - public function isCurlOptSslVerifyHost() :bool + public function isCurlOptSslVerifyHost(): bool { return $this->curlOptSslVerifyHost; } - public function isCurlOptSslVerifyPeer() :bool + public function isCurlOptSslVerifyPeer(): bool { return $this->curlOptSslVerifyPeer; } - public function isCurlOptSslCert() : ?string + public function isCurlOptSslCert(): ?string { return $this->curlOptSslCert; } - public function isCurlOptSslCertPassword() : ?string + public function isCurlOptSslCertPassword(): ?string { return $this->curlOptSslCertPassword; } - public function isCurlOptSslKey() : ?string + public function isCurlOptSslKey(): ?string { return $this->curlOptSslKey; } - public function isCurlOptSslKeyPassword() : ?string + public function isCurlOptSslKeyPassword(): ?string { return $this->curlOptSslKeyPassword; } - public function isCurlOptVerbose() :bool + public function isCurlOptVerbose(): bool { return $this->curlOptVerbose; } /** * Get curl option CURLOPT_USERAGENT. - * */ - public function getCurlOptUserAgent() : ?string + public function getCurlOptUserAgent(): ?string { return $this->curlOptUserAgent; } - public function getOAuthAccessToken() :string + public function getOAuthAccessToken(): string { return $this->oauthAccessToken; } - public function isCookieAuthorizationEnabled() :bool + public function isCookieAuthorizationEnabled(): bool { return $this->cookieAuthEnabled; } /** * get default User-Agent String. - * */ - public function getDefaultUserAgentString() :string + public function getDefaultUserAgentString(): string { $curlVersion = curl_version(); return sprintf('curl/%s (%s)', $curlVersion['version'], $curlVersion['host']); } - public function getCookieFile() : ?string + public function getCookieFile(): ?string { return $this->cookieFile; } - public function getProxyServer() : ?string + public function getProxyServer(): ?string { return $this->proxyServer; } - public function getProxyPort() : ?string + public function getProxyPort(): ?string { return $this->proxyPort; } - public function getProxyUser() : ?string + public function getProxyUser(): ?string { return $this->proxyUser; } - public function getProxyPassword() : ?string + public function getProxyPassword(): ?string { return $this->proxyPassword; } - public function getUseV3RestApi() :bool + public function getUseV3RestApi(): bool { return $this->useV3RestApi; } - public function getTimeout() :int + public function getTimeout(): int { return $this->timeout; } - public function isTokenBasedAuth() :bool + public function isTokenBasedAuth(): bool { return $this->useTokenBasedAuth; } - public function getPersonalAccessToken() :string + public function getPersonalAccessToken(): string { return $this->personalAccessToken; } diff --git a/src/Configuration/ConfigurationInterface.php b/src/Configuration/ConfigurationInterface.php index eac3f74..ac5db6a 100644 --- a/src/Configuration/ConfigurationInterface.php +++ b/src/Configuration/ConfigurationInterface.php @@ -15,49 +15,41 @@ interface ConfigurationInterface { /** * Jira host. - * */ public function getJiraHost(): string; /** * Jira login. - * */ public function getJiraUser(): string; /** * Jira password. - * */ public function getJiraPassword(): string; /** * Enabled write to log. - * */ public function getJiraLogEnabled(): bool; /** * Path to log file. - * */ public function getJiraLogFile(): string; /** * Log level (DEBUG, INFO, ERROR, WARNING). - * */ public function getJiraLogLevel(): string; /** * Curl options CURLOPT_SSL_VERIFYHOST. - * */ public function isCurlOptSslVerifyHost(): bool; /** * Curl options CURLOPT_SSL_VERIFYPEER. - * */ public function isCurlOptSslVerifyPeer(): bool; @@ -71,67 +63,56 @@ public function isCurlOptSslKeyPassword(): ?string; /** * Curl options CURLOPT_VERBOSE. - * */ public function isCurlOptVerbose(): bool; /** * Get curl option CURLOPT_USERAGENT. - * */ public function getCurlOptUserAgent(): ?string; /** * HTTP header 'Authorization: Bearer {token}' for OAuth. - * */ public function getOAuthAccessToken(): ?string; /** * Use cookie authorization. Login with username and password only once, then use session cookie. - * */ public function isCookieAuthorizationEnabled(): bool; /** * get HTTP cookie file name. - * */ public function getCookieFile(): mixed; /** * Proxy server. - * */ public function getProxyServer(): ?string; /** * Proxy port. - * */ public function getProxyPort(): ?string; /** * Proxy user. - * */ public function getProxyUser(): ?string; /** * Proxy password. - * */ public function getProxyPassword(): ?string; /** * use REST v3 API. - * */ public function getUseV3RestApi(): bool; /** * The number of seconds to wait while trying to connect. - * */ public function getTimeout(): int; @@ -139,13 +120,11 @@ public function getTimeout(): int; * check whether token based auth. * * @see https://confluence.atlassian.com/enterprise/using-personal-access-tokens-1026032365.html - * */ public function isTokenBasedAuth(): bool; /** * Personal Access Token. - * */ public function getPersonalAccessToken(): string; } diff --git a/src/Configuration/DotEnvConfiguration.php b/src/Configuration/DotEnvConfiguration.php index 7250a7c..0bba042 100644 --- a/src/Configuration/DotEnvConfiguration.php +++ b/src/Configuration/DotEnvConfiguration.php @@ -50,9 +50,8 @@ public function __construct(string $path = '.') /** * Gets the value of an environment variable. Supports boolean, empty and null. - * */ - private function env(string $key, mixed $default = null) :mixed + private function env(string $key, mixed $default = null): mixed { $value = $_ENV[$key] ?? null; @@ -87,9 +86,8 @@ private function env(string $key, mixed $default = null) :mixed /** * Determine if a given string starts with a given substring. - * */ - public function startsWith(string $haystack, array|string $needles) :bool + public function startsWith(string $haystack, array|string $needles): bool { foreach ((array) $needles as $needle) { if ($needle != '' && strpos($haystack, $needle) === 0) { @@ -102,7 +100,6 @@ public function startsWith(string $haystack, array|string $needles) :bool /** * Determine if a given string ends with a given substring. - * */ public function endsWith(string $haystack, array|string $needles): bool { @@ -117,7 +114,6 @@ public function endsWith(string $haystack, array|string $needles): bool /** * load dotenv. - * */ private function loadDotEnv(string $path) { @@ -133,5 +129,4 @@ private function loadDotEnv(string $path) $dotenv->required($requireParam); //} } - } diff --git a/src/Epic/EpicService.php b/src/Epic/EpicService.php index a3f4d49..6213cca 100644 --- a/src/Epic/EpicService.php +++ b/src/Epic/EpicService.php @@ -2,7 +2,6 @@ namespace JiraRestApi\Epic; -use JiraRestApi\AgileApiTrait; use JiraRestApi\Configuration\ConfigurationInterface; use JiraRestApi\Issue\AgileIssue; use Psr\Log\LoggerInterface; diff --git a/src/Issue/Issue.php b/src/Issue/Issue.php index 0b39077..71d3003 100644 --- a/src/Issue/Issue.php +++ b/src/Issue/Issue.php @@ -6,7 +6,6 @@ class Issue implements \JsonSerializable { /** * return only if Project query by key(not id). - * */ public ?string $expand; diff --git a/src/Issue/IssueField.php b/src/Issue/IssueField.php index 5e64f7e..5341b17 100644 --- a/src/Issue/IssueField.php +++ b/src/Issue/IssueField.php @@ -190,9 +190,8 @@ public function setSummary(string $summary) /** * set issue reporter name. - * */ - public function setReporterName(string $name) :static + public function setReporterName(string $name): static { if (is_null($this->reporter)) { $this->reporter = new Reporter(); @@ -205,9 +204,8 @@ public function setReporterName(string $name) :static /** * set issue reporter accountId. - * */ - public function setReporterAccountId(string $accountId) :static + public function setReporterAccountId(string $accountId): static { if (is_null($this->reporter)) { $this->reporter = new Reporter(); @@ -220,7 +218,6 @@ public function setReporterAccountId(string $accountId) :static /** * set issue assignee name. - * */ public function setAssigneeNameAsString(string $name): static { @@ -235,9 +232,8 @@ public function setAssigneeNameAsString(string $name): static /** * set issue assignee accountId. - * */ - public function setAssigneeAccountId(string $accountId) :static + public function setAssigneeAccountId(string $accountId): static { if (is_null($this->assignee)) { $this->assignee = new Reporter(); @@ -254,9 +250,8 @@ public function setAssigneeAccountId(string $accountId) :static /** * set issue priority name. - * */ - public function setPriorityNameAsString(string $name) : static + public function setPriorityNameAsString(string $name): static { if ($this->priority === null) { $this->priority = new Priority(); @@ -274,9 +269,8 @@ public function setPriorityNameAsString(string $name) : static * * @see \JiraRestApi\Issue\IssueFieldV3::addDescriptionHeading * @see \JiraRestApi\Issue\IssueFieldV3::addDescriptionParagraph - * */ - public function setDescription(?string $description) : static + public function setDescription(?string $description): static { if (!empty($description)) { $this->description = $description; @@ -287,7 +281,6 @@ public function setDescription(?string $description) : static /** * add a Affects version. - * */ public function addVersionAsString(string $version): static { @@ -351,9 +344,8 @@ public function getIssueType(): IssueType /** * set parent issue. - * */ - public function setParentKeyOrId(string $keyOrId) :static + public function setParentKeyOrId(string $keyOrId): static { if (is_null($this->parent)) { $this->parent = new Issue(); @@ -368,7 +360,7 @@ public function setParentKeyOrId(string $keyOrId) :static return $this; } - public function setParent(Issue $parent) : void + public function setParent(Issue $parent): void { $this->parent = $parent; } @@ -395,9 +387,8 @@ public function addComponentAsString(string $component): static /** * set security level. - * */ - public function setSecurityId(int $issue_security_id) :static + public function setSecurityId(int $issue_security_id): static { if (empty($this->security)) { $this->security = new SecurityScheme(); @@ -430,7 +421,7 @@ public function setDueDateAsDateTime(DateTimeInterface $duedate, $format = 'Y-m- * * @see https://confluence.atlassian.com/jirakb/how-to-set-assignee-to-unassigned-via-rest-api-in-jira-744721880.html */ - public function setAssigneeToUnassigned() : static + public function setAssigneeToUnassigned(): static { if (is_null($this->assignee)) { $this->assignee = new Reporter(); @@ -441,7 +432,7 @@ public function setAssigneeToUnassigned() : static return $this; } - public function setAssigneeToDefault() :static + public function setAssigneeToDefault(): static { if (is_null($this->assignee)) { $this->assignee = new Reporter(); diff --git a/src/JiraClient.php b/src/JiraClient.php index 74b5e60..f615eba 100644 --- a/src/JiraClient.php +++ b/src/JiraClient.php @@ -17,43 +17,36 @@ class JiraClient /** * Json Mapper. - * */ protected \JsonMapper $json_mapper; /** * HTTP response code. - * */ protected string|int $http_response; /** * JIRA REST API URI. - * */ private string $api_uri = '/rest/api/2'; /** * CURL instance. - * */ protected \CurlHandle $curl; /** * Monolog instance. - * */ protected LoggerInterface $log; /** * Jira Rest API Configuration. - * */ protected ConfigurationInterface $configuration; /** * json en/decode options. - * */ protected int $jsonOptions; @@ -61,8 +54,8 @@ class JiraClient * Constructor. * * @param ConfigurationInterface|null $configuration - * @param LoggerInterface|null $logger - * @param string $path + * @param LoggerInterface|null $logger + * @param string $path * * @throws JiraException */ @@ -128,27 +121,28 @@ public function __construct(ConfigurationInterface $configuration = null, Logger * * @return \Monolog\Level */ - private function convertLogLevel(string $log_level) : \Monolog\Level + private function convertLogLevel(string $log_level): \Monolog\Level { $log_level = strtoupper($log_level); return match ($log_level) { 'EMERGENCY' => \Monolog\Level::Emergency, - 'ALERT' => \Monolog\Level::Alert, - 'CRITICAL' => \Monolog\Level::Critical, - 'ERROR' => \Monolog\Level::Error, - 'WARNING' => \Monolog\Level::Warning, - 'NOTICE' => \Monolog\Level::Notice, - 'DEBUG' => \Monolog\Level::Debug, - 'INFO' => \Monolog\Level::Info, - default => \Monolog\Level::Warning, + 'ALERT' => \Monolog\Level::Alert, + 'CRITICAL' => \Monolog\Level::Critical, + 'ERROR' => \Monolog\Level::Error, + 'WARNING' => \Monolog\Level::Warning, + 'NOTICE' => \Monolog\Level::Notice, + 'DEBUG' => \Monolog\Level::Debug, + 'INFO' => \Monolog\Level::Info, + default => \Monolog\Level::Warning, }; } /** * @param \CurlHandle|bool $ch - * @param array $curl_http_headers - * @param string|null $cookieFile + * @param array $curl_http_headers + * @param string|null $cookieFile + * * @return array */ public function curlPrepare(\CurlHandle|bool $ch, array $curl_http_headers, ?string $cookieFile): array @@ -172,14 +166,14 @@ public function curlPrepare(\CurlHandle|bool $ch, array $curl_http_headers, ?str if ($this->getConfiguration()->getTimeout()) { curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $this->getConfiguration()->getTimeout()); } + return $curl_http_headers; } /** * Serialize only not null field. - * */ - protected function filterNullVariable(array $haystack) :array + protected function filterNullVariable(array $haystack): array { foreach ($haystack as $key => $value) { if (is_array($value)) { @@ -199,16 +193,16 @@ protected function filterNullVariable(array $haystack) :array /** * Execute REST request. * - * @param string $context Rest API context (ex.:issue, search, etc..) + * @param string $context Rest API context (ex.:issue, search, etc..) * @param array|string|null $post_data - * @param string|null $custom_request [PUT|DELETE] - * @param string|null $cookieFile cookie file + * @param string|null $custom_request [PUT|DELETE] + * @param string|null $cookieFile cookie file * - * @return string|bool * @throws JiraException * + * @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 $post_data = null, string $custom_request = null, string $cookieFile = null): string|bool { $url = $this->createUrlByContext($context); @@ -310,9 +304,8 @@ public function exec(string $context, array|string $post_data = null, string $cu /** * Create upload handle. - * */ - private function createUploadHandle(string $url, string $upload_file, \CurlHandle $ch) :\CurlHandle + private function createUploadHandle(string $url, string $upload_file, \CurlHandle $ch): \CurlHandle { $curl_http_headers = [ 'Accept: */*', @@ -390,9 +383,8 @@ private function createUploadHandle(string $url, string $upload_file, \CurlHandl /** * File upload. - * */ - public function upload(string $context, array $filePathArray) :array + public function upload(string $context, array $filePathArray): array { $url = $this->createUrlByContext($context); @@ -432,7 +424,7 @@ public function upload(string $context, array $filePathArray) :array return $results; } - protected function closeCURLHandle(array $chArr, \CurlMultiHandle $mh, string $body, int $result_code) :void + protected function closeCURLHandle(array $chArr, \CurlMultiHandle $mh, string $body, int $result_code): void { foreach ($chArr as $ch) { $this->log->debug('CURL Close handle..'); @@ -448,9 +440,8 @@ protected function closeCURLHandle(array $chArr, \CurlMultiHandle $mh, string $b /** * Get URL by context. - * */ - protected function createUrlByContext(string $context) :string + protected function createUrlByContext(string $context): string { $host = $this->getConfiguration()->getJiraHost(); @@ -459,7 +450,6 @@ protected function createUrlByContext(string $context) :string /** * Add authorize to curl request. - * */ protected function authorization(\CurlHandle $ch, array &$curl_http_headers, string $cookieFile = null): void { @@ -496,9 +486,8 @@ protected function authorization(\CurlHandle $ch, array &$curl_http_headers, str /** * Jira Rest API Configuration. - * */ - public function getConfiguration() :ConfigurationInterface + public function getConfiguration(): ConfigurationInterface { return $this->configuration; } @@ -508,7 +497,7 @@ public function getConfiguration() :ConfigurationInterface * * @param string $api_uri */ - public function setAPIUri($api_uri) :string + public function setAPIUri($api_uri): string { $this->api_uri = $api_uri; @@ -517,9 +506,8 @@ public function setAPIUri($api_uri) :string /** * convert to query array to http query parameter. - * */ - public function toHttpQueryParameter(array $paramArray) :string + public function toHttpQueryParameter(array $paramArray): string { $queryParam = '?'; @@ -541,9 +529,8 @@ public function toHttpQueryParameter(array $paramArray) :string /** * 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: */*', @@ -623,9 +610,8 @@ public function download(string $url, string $outDir, string $file, string $cook /** * setting cookie file path. - * */ - public function setCookieFile(string $cookieFile) :static + public function setCookieFile(string $cookieFile): static { $this->cookieFile = $cookieFile; @@ -634,9 +620,8 @@ public function setCookieFile(string $cookieFile) :static /** * Config a curl handle with proxy configuration (if set) from ConfigurationInterface. - * */ - private function proxyConfigCurlHandle(\CurlHandle $ch) :void + private function proxyConfigCurlHandle(\CurlHandle $ch): void { // Add proxy settings to the curl. if ($this->getConfiguration()->getProxyServer()) { @@ -651,9 +636,8 @@ private function proxyConfigCurlHandle(\CurlHandle $ch) :void /** * setting REST API url to V3. - * */ - public function setRestApiV3() :static + public function setRestApiV3(): static { $this->api_uri = '/rest/api/3'; @@ -662,18 +646,16 @@ public function setRestApiV3() :static /** * check whether current API is v3. - * */ - public function isRestApiV3() :bool + public function isRestApiV3(): bool { return $this->configuration->getUseV3RestApi(); } /** * setting JSON en/decoding options. - * */ - public function setJsonOptions(int $jsonOptions) :static + public function setJsonOptions(int $jsonOptions): static { $this->jsonOptions = $jsonOptions; @@ -682,9 +664,8 @@ public function setJsonOptions(int $jsonOptions) :static /** * get json en/decode options. - * */ - public function getJsonOptions() :int + public function getJsonOptions(): int { return $this->jsonOptions; } diff --git a/src/JiraException.php b/src/JiraException.php index 9981b57..db14260 100644 --- a/src/JiraException.php +++ b/src/JiraException.php @@ -22,7 +22,6 @@ 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) { @@ -33,9 +32,8 @@ public function __construct(?string $message = null, int $code = 0, \Throwable $ /** * Get error response. - * */ - public function getResponse() : ?string + public function getResponse(): ?string { return $this->response; } diff --git a/src/Project/Project.php b/src/Project/Project.php index f9a93c2..a0e93d9 100644 --- a/src/Project/Project.php +++ b/src/Project/Project.php @@ -12,31 +12,26 @@ class Project implements \JsonSerializable /** * return only if Project query by key(not id). - * */ public string $expand; /** * Project URI. - * */ public string $self; /** * Project id. - * */ public string $id; /** * Project key. - * */ public ?string $key; /** * Project name. - * */ public string $name; @@ -228,7 +223,6 @@ public function setCategoryId(int $categoryId): static /** * $assigneeType value available for "PROJECT_LEAD" and "UNASSIGNED". - * */ public function setAssigneeType(?string $assigneeType): static { diff --git a/src/Project/ProjectService.php b/src/Project/ProjectService.php index 97e6c69..6357753 100644 --- a/src/Project/ProjectService.php +++ b/src/Project/ProjectService.php @@ -257,9 +257,8 @@ public function getVersionsPagenated($projectIdOrKey, $queryParam = []) /** * get specified's project versions. - * */ - public function getVersions(string $projectIdOrKey) : \ArrayObject + public function getVersions(string $projectIdOrKey): \ArrayObject { $ret = $this->exec($this->uri."/$projectIdOrKey/versions");