File tree Expand file tree Collapse file tree 3 files changed +20
-10
lines changed
Expand file tree Collapse file tree 3 files changed +20
-10
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,10 @@ Helpers for plugin authoring and static testing tool.
44
55### Installation
66
7+ Package ` fp4php/functional ` must be installed manually.
8+
79``` shell
8- $ composer require --dev fp4php/psalm-toolkit
10+ $ composer require --dev fp4php/functional fp4php/ psalm-toolkit
911$ vendor/bin/psalm-plugin enable fp4php/psalm-toolkit
1012```
1113
Original file line number Diff line number Diff line change 2121 },
2222 "require" : {
2323 "php" : " ^8.0" ,
24- "vimeo/psalm" : " ^4.13" ,
25- "fp4php/functional" : " ^4.16"
24+ "vimeo/psalm" : " ^4.13"
25+ },
26+ "require-dev" : {
27+ "fp4php/functional" : " ^4.18"
2628 }
2729}
Original file line number Diff line number Diff line change @@ -49,13 +49,19 @@ public function getCallArgs(MethodReturnTypeProviderEvent | FunctionReturnTypePr
4949 $ from instanceof FunctionReturnTypeProviderEvent => $ from ->getStatementsSource (),
5050 };
5151
52- return ArrayList::collect ($ from ->getCallArgs ())->everyMap (
53- fn ($ arg ) => Option::do (fn () => new CallArg (
54- node: $ arg ,
55- location: new CodeLocation ($ source , $ arg ),
56- type: yield $ this ->getArgType ($ from , $ arg ),
57- ))
58- );
52+ return Option::do (function () use ($ from , $ source ) {
53+ $ args = [];
54+
55+ foreach ($ from ->getCallArgs () as $ arg ) {
56+ $ args [] = new CallArg (
57+ node: $ arg ,
58+ location: new CodeLocation ($ source , $ arg ),
59+ type: yield $ this ->getArgType ($ from , $ arg ),
60+ );
61+ }
62+
63+ return ArrayList::collect ($ args );
64+ });
5965 }
6066
6167 /**
You can’t perform that action at this time.
0 commit comments