Skip to content

Commit c805fec

Browse files
authored
Apply fixes from StyleCI (#67)
1 parent 953ae2a commit c805fec

File tree

3 files changed

+21
-14
lines changed

3 files changed

+21
-14
lines changed

Diff for: src/AbstractRepositoryType.php

+8-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Codedge\Updater;
46

@@ -108,9 +110,9 @@ protected function downloadRelease(Client $client, $source, $storagePath)
108110
{
109111
$headers = [];
110112

111-
if($this->hasAccessToken()) {
113+
if ($this->hasAccessToken()) {
112114
$headers = [
113-
'Authorization' => $this->getAccessToken()
115+
'Authorization' => $this->getAccessToken(),
114116
];
115117
}
116118

@@ -189,8 +191,8 @@ public function createReleaseFolder($storagePath, $releaseName)
189191
*/
190192
public function getAccessToken($withPrefix = true): string
191193
{
192-
if($withPrefix) {
193-
return self::ACCESS_TOKEN_PREFIX . $this->accessToken;
194+
if ($withPrefix) {
195+
return self::ACCESS_TOKEN_PREFIX.$this->accessToken;
194196
}
195197

196198
return $this->accessToken;
@@ -213,6 +215,6 @@ public function setAccessToken(string $token): void
213215
*/
214216
public function hasAccessToken(): bool
215217
{
216-
return !empty($this->accessToken);
218+
return ! empty($this->accessToken);
217219
}
218220
}

Diff for: src/SourceRepositoryTypes/GithubRepositoryType.php

+6-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Codedge\Updater\SourceRepositoryTypes;
46

@@ -218,17 +220,17 @@ protected function getRepositoryReleases()
218220

219221
$headers = [];
220222

221-
if($this->hasAccessToken()) {
223+
if ($this->hasAccessToken()) {
222224
$headers = [
223-
'Authorization' => $this->getAccessToken()
225+
'Authorization' => $this->getAccessToken(),
224226
];
225227
}
226228

227229
return $this->client->request(
228230
'GET',
229231
self::GITHUB_API_URL.'/repos/'.$this->config['repository_vendor'].'/'.$this->config['repository_name'].'/tags',
230232
[
231-
'headers' => $headers
233+
'headers' => $headers,
232234
]
233235
);
234236
}

Diff for: src/SourceRepositoryTypes/HttpRepositoryType.php

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
<?php declare(strict_types=1);
1+
<?php
2+
3+
declare(strict_types=1);
24

35
namespace Codedge\Updater\SourceRepositoryTypes;
46

@@ -197,10 +199,11 @@ public function getVersionInstalled($prepend = '', $append = '') : string
197199
* Example: 2.6.5 or v2.6.5.
198200
*
199201
* @param string $prepend Prepend a string to the latest version
200-
* @param string $append Append a string to the latest version
202+
* @param string $append Append a string to the latest version
201203
*
202-
* @return string
203204
* @throws \Exception
205+
*
206+
* @return string
204207
*/
205208
public function getVersionAvailable($prepend = '', $append = '') : string
206209
{
@@ -221,9 +224,9 @@ public function getVersionAvailable($prepend = '', $append = '') : string
221224
/**
222225
* Retrieve html body with list of all releases from archive URL.
223226
*
224-
* @return mixed|ResponseInterface
225227
*@throws \Exception
226228
*
229+
* @return mixed|ResponseInterface
227230
*/
228231
protected function getPackageReleases()
229232
{

0 commit comments

Comments
 (0)