20
20
import com .jetbrains .php .lang .psi .visitors .PhpElementVisitor ;
21
21
import com .magento .idea .magento2plugin .inspections .php .util .PhpClassImplementsInterfaceUtil ;
22
22
import com .magento .idea .magento2plugin .magento .files .Plugin ;
23
+ import com .magento .idea .magento2plugin .magento .packages .Package ;
23
24
import com .magento .idea .magento2plugin .util .GetPhpClassByFQN ;
24
25
import com .magento .idea .magento2plugin .util .magento .plugin .GetTargetClassNamesByPluginClassName ;
25
26
import org .jetbrains .annotations .NotNull ;
@@ -128,7 +129,7 @@ private void checkParametersCompatibility(Method pluginMethod, String pluginPref
128
129
String declaredType = pluginMethodParameter .getDeclaredType ().toString ();
129
130
130
131
if (index == 1 ) {
131
- String targetClassFqn = " \\ " .concat (targetClassName );
132
+ String targetClassFqn = Package . FQN_SEPARATOR .concat (targetClassName );
132
133
if (!checkTypeIncompatibility (targetClassFqn , declaredType , phpIndex )) {
133
134
problemsHolder .registerProblem (pluginMethodParameter , PhpBundle .message ("inspection.wrong_param_type" , new Object []{declaredType , targetClassFqn }), ProblemHighlightType .ERROR );
134
135
}
@@ -138,7 +139,8 @@ private void checkParametersCompatibility(Method pluginMethod, String pluginPref
138
139
continue ;
139
140
}
140
141
if (index == 2 && pluginPrefix .equals (Plugin .PluginType .around .toString ())) {
141
- if (!checkTypeIncompatibility ("callable" , declaredType , phpIndex )) {
142
+ if (!checkTypeIncompatibility (Plugin .CALLABLE_PARAM , declaredType , phpIndex ) &&
143
+ !checkTypeIncompatibility (Package .FQN_SEPARATOR .concat (Plugin .CLOSURE_PARAM ), declaredType , phpIndex )) {
142
144
problemsHolder .registerProblem (pluginMethodParameter , PhpBundle .message ("inspection.wrong_param_type" , new Object []{declaredType , "callable" }), ProblemHighlightType .ERROR );
143
145
}
144
146
continue ;
0 commit comments