Skip to content
Permalink
Browse files

Don’t remove trait methods

  • Loading branch information...
muglug committed Apr 17, 2019
1 parent b1044b2 commit ac562563a70453fd9688b8acba4ac00f51a1ae64
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/Psalm/Internal/Codebase/ClassLikes.php
@@ -776,6 +776,8 @@ private function checkMethodReferences(ClassLikeStorage $classlike_storage, Meth
$method_id = $appearing_method_id;
$declaring_classlike_storage = $classlike_storage;
if (isset($classlike_storage->methods[$method_name])) {
$method_storage = $classlike_storage->methods[$method_name];
} else {
@@ -846,7 +848,7 @@ private function checkMethodReferences(ClassLikeStorage $classlike_storage, Meth
if ($codebase->alter_code) {
if ($method_storage->stmt_location
&& !$classlike_storage->is_trait
&& !$declaring_classlike_storage->is_trait
&& isset($project_analyzer->getIssuesToFix()['PossiblyUnusedMethod'])
&& !$codebase->analyzer->hasMixedMemberName(strtolower($method_name))
&& !IssueBuffer::isSuppressed($issue, $method_storage->suppressed_issues)
@@ -873,7 +875,7 @@ private function checkMethodReferences(ClassLikeStorage $classlike_storage, Meth
if ($codebase->alter_code) {
if ($method_storage->stmt_location
&& !$classlike_storage->is_trait
&& !$declaring_classlike_storage->is_trait
&& isset($project_analyzer->getIssuesToFix()['UnusedMethod'])
&& !$codebase->analyzer->hasMixedMemberName(strtolower($method_name))
&& !IssueBuffer::isSuppressed($issue, $method_storage->suppressed_issues)
@@ -944,7 +946,6 @@ private function checkMethodReferences(ClassLikeStorage $classlike_storage, Meth
if ($codebase->alter_code) {
if ($property_storage->stmt_location
&& !$classlike_storage->is_trait
&& isset($project_analyzer->getIssuesToFix()['PossiblyUnusedProperty'])
&& !$codebase->analyzer->hasMixedMemberName('$' . $property_name)
&& !IssueBuffer::isSuppressed($issue, $classlike_storage->suppressed_issues)
@@ -969,7 +970,6 @@ private function checkMethodReferences(ClassLikeStorage $classlike_storage, Meth
if ($codebase->alter_code) {
if ($property_storage->stmt_location
&& !$classlike_storage->is_trait
&& isset($project_analyzer->getIssuesToFix()['UnusedProperty'])
&& !$codebase->analyzer->hasMixedMemberName('$' . $property_name)
&& !IssueBuffer::isSuppressed($issue, $classlike_storage->suppressed_issues)

0 comments on commit ac56256

Please sign in to comment.
You can’t perform that action at this time.