diff --git a/src/Illuminate/View/Compilers/ComponentTagCompiler.php b/src/Illuminate/View/Compilers/ComponentTagCompiler.php index e3f71b27a75d..8b360762127e 100644 --- a/src/Illuminate/View/Compilers/ComponentTagCompiler.php +++ b/src/Illuminate/View/Compilers/ComponentTagCompiler.php @@ -127,10 +127,6 @@ protected function compileOpeningTags(string $value) (\:\\\$)(\w+) ) | - (?: - (![\w]+) - ) - | (?: [\w\-:.@%]+ ( @@ -196,10 +192,6 @@ protected function compileSelfClosingTags(string $value) (\:\\\$)(\w+) ) | - (?: - (![\w]+) - ) - | (?: [\w\-:.@%]+ ( @@ -590,7 +582,6 @@ public function compileSlots(string $value) protected function getAttributesFromAttributeString(string $attributeString) { $attributeString = $this->parseShortAttributeSyntax($attributeString); - $attributeString = $this->parseShortFalseSyntax($attributeString); $attributeString = $this->parseAttributeBag($attributeString); $attributeString = $this->parseComponentTagClassStatements($attributeString); $attributeString = $this->parseComponentTagStyleStatements($attributeString); @@ -659,21 +650,6 @@ protected function parseShortAttributeSyntax(string $value) }, $value); } - /** - * Parses a short false syntax like !required into a fully-qualified syntax like :required="false". - * - * @param string $value - * @return string - */ - protected function parseShortFalseSyntax(string $value) - { - $pattern = "/\s!(\w+)/x"; - - return preg_replace_callback($pattern, function (array $matches) { - return " :{$matches[1]}=\"false\""; - }, $value); - } - /** * Parse the attribute bag in a given attribute string into its fully-qualified syntax. * diff --git a/tests/View/Blade/BladeComponentTagCompilerTest.php b/tests/View/Blade/BladeComponentTagCompilerTest.php index bf2c7f80c146..ec100b50ee58 100644 --- a/tests/View/Blade/BladeComponentTagCompilerTest.php +++ b/tests/View/Blade/BladeComponentTagCompilerTest.php @@ -734,31 +734,6 @@ public function testAttributesTreatedAsPropsAreRemovedFromFinalAttributes() $this->assertSame($attributes->get('other'), 'ok'); } - public function testFalseShortSyntax() - { - $this->mockViewFactory(); - $result = $this->compiler(['bool' => TestBoolComponent::class])->compileTags(''); - - $this->assertSame("##BEGIN-COMPONENT-CLASS##@component('Illuminate\Tests\View\Blade\TestBoolComponent', 'bool', ['bool' => false]) -getConstructor()): ?> -except(collect(\$constructor->getParameters())->map->getName()->all()); ?> - -withAttributes([]); ?> @endComponentClass##END-COMPONENT-CLASS##", trim($result)); - } - - public function testSelfClosingComponentWithFalseShortSyntax() - { - $this->mockViewFactory(); - $result = $this->compiler(['bool' => TestBoolComponent::class])->compileTags(''); - - $this->assertSame("##BEGIN-COMPONENT-CLASS##@component('Illuminate\Tests\View\Blade\TestBoolComponent', 'bool', ['bool' => false]) -getConstructor()): ?> -except(collect(\$constructor->getParameters())->map->getName()->all()); ?> - -withAttributes([]); ?> -@endComponentClass##END-COMPONENT-CLASS##", trim($result)); - } - protected function mockViewFactory($existsSucceeds = true) { $container = new Container; @@ -822,18 +797,3 @@ public function render() return 'input'; } } - -class TestBoolComponent extends Component -{ - public $bool; - - public function __construct($bool) - { - $this->bool = $bool; - } - - public function render() - { - return 'bool'; - } -}