Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/8_4__property_hook' into 8_4__pr…
Browse files Browse the repository at this point in the history
…operty_hook
  • Loading branch information
keradus committed Dec 9, 2024
2 parents 073db8b + 61fb7c2 commit 2032d87
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 2032d87

Please sign in to comment.