From 9f5941128ac252cac48365e6832de131add8705a Mon Sep 17 00:00:00 2001 From: Aaron Belz Date: Thu, 10 Feb 2022 10:02:11 -0500 Subject: [PATCH] Added disabled directive (#40900) Co-authored-by: Aaron Belz --- .../View/Compilers/Concerns/CompilesConditionals.php | 11 +++++++++++ tests/View/Blade/BladeCheckedStatementsTest.php | 8 ++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php b/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php index 020c44b1b6b6..3b278d1cc487 100644 --- a/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php +++ b/src/Illuminate/View/Compilers/Concerns/CompilesConditionals.php @@ -326,4 +326,15 @@ protected function compileChecked($condition) { return ""; } + + /** + * Compile a disabled block into valid PHP. + * + * @param string $condition + * @return string + */ + protected function compileDisabled($condition) + { + return ""; + } } diff --git a/tests/View/Blade/BladeCheckedStatementsTest.php b/tests/View/Blade/BladeCheckedStatementsTest.php index 6815bb447410..f689fbea0048 100644 --- a/tests/View/Blade/BladeCheckedStatementsTest.php +++ b/tests/View/Blade/BladeCheckedStatementsTest.php @@ -19,4 +19,12 @@ public function testCheckedStatementsAreCompiled() $this->assertEquals($expected, $this->compiler->compileString($string)); } + + public function testDisabledStatementsAreCompiled() + { + $string = ''; + $expected = ""; + + $this->assertEquals($expected, $this->compiler->compileString($string)); + } }