Skip to content

Commit

Permalink
Fix trailing commas for PHP 7.
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrolGenhald committed Feb 24, 2022
1 parent 5f9a8c9 commit c82abe3
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/Psalm/Internal/Analyzer/AttributesAnalyzer.php
Expand Up @@ -91,9 +91,9 @@ public static function analyze(
IssueBuffer::maybeAdd(
new InvalidAttribute(
"Attribute {$attribute_storage->fq_class_name} is not repeatable",
$attribute_storage->location,
$attribute_storage->location
),
$suppressed_issues,
$suppressed_issues
);
}
$appearing_non_repeatable_attributes[$attribute_storage->fq_class_name] = true;
Expand All @@ -106,7 +106,7 @@ public static function analyze(
. self::TARGET_DESCRIPTIONS[$target],
$attribute_storage->name_location
),
$suppressed_issues,
$suppressed_issues
);
}

Expand Down Expand Up @@ -155,23 +155,23 @@ private static function analyzeAttributeConstruction(
'Traits cannot act as attribute classes',
$attribute_storage->name_location
),
$suppressed_issues,
$suppressed_issues
);
} elseif ($classlike_storage->is_interface) {
IssueBuffer::maybeAdd(
new InvalidAttribute(
'Interfaces cannot act as attribute classes',
$attribute_storage->name_location
),
$suppressed_issues,
$suppressed_issues
);
} elseif ($classlike_storage->abstract) {
IssueBuffer::maybeAdd(
new InvalidAttribute(
'Abstract classes cannot act as attribute classes',
$attribute_storage->name_location
),
$suppressed_issues,
$suppressed_issues
);
} elseif (isset($classlike_storage->methods['__construct'])
&& $classlike_storage->methods['__construct']->visibility !== ClassLikeAnalyzer::VISIBILITY_PUBLIC
Expand All @@ -181,15 +181,15 @@ private static function analyzeAttributeConstruction(
'Classes with protected/private constructors cannot act as attribute classes',
$attribute_storage->name_location
),
$suppressed_issues,
$suppressed_issues
);
} elseif ($classlike_storage->is_enum) {
IssueBuffer::maybeAdd(
new InvalidAttribute(
'Enums cannot act as attribute classes',
$attribute_storage->name_location
),
$suppressed_issues,
$suppressed_issues
);
}
}
Expand Down Expand Up @@ -360,17 +360,17 @@ public static function analyzeGetAttributes(
$class_string->value,
$arg_location,
$class_storage,
$statements_analyzer->getSuppressedIssues(),
$statements_analyzer->getSuppressedIssues()
);

if (($class_attribute_target & $target) === 0) {
IssueBuffer::maybeAdd(
new InvalidAttribute(
"Attribute {$class_string->value} cannot be used on a "
. self::TARGET_DESCRIPTIONS[$target],
$arg_location,
$arg_location
),
$statements_analyzer->getSuppressedIssues(),
$statements_analyzer->getSuppressedIssues()
);
}
}
Expand Down

0 comments on commit c82abe3

Please sign in to comment.