From 7c3ba0e61eae47d785d34448ca8d1e067dee6af7 Mon Sep 17 00:00:00 2001 From: Taylor Otwell Date: Mon, 15 Jan 2018 08:07:11 -0600 Subject: [PATCH] formatting --- src/Illuminate/View/Compilers/BladeCompiler.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Illuminate/View/Compilers/BladeCompiler.php b/src/Illuminate/View/Compilers/BladeCompiler.php index e188990f1aab..8f3642ec629d 100644 --- a/src/Illuminate/View/Compilers/BladeCompiler.php +++ b/src/Illuminate/View/Compilers/BladeCompiler.php @@ -425,7 +425,7 @@ public function check($name, ...$parameters) } /** - * Register a component alias. + * Register a component alias directive. * * @param string $path * @param string $alias @@ -436,11 +436,9 @@ public function component($path, $alias = null) $alias = $alias ?: array_last(explode('.', $path)); $this->directive($alias, function ($expression) use ($path) { - if ($expression) { - return "startComponent('{$path}', {$expression}); ?>"; - } else { - return "startComponent('{$path}'); ?>"; - } + return $expression + ? "startComponent('{$path}', {$expression}); ?>" + : "startComponent('{$path}'); ?>"; }); $this->directive('end'.$alias, function ($expression) use ($path) {