Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
freekmurze committed Sep 28, 2018
1 parent 74b57a6 commit ec58d1d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/BladeXCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ protected function replaceBladeXComponentWithRegularBladeComponent(string $viewC
{
$pattern = "/<\s*{$bladeXComponent->name}[^>]*>((.|\n)*?)<\s*\/\s*{$bladeXComponent->name}>/m";

$viewContents = preg_replace_callback($pattern, function (array $regexResult) use ($bladeXComponent) {
return preg_replace_callback($pattern, function (array $regexResult) use ($bladeXComponent) {
[$componentHtml, $componentInnerHtml] = $regexResult;

return "@component('{$bladeXComponent->bladeViewName}', [{$this->getComponentAttributes($componentHtml)}])"
. $this->parseComponentInnerHtml($componentInnerHtml)
. '@endcomponent';
}, $viewContents);

return $viewContents;
}

protected function getComponentAttributes(string $componentHtml): string
Expand Down

0 comments on commit ec58d1d

Please sign in to comment.