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 @@ -390,7 +390,10 @@ private function setupFunction(GlobalFunction|Method $function, Node\FunctionLik
390390 $ function ->setReturnReference ($ node ->returnsByRef ());
391391 $ function ->setReturnType ($ node ->getReturnType () ? $ this ->toPhp ($ node ->getReturnType ()) : null );
392392 foreach ($ node ->getParams () as $ item ) {
393- $ param = $ function ->addParameter ($ item ->var ->name );
393+ $ visibility = $ this ->toVisibility ($ item ->flags );
394+ $ param = $ visibility
395+ ? ($ function ->addPromotedParameter ($ item ->var ->name ))->setVisibility ($ visibility )
396+ : $ function ->addParameter ($ item ->var ->name );
394397 $ param ->setType ($ item ->type ? $ this ->toPhp ($ item ->type ) : null );
395398 $ param ->setReference ($ item ->byRef );
396399 $ function ->setVariadic ($ item ->variadic );
Original file line number Diff line number Diff line change @@ -6,8 +6,11 @@ namespace Abc;
66
77class Class8
88{
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+ ) {
1114 }
1215}
1316
You can’t perform that action at this time.
0 commit comments