Skip to content

Commit eae886f

Browse files
Merge branch 'main' into patch-1
2 parents c39664d + 3bb30c4 commit eae886f

6 files changed

+37
-18
lines changed

src/Blade/CodeComponent.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class CodeComponent extends Component
2727
/**
2828
* Create a new component instance.
2929
*
30-
* @param $language
30+
* @param $language
3131
* @param null $theme
3232
* @param null $contents
3333
* @param null $torchlightId

src/Block.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function clones()
155155
}
156156

157157
/**
158-
* @param $num
158+
* @param $num
159159
* @return $this
160160
*/
161161
public function cloned($num)
@@ -179,7 +179,7 @@ public function placeholder($extra = '')
179179
}
180180

181181
/**
182-
* @param $language
182+
* @param $language
183183
* @return $this
184184
*/
185185
public function language($language)
@@ -190,7 +190,7 @@ public function language($language)
190190
}
191191

192192
/**
193-
* @param $theme
193+
* @param $theme
194194
* @return $this
195195
*/
196196
public function theme($theme)
@@ -205,7 +205,7 @@ public function theme($theme)
205205
}
206206

207207
/**
208-
* @param $code
208+
* @param $code
209209
* @return $this
210210
*/
211211
public function code($code)
@@ -233,7 +233,7 @@ public function attrsAsString()
233233
}
234234

235235
/**
236-
* @param $processor
236+
* @param $processor
237237
* @return $this
238238
*/
239239
public function addPostProcessor($processor)
@@ -246,7 +246,7 @@ public function addPostProcessor($processor)
246246
}
247247

248248
/**
249-
* @param $wrapped
249+
* @param $wrapped
250250
* @return $this
251251
*/
252252
public function wrapped($wrapped)
@@ -292,7 +292,7 @@ public function toRequestParams()
292292
}
293293

294294
/**
295-
* @param $theme
295+
* @param $theme
296296
* @return mixed|string
297297
*/
298298
protected function normalizeArrayTheme($theme)
@@ -311,7 +311,7 @@ protected function normalizeArrayTheme($theme)
311311
}
312312

313313
/**
314-
* @param $code
314+
* @param $code
315315
* @return string
316316
*/
317317
protected function clean($code)
@@ -323,7 +323,7 @@ protected function clean($code)
323323
}
324324

325325
/**
326-
* @param $code
326+
* @param $code
327327
* @return string
328328
*/
329329
protected function replaceTabs($code)
@@ -338,7 +338,7 @@ protected function replaceTabs($code)
338338
}
339339

340340
/**
341-
* @param $code
341+
* @param $code
342342
* @return string
343343
*/
344344
protected function dedent($code)

src/Manager.php

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ public function client()
7171
}
7272

7373
/**
74-
* @param $value
74+
* @param $value
7575
*/
7676
public function currentlyCompilingViews($value)
7777
{
7878
$this->currentlyCompilingViews = $value;
7979
}
8080

8181
/**
82-
* @param $blocks
82+
* @param $blocks
8383
* @return mixed
8484
*/
8585
public function highlight($blocks)
@@ -120,7 +120,7 @@ public function addPostProcessors($classes)
120120
}
121121

122122
/**
123-
* @param $blocks
123+
* @param $blocks
124124
*/
125125
public function postProcessBlocks($blocks)
126126
{
@@ -149,6 +149,10 @@ public function postProcessBlocks($blocks)
149149

150150
public function processFileContents($file)
151151
{
152+
if (Str::startsWith($file, '##LARAVEL_TRIM_FIXER##')) {
153+
return false;
154+
}
155+
152156
$directories = $this->config('snippet_directories', []);
153157

154158
// Add a blank path to account for absolute paths.
@@ -170,7 +174,7 @@ public function processFileContents($file)
170174
/**
171175
* Get an item out of the config using dot notation.
172176
*
173-
* @param $key
177+
* @param $key
174178
* @param null $default
175179
* @return mixed
176180
*/
@@ -192,7 +196,7 @@ public function config($key, $default = null)
192196
* A callback function used to access configuration. By default this
193197
* is null, which will fall through to Laravel's `config` function.
194198
*
195-
* @param $callback
199+
* @param $callback
196200
*/
197201
public function getConfigUsing($callback)
198202
{
@@ -245,7 +249,7 @@ public function findTorchlightIds($content)
245249
}
246250

247251
/**
248-
* @param $processor
252+
* @param $processor
249253
* @return PostProcessor
250254
*
251255
* @throws ConfigurationException

src/TorchlightServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public function decorateGrahamCampbellEngines()
112112
/**
113113
* Decorate a single view engine.
114114
*
115-
* @param $name
115+
* @param $name
116116
*/
117117
protected function decorateEngine($name)
118118
{

tests/MiddlewareAndComponentTest.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,18 @@ public function code_contents_can_be_a_file_2()
239239
});
240240
}
241241

242+
/** @test */
243+
public function file_must_be_passed_via_contents()
244+
{
245+
$this->fakeNullResponse('component');
246+
247+
$this->getView('file-must-be-passed-through-contents.blade.php');
248+
249+
Http::assertSent(function ($request) {
250+
return $request['blocks'][0]['code'] === config_path('app.php');
251+
});
252+
}
253+
242254
/** @test */
243255
public function dedent_works_properly()
244256
{
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<x-torchlight-code torchlight-id='component' language='php'>
2+
{{ config_path("app.php") }}
3+
</x-torchlight-code>

0 commit comments

Comments
 (0)