Skip to content

Commit 3500180

Browse files
authored
Apply fixes from StyleCI (#348)
1 parent caa7591 commit 3500180

File tree

13 files changed

+22
-60
lines changed

13 files changed

+22
-60
lines changed

src/Contracts/SourceRepositoryTypeContract.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Codedge\Updater\Contracts;
66

77
use Codedge\Updater\Models\Release;
8-
use GuzzleHttp\Exception\GuzzleException;
98
use Illuminate\Http\Client\Response;
109

1110
interface SourceRepositoryTypeContract

src/Models/Release.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66

77
use Codedge\Updater\Traits\SupportPrivateAccessToken;
88
use Exception;
9-
use GuzzleHttp\ClientInterface;
109
use Illuminate\Filesystem\Filesystem;
1110
use Illuminate\Http\Client\Response;
1211
use Illuminate\Support\Facades\Http;
1312
use Illuminate\Support\Str;
14-
use Psr\Http\Message\ResponseInterface;
1513
use Symfony\Component\Finder\Finder;
1614

1715
final class Release
@@ -195,8 +193,7 @@ public function download(): Response
195193
->withOptions([
196194
'sink' => $this->getStoragePath(),
197195
])
198-
->get($this->getDownloadUrl())
199-
;
196+
->get($this->getDownloadUrl());
200197
}
201198

202199
/**

src/SourceRepositoryTypes/GithubRepositoryTypes/GithubBranchType.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
use Illuminate\Support\Facades\Http;
1818
use Illuminate\Support\Facades\Log;
1919
use Illuminate\Support\Str;
20-
use Psr\Http\Message\ResponseInterface;
2120

2221
final class GithubBranchType extends GithubRepositoryType implements SourceRepositoryTypeContract
2322
{

src/SourceRepositoryTypes/GitlabRepositoryType.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,9 @@
1616
use GuzzleHttp\Utils;
1717
use Illuminate\Http\Client\Response;
1818
use Illuminate\Support\Collection;
19+
use Illuminate\Support\Facades\Http;
1920
use Illuminate\Support\Facades\Log;
2021
use Illuminate\Support\Str;
21-
use Psr\Http\Message\ResponseInterface;
22-
use Illuminate\Support\Facades\Http;
2322

2423
class GitlabRepositoryType implements SourceRepositoryTypeContract
2524
{
@@ -38,8 +37,7 @@ public function __construct(UpdateExecutor $updateExecutor)
3837
$this->release = resolve(Release::class);
3938
$this->release->setStoragePath(Str::finish($this->config['download_path'], DIRECTORY_SEPARATOR))
4039
->setUpdatePath(base_path(), config('self-update.exclude_folders'))
41-
->setAccessToken($this->config['private_access_token'])
42-
;
40+
->setAccessToken($this->config['private_access_token']);
4341

4442
$this->updateExecutor = $updateExecutor;
4543
}

src/SourceRepositoryTypes/HttpRepositoryType.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
use Codedge\Updater\Exceptions\VersionException;
1111
use Codedge\Updater\Models\Release;
1212
use Codedge\Updater\Models\UpdateExecutor;
13-
use Codedge\Updater\Traits\SupportPrivateAccessToken;
1413
use Codedge\Updater\Traits\UseVersionFile;
1514
use Exception;
1615
use GuzzleHttp\ClientInterface;
@@ -21,7 +20,6 @@
2120
use Illuminate\Support\Facades\Log;
2221
use Illuminate\Support\Str;
2322
use InvalidArgumentException;
24-
use Psr\Http\Message\ResponseInterface;
2523

2624
class HttpRepositoryType implements SourceRepositoryTypeContract
2725
{

src/UpdaterServiceProvider.php

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,9 @@
55
namespace Codedge\Updater;
66

77
use Codedge\Updater\Commands\CheckForUpdate;
8-
use Codedge\Updater\Contracts\SourceRepositoryTypeContract;
9-
use Codedge\Updater\Models\Release;
108
use Codedge\Updater\Models\UpdateExecutor;
119
use Codedge\Updater\Notifications\EventHandler;
1210
use Codedge\Updater\SourceRepositoryTypes\GithubRepositoryType;
13-
use Codedge\Updater\SourceRepositoryTypes\GithubRepositoryTypes\GithubBranchType;
14-
use Codedge\Updater\SourceRepositoryTypes\GithubRepositoryTypes\GithubTagType;
15-
use Codedge\Updater\SourceRepositoryTypes\GitlabRepositoryType;
16-
use Codedge\Updater\SourceRepositoryTypes\HttpRepositoryType;
17-
use GuzzleHttp\Client;
18-
use GuzzleHttp\ClientInterface;
19-
use Illuminate\Filesystem\Filesystem;
2011
use Illuminate\Support\ServiceProvider;
2112

2213
class UpdaterServiceProvider extends ServiceProvider

tests/Commands/CheckUpdateTest.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use Codedge\Updater\SourceRepositoryTypes\GithubRepositoryType;
99
use Codedge\Updater\SourceRepositoryTypes\GithubRepositoryTypes\GithubTagType;
1010
use Codedge\Updater\Tests\TestCase;
11-
use GuzzleHttp\Client;
1211
use Illuminate\Support\Facades\Http;
1312

1413
final class CheckUpdateTest extends TestCase
@@ -24,8 +23,7 @@ public function it_can_run_check_update_command_without_new_version_available():
2423
{
2524
Http::fakeSequence()
2625
->pushResponse($this->getResponse200Type('tag'))
27-
->pushResponse($this->getResponse200ZipFile())
28-
;
26+
->pushResponse($this->getResponse200ZipFile());
2927

3028
/** @var GithubTagType $github */
3129
$github = (resolve(GithubRepositoryType::class))->create();

tests/Models/ReleaseTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public function it_can_download(): void
164164
->updateStoragePath();
165165

166166
Http::fake([
167-
'https://github.com/*' => $this->getResponse200Type('tag')
167+
'https://github.com/*' => $this->getResponse200Type('tag'),
168168
]);
169169

170170
$response = $this->release->download();

tests/SourceRepositoryTypes/GithubRepositoryTypeTest.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
use Codedge\Updater\SourceRepositoryTypes\GithubRepositoryTypes\GithubTagType;
1414
use Codedge\Updater\Tests\TestCase;
1515
use Exception;
16-
use GuzzleHttp\Client;
1716
use Illuminate\Support\Facades\Event;
1817
use Illuminate\Support\Facades\Http;
1918

@@ -154,7 +153,7 @@ public function it_can_get_new_version_available_from_type_branch_without_versio
154153
$github->deleteVersionFile();
155154

156155
Http::fake([
157-
'*' => $this->getResponse200Type('branch')
156+
'*' => $this->getResponse200Type('branch'),
158157
]);
159158

160159
$this->assertFalse($github->isNewVersionAvailable('2020-02-08T21:09:15Z'));
@@ -182,8 +181,7 @@ public function it_can_fetch_github_tag_releases_latest(): void
182181

183182
Http::fakeSequence()
184183
->pushResponse($this->getResponse200Type('tag'))
185-
->pushResponse($this->getResponse200ZipFile())
186-
;
184+
->pushResponse($this->getResponse200ZipFile());
187185

188186
$release = $github->fetch();
189187

@@ -200,9 +198,7 @@ public function it_can_fetch_github_tag_releases_specific_version(): void
200198

201199
Http::fakeSequence()
202200
->pushResponse($this->getResponse200Type('tag'))
203-
->pushResponse($this->getResponse200ZipFile())
204-
;
205-
201+
->pushResponse($this->getResponse200ZipFile());
206202

207203
$release = $github->fetch('2.6.0');
208204

@@ -219,8 +215,7 @@ public function it_can_fetch_github_tag_releases_and_takes_latest_if_version_not
219215

220216
Http::fakeSequence()
221217
->pushResponse($this->getResponse200Type('tag'))
222-
->pushResponse($this->getResponse200ZipFile())
223-
;
218+
->pushResponse($this->getResponse200ZipFile());
224219

225220
$release = $github->fetch('v3.22.1');
226221

@@ -239,8 +234,7 @@ public function it_can_fetch_github_branch_releases_latest(): void
239234

240235
Http::fakeSequence()
241236
->pushResponse($this->getResponse200Type('branch'))
242-
->pushResponse($this->getResponse200ZipFile())
243-
;
237+
->pushResponse($this->getResponse200ZipFile());
244238

245239
$release = $github->fetch();
246240

@@ -259,8 +253,7 @@ public function it_can_fetch_github_branch_releases_specific_version(): void
259253

260254
Http::fakeSequence()
261255
->pushResponse($this->getResponse200Type('branch'))
262-
->pushResponse($this->getResponse200ZipFile())
263-
;
256+
->pushResponse($this->getResponse200ZipFile());
264257

265258
$release = $github->fetch('2020-02-06T09:35:51Z');
266259

@@ -279,8 +272,7 @@ public function it_can_fetch_github_branch_releases_and_takes_latest_if_version_
279272

280273
Http::fakeSequence()
281274
->pushResponse($this->getResponse200Type('branch'))
282-
->pushResponse($this->getResponse200ZipFile())
283-
;
275+
->pushResponse($this->getResponse200ZipFile());
284276

285277
$release = $github->fetch('2020-01-01T11:11:11Z');
286278

@@ -298,7 +290,7 @@ public function it_cannot_fetch_github_branch_releases_if_response_empty(): void
298290
$github = (resolve(GithubRepositoryType::class))->create();
299291

300292
Http::fake([
301-
'*' => $this->getResponseEmpty()
293+
'*' => $this->getResponseEmpty(),
302294
]);
303295

304296
$this->expectException(Exception::class);

tests/SourceRepositoryTypes/GitlabRepositoryTypeTest.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
use Codedge\Updater\Models\Release;
1212
use Codedge\Updater\SourceRepositoryTypes\GitlabRepositoryType;
1313
use Codedge\Updater\Tests\TestCase;
14-
use Exception;
15-
use GuzzleHttp\Client;
1614
use Illuminate\Support\Facades\Event;
1715
use Illuminate\Support\Facades\Http;
1816
use Illuminate\Support\Facades\Log;
@@ -43,8 +41,7 @@ public function it_can_run_update(): void
4341
->setVersion('1.0')
4442
->setRelease('release-1.0.zip')
4543
->updateStoragePath()
46-
->setDownloadUrl('https://gitlab.com/download/target')
47-
;
44+
->setDownloadUrl('https://gitlab.com/download/target');
4845

4946
Event::fake();
5047
Http::fake([
@@ -92,7 +89,7 @@ public function it_can_get_new_version_available_without_version_file(): void
9289

9390
Event::fake();
9491
Http::fake([
95-
'*' => $this->getResponse200Type('gitlab')
92+
'*' => $this->getResponse200Type('gitlab'),
9693
]);
9794

9895
$this->assertFalse($gitlab->isNewVersionAvailable('2.7'));
@@ -113,8 +110,7 @@ public function it_cannot_fetch_releases_because_there_is_no_release(): void
113110
Http::fakeSequence()
114111
->pushResponse($this->getResponse200Type('gitlab'))
115112
->pushResponse($this->getResponseEmpty())
116-
->pushResponse($this->getResponseEmpty())
117-
;
113+
->pushResponse($this->getResponseEmpty());
118114

119115
$this->assertInstanceOf(Release::class, $gitlab->fetch());
120116

@@ -133,8 +129,7 @@ public function it_can_fetch_releases(): void
133129
Http::fakeSequence()
134130
->pushResponse($this->getResponse200Type('gitlab'))
135131
->pushResponse($this->getResponse200ZipFile())
136-
->pushResponse($this->getResponse200Type('gitlab'))
137-
;
132+
->pushResponse($this->getResponse200Type('gitlab'));
138133

139134
$release = $gitlab->fetch();
140135

0 commit comments

Comments
 (0)