Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
spawnia committed Jul 3, 2024
1 parent 687f733 commit 6ec138f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Inspections/IgnoreByNameSuppressorInspection.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ public function __construct(

public function shouldSuppress(Node $node, array $parents, Inspection $inspection): bool
{
$path = '';
$path = [];
foreach ([...$parents, $node] as $ancestor) {
$name = $this->nameResolver->getName($ancestor);
if ($name === null) {
continue;
}
$path = $path === ''
? $name
: "$path.$name";
if (in_array($path, $this->names)) {

$path[] = $name;
$fullName = implode('.', $path);
if (in_array($fullName, $this->names)) {
return true;
}
}
Expand Down

0 comments on commit 6ec138f

Please sign in to comment.