Skip to content

Commit 1a679fb

Browse files
aarondfrancisStyleCIBot
authored andcommitted
Apply fixes from StyleCI
[ci skip] [skip ci]
1 parent 69266a4 commit 1a679fb

2 files changed

Lines changed: 17 additions & 23 deletions

File tree

src/TorchlightExtension.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace Torchlight\Commonmark;
44

5-
use Torchlight\Block;
6-
use Torchlight\Client;
75
use League\CommonMark\Block\Element\AbstractBlock;
86
use League\CommonMark\Block\Element\FencedCode;
97
use League\CommonMark\Block\Element\IndentedCode;
@@ -13,6 +11,8 @@
1311
use League\CommonMark\Event\DocumentParsedEvent;
1412
use League\CommonMark\Extension\ExtensionInterface;
1513
use League\CommonMark\Util\Xml;
14+
use Torchlight\Block;
15+
use Torchlight\Client;
1616

1717
class TorchlightExtension implements ExtensionInterface, BlockRendererInterface
1818
{

tests/CodeRendererTest.php

Lines changed: 15 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,15 @@
33
namespace Torchlight\Commonmark\Tests;
44

55
use Illuminate\Support\Facades\Http;
6-
use Torchlight\Block;
7-
use Torchlight\Client;
8-
use Torchlight\Commonmark\TorchlightExtension;
96
use League\CommonMark\DocParser;
107
use League\CommonMark\Environment;
118
use League\CommonMark\HtmlRenderer;
129
use Orchestra\Testbench\TestCase;
10+
use Torchlight\Block;
11+
use Torchlight\Commonmark\TorchlightExtension;
1312

1413
class CodeRendererTest extends TestCase
1514
{
16-
1715
protected function getEnvironmentSetUp($app)
1816
{
1917
config()->set('torchlight.token', 'token');
@@ -55,9 +53,9 @@ public function it_highlights_code_blocks()
5553
EOT;
5654

5755
$response = [
58-
"blocks" => [[
59-
"id" => "block_id_1",
60-
"wrapped" => "<pre><code>highlighted</code></pre>",
56+
'blocks' => [[
57+
'id' => 'block_id_1',
58+
'wrapped' => '<pre><code>highlighted</code></pre>',
6159
]]
6260
];
6361

@@ -94,9 +92,8 @@ public function gets_language_and_contents()
9492
$this->render($markdown);
9593

9694
Http::assertSent(function ($request) {
97-
return $request['blocks'][0]['language'] === "foobarlang"
98-
&& $request['blocks'][0]['code'] === "<div>test</div>";
99-
95+
return $request['blocks'][0]['language'] === 'foobarlang'
96+
&& $request['blocks'][0]['code'] === '<div>test</div>';
10097
});
10198
}
10299

@@ -121,23 +118,22 @@ public function it_sends_one_request_only_and_matches_by_id()
121118
EOT;
122119

123120
$response = [
124-
"blocks" => [[
125-
"id" => "block_id_3",
126-
"wrapped" => "some js",
121+
'blocks' => [[
122+
'id' => 'block_id_3',
123+
'wrapped' => 'some js',
127124
], [
128-
"id" => "block_id_1",
129-
"wrapped" => "some php",
125+
'id' => 'block_id_1',
126+
'wrapped' => 'some php',
130127
], [
131-
"id" => "block_id_2",
132-
"wrapped" => "some ruby",
128+
'id' => 'block_id_2',
129+
'wrapped' => 'some ruby',
133130
]]
134131
];
135132

136133
Http::fake([
137134
'api.torchlight.dev/*' => Http::response($response, 200),
138135
]);
139136

140-
141137
$html = $this->render($markdown);
142138

143139
Http::assertSentCount(1);
@@ -153,6 +149,4 @@ public function it_sends_one_request_only_and_matches_by_id()
153149

154150
$this->assertEquals($expected, $html);
155151
}
156-
157-
158-
}
152+
}

0 commit comments

Comments
 (0)