Skip to content

Commit

Permalink
change argument order
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Apr 28, 2020
1 parent f1ef6e6 commit 520544d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Illuminate/View/Compilers/BladeCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ protected function compileComponentTags($value)
}

return (new ComponentTagCompiler(
$this, $this->classComponentAliases
$this->classComponentAliases, $this
))->compile($value);
}

Expand Down
7 changes: 5 additions & 2 deletions src/Illuminate/View/Compilers/ComponentTagCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use Illuminate\Container\Container;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Contracts\View\Factory;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Str;
use Illuminate\View\AnonymousComponent;
use InvalidArgumentException;
Expand Down Expand Up @@ -41,12 +42,14 @@ class ComponentTagCompiler
* Create new component tag compiler.
*
* @param array $aliases
* @param \Illuminate\View\Compilers\BladeCompiler|null
* @return void
*/
public function __construct(BladeCompiler $blade, array $aliases = [])
public function __construct(array $aliases = [], ?BladeCompiler $blade = null)
{
$this->blade = $blade;
$this->aliases = $aliases;

$this->blade = $blade ?: new BladeCompiler(new Filesystem, sys_get_temp_dir());
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tests/View/Blade/BladeComponentTagCompilerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,8 +268,8 @@ protected function mockViewFactory($existsSucceeds = true)
protected function compiler($aliases = [])
{
return new ComponentTagCompiler(
new BladeCompiler(new Filesystem, __DIR__),
$aliases
$aliases,
new BladeCompiler(new Filesystem, __DIR__)
);
}
}
Expand Down

0 comments on commit 520544d

Please sign in to comment.