Skip to content

Commit 520544d

Browse files
committed
change argument order
1 parent f1ef6e6 commit 520544d

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

src/Illuminate/View/Compilers/BladeCompiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ protected function compileComponentTags($value)
318318
}
319319

320320
return (new ComponentTagCompiler(
321-
$this, $this->classComponentAliases
321+
$this->classComponentAliases, $this
322322
))->compile($value);
323323
}
324324

src/Illuminate/View/Compilers/ComponentTagCompiler.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
use Illuminate\Container\Container;
66
use Illuminate\Contracts\Foundation\Application;
77
use Illuminate\Contracts\View\Factory;
8+
use Illuminate\Filesystem\Filesystem;
89
use Illuminate\Support\Str;
910
use Illuminate\View\AnonymousComponent;
1011
use InvalidArgumentException;
@@ -41,12 +42,14 @@ class ComponentTagCompiler
4142
* Create new component tag compiler.
4243
*
4344
* @param array $aliases
45+
* @param \Illuminate\View\Compilers\BladeCompiler|null
4446
* @return void
4547
*/
46-
public function __construct(BladeCompiler $blade, array $aliases = [])
48+
public function __construct(array $aliases = [], ?BladeCompiler $blade = null)
4749
{
48-
$this->blade = $blade;
4950
$this->aliases = $aliases;
51+
52+
$this->blade = $blade ?: new BladeCompiler(new Filesystem, sys_get_temp_dir());
5053
}
5154

5255
/**

tests/View/Blade/BladeComponentTagCompilerTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,8 @@ protected function mockViewFactory($existsSucceeds = true)
268268
protected function compiler($aliases = [])
269269
{
270270
return new ComponentTagCompiler(
271-
new BladeCompiler(new Filesystem, __DIR__),
272-
$aliases
271+
$aliases,
272+
new BladeCompiler(new Filesystem, __DIR__)
273273
);
274274
}
275275
}

0 commit comments

Comments
 (0)