Skip to content

Commit

Permalink
Update tests/Tokenizer/Transformer/BraceTransformerTest.php
Browse files Browse the repository at this point in the history
Co-authored-by: Greg Korba <[email protected]>
  • Loading branch information
keradus and Wirone authored Dec 9, 2024
1 parent 6545fcb commit 61fb7c2
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/Tokenizer/Transformer/BraceTransformerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,38 @@ class PropertyHooks
32 => CT::T_PROPERTY_HOOK_BRACE_CLOSE,
],
];

yield 'property hooks: some more curly braces within hook' => [
<<<'PHP'
<?php
class PropertyHooks
{
public $callable { // << this one
set($value) {
if (is_callable($value)) {
$this->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,
],
];
}

/**
Expand Down

0 comments on commit 61fb7c2

Please sign in to comment.