File tree Expand file tree Collapse file tree 2 files changed +9
-3
lines changed
tests/PhpGenerator/expected Expand file tree Collapse file tree 2 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -388,7 +388,10 @@ private function setupFunction($function, Node\FunctionLike $node): void
388
388
$ function ->setReturnReference ($ node ->returnsByRef ());
389
389
$ function ->setReturnType ($ node ->getReturnType () ? $ this ->toPhp ($ node ->getReturnType ()) : null );
390
390
foreach ($ node ->getParams () as $ item ) {
391
- $ param = $ function ->addParameter ($ item ->var ->name );
391
+ $ visibility = $ this ->toVisibility ($ item ->flags );
392
+ $ param = $ visibility
393
+ ? ($ function ->addPromotedParameter ($ item ->var ->name ))->setVisibility ($ visibility )
394
+ : $ function ->addParameter ($ item ->var ->name );
392
395
$ param ->setType ($ item ->type ? $ this ->toPhp ($ item ->type ) : null );
393
396
$ param ->setReference ($ item ->byRef );
394
397
$ function ->setVariadic ($ item ->variadic );
Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ namespace Abc;
6
6
7
7
class Class8
8
8
{
9
- public function __construct($a, int|string $b = 10, $c = null)
10
- {
9
+ public function __construct(
10
+ public $a,
11
+ private int|string $b = 10,
12
+ $c = null,
13
+ ) {
11
14
}
12
15
}
13
16
You can’t perform that action at this time.
0 commit comments