File tree Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Expand file tree Collapse file tree 3 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 44
55use PhpParser \Node \Scalar \Float_ ;
66
7- return new Float_ (100 );
7+ return new Float_ (100.5 );
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use PhpParser \Modifiers ;
6+
7+ $ propertyItem = new \PhpParser \Node \PropertyItem ('someProperty ' );
8+ $ property = new \PhpParser \Node \Stmt \Property (Modifiers::PUBLIC , [$ propertyItem ]);
9+
10+ $ plus = new \PhpParser \Node \Expr \BinaryOp \Plus (
11+ new \PhpParser \Node \Expr \Variable ('variable ' ),
12+ new \PhpParser \Node \Scalar \Int_ (100 )
13+ );
14+
15+ $ getPropertyHook = new \PhpParser \Node \PropertyHook ('getProperty ' , $ plus );
16+
17+ $ property ->hooks [] = $ getPropertyHook ;
18+
19+ return $ property ;
Original file line number Diff line number Diff line change 1212
1313final class NodeCodeSampleProvider
1414{
15- private Standard $ standardPrinter ;
15+ private readonly Standard $ standardPrinter ;
1616
1717 public function __construct (
1818 ) {
You can’t perform that action at this time.
0 commit comments