From 00e861ae5377a0cd1d9ffea9e63e1fc2cf413c58 Mon Sep 17 00:00:00 2001 From: freek Date: Mon, 8 Oct 2018 10:10:36 +0200 Subject: [PATCH] commit --- src/Compiler.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/Compiler.php b/src/Compiler.php index 3bf4964..81d8e69 100644 --- a/src/Compiler.php +++ b/src/Compiler.php @@ -71,7 +71,7 @@ protected function parseClosingTags(string $viewContents, Component $component): protected function componentString(Component $component, array $attributes = []): string { - return $this->componentStartString($component, $attributes) . $this->componentEndString($component); + return $this->componentStartString($component, $attributes).$this->componentEndString($component); } protected function componentStartString(Component $component, array $attributes = []): string @@ -121,7 +121,7 @@ protected function getAttributesFromAttributeString(string $attributeString): ar $pattern = '/(?[\w:-]+)(=(?(\"[^\"]+\"|\\\'[^\\\']+\\\'|[^\s>]+)))?/'; - if (!preg_match_all($pattern, $attributeString, $matches, PREG_SET_ORDER)) { + if (! preg_match_all($pattern, $attributeString, $matches, PREG_SET_ORDER)) { return []; } @@ -138,9 +138,7 @@ protected function getAttributesFromAttributeString(string $attributeString): ar if (starts_with($attribute, 'bind:')) { $attribute = str_after($attribute, 'bind:'); - } - - if (!starts_with($attribute, 'bind:')) { + } else { $value = str_replace("'", "\\'", $value); $value = "'{$value}'"; } @@ -166,7 +164,7 @@ protected function parseSlots(string $viewContents): string protected function isOpeningHtmlTag(string $tagName, string $html): bool { - return !ends_with($html, ["", '/>']); + return ! ends_with($html, ["", '/>']); } protected function parseBindAttributes(string $attributeString): string