Skip to content

Commit 1fc9da2

Browse files
Apply fixes from StyleCI (#6)
[ci skip] [skip ci]
1 parent 7b398d0 commit 1fc9da2

File tree

4 files changed

+8
-19
lines changed

4 files changed

+8
-19
lines changed

src/Client.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
namespace Torchlight;
77

88
use GuzzleHttp\Promise\Promise;
9-
use Illuminate\Http\Client\PendingRequest;
109
use Illuminate\Support\Arr;
1110
use Illuminate\Support\Collection;
1211
use Illuminate\Support\Facades\Http;

tests/BaseTest.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@
55

66
namespace Torchlight\Tests;
77

8-
use Exception;
98
use GuzzleHttp\Exception\ConnectException;
109
use GuzzleHttp\Exception\TransferException;
1110
use GuzzleHttp\Promise\FulfilledPromise;
1211
use http\Client\Response;
13-
use Illuminate\Http\Client\ConnectionException;
1412
use Illuminate\Http\Client\Request;
1513
use Illuminate\Support\Arr;
1614
use Illuminate\Support\Facades\Http;
1715
use Orchestra\Testbench\TestCase;
18-
use Throwable;
19-
use Torchlight\Block;
2016
use Torchlight\TorchlightServiceProvider;
2117

2218
abstract class BaseTest extends TestCase
@@ -55,8 +51,8 @@ protected function fakeApi()
5551
$fake = $this->fakeResponseBlocks[$block['id']];
5652

5753
if (is_array($fake)) {
58-
$highlighted = "<div class='highlighted'>" . $block['code'] . "</div>";
59-
54+
$highlighted = "<div class='highlighted'>" . $block['code'] . '</div>';
55+
6056
$response[] = array_merge($block, [
6157
'classes' => 'torchlight',
6258
'styles' => 'background-color: #000000;',
@@ -106,5 +102,4 @@ protected function addFake($id, $response)
106102

107103
$this->fakeResponseBlocks[$id] = $response;
108104
}
109-
110105
}

tests/ClientTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,7 @@
55

66
namespace Torchlight\Tests;
77

8-
use GuzzleHttp\Exception\ConnectException;
9-
use GuzzleHttp\Exception\TransferException;
108
use Illuminate\Http\Client\Request;
11-
use Illuminate\Support\Arr;
129
use Illuminate\Support\Facades\Cache;
1310
use Illuminate\Support\Facades\Http;
1411
use Torchlight\Block;
@@ -245,7 +242,6 @@ public function blocks_still_get_cached_if_one_request_fails()
245242
$block4 = Block::make('4')->language('php')->code('echo "hello world 4";'),
246243
]);
247244
} catch (RequestException $exception) {
248-
249245
}
250246

251247
// Exception should have been thrown.
@@ -256,6 +252,5 @@ public function blocks_still_get_cached_if_one_request_fails()
256252
$this->assertNotNull(Cache::get($client->cacheKey($block1)));
257253
$this->assertNotNull(Cache::get($client->cacheKey($block2)));
258254
$this->assertNotNull(Cache::get($client->cacheKey($block3)));
259-
260255
}
261256
}

tests/MiddlewareAndComponentTest.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public function it_sends_a_simple_request_with_no_response()
4444

4545
Http::assertSent(function ($request) {
4646
return $request['blocks'][0] === [
47-
'id' => 'component',
48-
'hash' => 'e99681f5450cbaf3774adc5eb74d637f',
49-
'language' => 'php',
50-
'theme' => 'material-theme-palenight',
51-
'code' => 'echo "hello world";',
52-
];
47+
'id' => 'component',
48+
'hash' => 'e99681f5450cbaf3774adc5eb74d637f',
49+
'language' => 'php',
50+
'theme' => 'material-theme-palenight',
51+
'code' => 'echo "hello world";',
52+
];
5353
});
5454
}
5555

0 commit comments

Comments
 (0)