From 61fb7c2bad6352ed4f98e8f2217242dc7878eefe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dariusz=20Rumi=C5=84ski?= Date: Mon, 9 Dec 2024 20:12:07 +0100 Subject: [PATCH] Update tests/Tokenizer/Transformer/BraceTransformerTest.php Co-authored-by: Greg Korba --- .../Transformer/BraceTransformerTest.php | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/tests/Tokenizer/Transformer/BraceTransformerTest.php b/tests/Tokenizer/Transformer/BraceTransformerTest.php index 76d1e2d3af1..a9914755d29 100644 --- a/tests/Tokenizer/Transformer/BraceTransformerTest.php +++ b/tests/Tokenizer/Transformer/BraceTransformerTest.php @@ -463,6 +463,38 @@ class PropertyHooks 32 => CT::T_PROPERTY_HOOK_BRACE_CLOSE, ], ]; + + yield 'property hooks: some more curly braces within hook' => [ + <<<'PHP' + callable = $value; + } else { + $this->callable = static function (): void { + $foo = new class implements \Stringable { + public function __toString(): string { + echo 'Na'; + } + }; + + for ($i = 0; $i < 8; $i++) { + echo (string) $foo; + } + }; + } + } + } // << this one + } + PHP, + [ + 11 => CT::T_PROPERTY_HOOK_BRACE_OPEN, + 143 => CT::T_PROPERTY_HOOK_BRACE_CLOSE, + ], + ]; } /**