1
0
mirror of https://github.com/danog/psalm.git synced 2024-12-12 01:09:38 +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;
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(

View File

@ -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) {