Skip to content

Commit

Permalink
fix #1226
Browse files Browse the repository at this point in the history
  • Loading branch information
gennadigennadigennadi committed Jun 20, 2023
1 parent fd635ed commit 0d2fd75
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Contract/Analyser/EventHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ public function __construct(
*/
public function shouldViolationBeSkipped(string $depender, string $dependent): bool
{
if (!array_key_exists($depender, $this->skippedViolations)) {
return false;
}
$key = array_search($dependent, $this->unmatchedSkippedViolation[$depender], true);
if (false === $key) {
$skippedViolation = $this->skippedViolations[$depender] ?? [];
$matched = [] !== $skippedViolation && in_array($dependent, $skippedViolation, true);

if (!$matched) {
return false;
}

unset($this->unmatchedSkippedViolation[$depender][$key]);
if (false !== ($key = array_search($dependent, $this->unmatchedSkippedViolation[$depender], true))) {
unset($this->unmatchedSkippedViolation[$depender][$key]);
}

return true;
}
Expand Down

0 comments on commit 0d2fd75

Please sign in to comment.