1
0
mirror of https://github.com/danog/psalm.git synced 2024-11-26 20:34:47 +01:00

Only check interfaces for static matchup

This commit is contained in:
Matthew Brown 2019-03-03 18:13:15 -05:00
parent d7089a87e2
commit 9e8c3b8c6e
2 changed files with 15 additions and 13 deletions

View File

@ -17,6 +17,7 @@ use Psalm\Issue\DeprecatedTrait;
use Psalm\Issue\InaccessibleMethod;
use Psalm\Issue\InternalClass;
use Psalm\Issue\InvalidTemplateParam;
use Psalm\Issue\MethodSignatureMismatch;
use Psalm\Issue\MissingConstructor;
use Psalm\Issue\MissingPropertyType;
use Psalm\Issue\MissingTemplateParam;
@ -426,6 +427,20 @@ class ClassAnalyzer extends ClassLikeAnalyzer
return null;
}
if ($interface_method_storage->is_static && !$implementer_method_storage->is_static) {
if (IssueBuffer::accepts(
new MethodSignatureMismatch(
'Method ' . $implementer_method_storage->cased_name
. ' should be static like '
. $storage->name . '::' . $interface_method_storage->cased_name,
$code_location
),
$implementer_method_storage->suppressed_issues
)) {
return false;
}
}
MethodAnalyzer::compareMethods(
$codebase,
$implementer_classlike_storage ?: $storage,

View File

@ -519,19 +519,6 @@ class MethodAnalyzer extends FunctionLikeAnalyzer
return null;
}
if ($guide_method_storage->is_static && !$implementer_method_storage->is_static) {
if (IssueBuffer::accepts(
new MethodSignatureMismatch(
'Method ' . $cased_implementer_method_id . ' should be static like '
. $cased_guide_method_id,
$code_location
),
$suppressed_issues
)) {
return false;
}
}
if ($prevent_abstract_override
&& !$guide_method_storage->abstract
&& $implementer_method_storage->abstract