1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-05 20:48:45 +01:00

dead code

This commit is contained in:
orklah 2021-09-26 22:19:42 +02:00
parent ae1afd90c6
commit a85cba3973
2 changed files with 10 additions and 20 deletions

View File

@ -580,22 +580,17 @@ abstract class ClassLikeAnalyzer extends SourceAnalyzer
return $emit_issues ? null : true; return $emit_issues ? null : true;
case self::VISIBILITY_PRIVATE: case self::VISIBILITY_PRIVATE:
if (!$context->self || $appearing_property_class !== $context->self) { if ($emit_issues && IssueBuffer::accepts(
if ($emit_issues && IssueBuffer::accepts( new InaccessibleProperty(
new InaccessibleProperty( 'Cannot access private property ' . $property_id . ' from context ' . $context->self,
'Cannot access private property ' . $property_id . ' from context ' . $context->self, $code_location
$code_location ),
), $suppressed_issues
$suppressed_issues )) {
)) { // fall through
// fall through
}
return null;
} }
return $emit_issues ? null : true; return null;
case self::VISIBILITY_PROTECTED: case self::VISIBILITY_PROTECTED:
if (!$context->self) { if (!$context->self) {
if ($emit_issues && IssueBuffer::accepts( if ($emit_issues && IssueBuffer::accepts(

View File

@ -126,17 +126,12 @@ class ReflectorVisitor extends PhpParser\NodeVisitorAbstract implements FileSour
{ {
foreach ($node->getComments() as $comment) { foreach ($node->getComments() as $comment) {
if ($comment instanceof PhpParser\Comment\Doc && !$node instanceof PhpParser\Node\Stmt\ClassLike) { 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 { try {
$type_aliases = Reflector\ClassLikeNodeScanner::getTypeAliasesFromComment( $type_aliases = Reflector\ClassLikeNodeScanner::getTypeAliasesFromComment(
$comment, $comment,
$this->aliases, $this->aliases,
$this->type_aliases, $this->type_aliases,
$self_fqcln null
); );
foreach ($type_aliases as $type_alias) { foreach ($type_aliases as $type_alias) {