Skip to content

Commit

Permalink
Apply fixes from StyleCI (#437)
Browse files Browse the repository at this point in the history
[ci skip] [skip ci]

Co-authored-by: StyleCI Bot <[email protected]>
  • Loading branch information
lesstif and StyleCIBot authored Jun 4, 2022
1 parent 4fa4645 commit d970aa5
Show file tree
Hide file tree
Showing 13 changed files with 88 additions and 168 deletions.
6 changes: 3 additions & 3 deletions src/AssigneeTypeEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
};
}
}
}
4 changes: 2 additions & 2 deletions src/ClassSerialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);

Expand Down
17 changes: 8 additions & 9 deletions src/Component/Component.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use JiraRestApi\AssigneeTypeEnum;
use JiraRestApi\ClassSerialize;
use JiraRestApi\Project\Project;
use JiraRestApi\User\User;

/**
Expand Down Expand Up @@ -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;

Expand Down
66 changes: 26 additions & 40 deletions src/Configuration/AbstractConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down
Loading

0 comments on commit d970aa5

Please sign in to comment.