Skip to content

Apply fixes from StyleCI #67

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 10, 2019
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
14 changes: 8 additions & 6 deletions src/AbstractRepositoryType.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace Codedge\Updater;

Expand Down Expand Up @@ -108,9 +110,9 @@ protected function downloadRelease(Client $client, $source, $storagePath)
{
$headers = [];

if($this->hasAccessToken()) {
if ($this->hasAccessToken()) {
$headers = [
'Authorization' => $this->getAccessToken()
'Authorization' => $this->getAccessToken(),
];
}

Expand Down Expand Up @@ -189,8 +191,8 @@ public function createReleaseFolder($storagePath, $releaseName)
*/
public function getAccessToken($withPrefix = true): string
{
if($withPrefix) {
return self::ACCESS_TOKEN_PREFIX . $this->accessToken;
if ($withPrefix) {
return self::ACCESS_TOKEN_PREFIX.$this->accessToken;
}

return $this->accessToken;
Expand All @@ -213,6 +215,6 @@ public function setAccessToken(string $token): void
*/
public function hasAccessToken(): bool
{
return !empty($this->accessToken);
return ! empty($this->accessToken);
}
}
10 changes: 6 additions & 4 deletions src/SourceRepositoryTypes/GithubRepositoryType.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace Codedge\Updater\SourceRepositoryTypes;

Expand Down Expand Up @@ -218,17 +220,17 @@ protected function getRepositoryReleases()

$headers = [];

if($this->hasAccessToken()) {
if ($this->hasAccessToken()) {
$headers = [
'Authorization' => $this->getAccessToken()
'Authorization' => $this->getAccessToken(),
];
}

return $this->client->request(
'GET',
self::GITHUB_API_URL.'/repos/'.$this->config['repository_vendor'].'/'.$this->config['repository_name'].'/tags',
[
'headers' => $headers
'headers' => $headers,
]
);
}
Expand Down
11 changes: 7 additions & 4 deletions src/SourceRepositoryTypes/HttpRepositoryType.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
<?php declare(strict_types=1);
<?php

declare(strict_types=1);

namespace Codedge\Updater\SourceRepositoryTypes;

Expand Down Expand Up @@ -197,10 +199,11 @@ public function getVersionInstalled($prepend = '', $append = '') : string
* Example: 2.6.5 or v2.6.5.
*
* @param string $prepend Prepend a string to the latest version
* @param string $append Append a string to the latest version
* @param string $append Append a string to the latest version
*
* @return string
* @throws \Exception
*
* @return string
*/
public function getVersionAvailable($prepend = '', $append = '') : string
{
Expand All @@ -221,9 +224,9 @@ public function getVersionAvailable($prepend = '', $append = '') : string
/**
* Retrieve html body with list of all releases from archive URL.
*
* @return mixed|ResponseInterface
*@throws \Exception
*
* @return mixed|ResponseInterface
*/
protected function getPackageReleases()
{
Expand Down