File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -67,4 +67,28 @@ public function getCallArgs(
6767 fn (Union $ type ) => new CallArg ($ arg , new CodeLocation ($ source , $ arg ), $ type )
6868 ));
6969 }
70+
71+ /**
72+ * @return Option<CallArg>
73+ */
74+ public function getFirstCallArg (
75+ MethodReturnTypeProviderEvent |
76+ FunctionReturnTypeProviderEvent |
77+ AfterFunctionCallAnalysisEvent |
78+ AfterMethodCallAnalysisEvent $ from ,
79+ ): Option {
80+ return $ this ->getCallArgs ($ from )->flatMap (fn (ArrayList $ args ) => $ args ->head ());
81+ }
82+
83+ /**
84+ * @return Option<Union>
85+ */
86+ public function getFirstCallArgType (
87+ MethodReturnTypeProviderEvent |
88+ FunctionReturnTypeProviderEvent |
89+ AfterFunctionCallAnalysisEvent |
90+ AfterMethodCallAnalysisEvent $ from ,
91+ ): Option {
92+ return $ this ->getFirstCallArg ($ from )->map (fn (CallArg $ arg ) => $ arg ->type );
93+ }
7094}
You can’t perform that action at this time.
0 commit comments