From a85cba397327a649d00838e114be732011c7e0c4 Mon Sep 17 00:00:00 2001 From: orklah Date: Sun, 26 Sep 2021 22:19:42 +0200 Subject: [PATCH] dead code --- .../Internal/Analyzer/ClassLikeAnalyzer.php | 23 ++++++++----------- .../Internal/PhpVisitor/ReflectorVisitor.php | 7 +----- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php b/src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php index f1b66b95e..825a9f4b7 100644 --- a/src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php +++ b/src/Psalm/Internal/Analyzer/ClassLikeAnalyzer.php @@ -580,22 +580,17 @@ abstract class ClassLikeAnalyzer extends SourceAnalyzer return $emit_issues ? null : true; case self::VISIBILITY_PRIVATE: - if (!$context->self || $appearing_property_class !== $context->self) { - if ($emit_issues && IssueBuffer::accepts( - new InaccessibleProperty( - 'Cannot access private property ' . $property_id . ' from context ' . $context->self, - $code_location - ), - $suppressed_issues - )) { - // fall through - } - - return null; + if ($emit_issues && IssueBuffer::accepts( + new InaccessibleProperty( + 'Cannot access private property ' . $property_id . ' from context ' . $context->self, + $code_location + ), + $suppressed_issues + )) { + // fall through } - return $emit_issues ? null : true; - + return null; case self::VISIBILITY_PROTECTED: if (!$context->self) { if ($emit_issues && IssueBuffer::accepts( diff --git a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php index 3da990b36..75a3f994d 100644 --- a/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php +++ b/src/Psalm/Internal/PhpVisitor/ReflectorVisitor.php @@ -126,17 +126,12 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements FileSour { foreach ($node->getComments() as $comment) { if ($comment instanceof PhpParser\Comment\Doc && !$node instanceof PhpParser\Node\Stmt\ClassLike) { - $self_fqcln = $node instanceof PhpParser\Node\Stmt\ClassLike - && $node->name !== null - ? ($this->aliases->namespace ? $this->aliases->namespace . '\\' : '') . $node->name->name - : null; - try { $type_aliases = Reflector\ClassLikeNodeScanner::getTypeAliasesFromComment( $comment, $this->aliases, $this->type_aliases, - $self_fqcln + null ); foreach ($type_aliases as $type_alias) {