@@ -39,9 +39,19 @@ public static function matchTaintEscape($callLike, Scope $scope): ?string
3939 }
4040
4141 /**
42+ * @api
43+ *
4244 * @param CallLike|MethodReflection $callLike
45+ */
46+ public static function matchInferencePlaceholder ($ callLike , Scope $ scope ): ?string
47+ {
48+ return self ::matchStringAnnotation ('@phpstandba-inference-placeholder ' , $ callLike , $ scope );
49+ }
50+
51+ /**
52+ * @api
4353 *
44- *@api
54+ * @param CallLike|MethodReflection $callLike
4555 */
4656 public static function commentContains (string $ text , $ callLike , Scope $ scope ): bool
4757 {
@@ -66,11 +76,16 @@ public static function commentContains(string $text, $callLike, Scope $scope): b
6676 /**
6777 * Returns a unquoted plain string following a annotation.
6878 *
69- * @param string $annotation e.g. '@phpstandba-inference-placeholder'
79+ * @param string $annotation e.g. '@phpstandba-inference-placeholder'
80+ * @param CallLike|MethodReflection $callLike
7081 */
71- public static function matchStringAnnotation (string $ annotation , CallLike $ callLike , Scope $ scope ): ?string
82+ private static function matchStringAnnotation (string $ annotation , $ callLike , Scope $ scope ): ?string
7283 {
73- $ methodReflection = self ::getMethodReflection ($ callLike , $ scope );
84+ if ($ callLike instanceof CallLike) {
85+ $ methodReflection = self ::getMethodReflection ($ callLike , $ scope );
86+ } else {
87+ $ methodReflection = $ callLike ;
88+ }
7489
7590 if (null !== $ methodReflection ) {
7691 // atm no resolved phpdoc for methods
0 commit comments