Skip to content

Commit

Permalink
Add a psalm-suppress comment and change psalm config
Browse files Browse the repository at this point in the history
  • Loading branch information
solventt committed Jan 22, 2024
1 parent 5fc147e commit b8f15e0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,5 +67,11 @@
</errorLevel>
</PropertyNotSetInConstructor>

<RiskyTruthyFalsyComparison>
<errorLevel type="suppress">
<file name="src/Providers/ContainerListenerProvider.php" />
</errorLevel>
</RiskyTruthyFalsyComparison>

</issueHandlers>
</psalm>
1 change: 1 addition & 0 deletions src/Providers/ClassicListenerProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ public function off(string $eventClass, callable $listener): void
$listeners = array_map(fn(array $listener): callable => $listener[0], $this->listeners[$eventClass]);

foreach ($listeners as $index => $activeListener) {
/** @psalm-suppress TypeDoesNotContainType $activeListener */
if ($activeListener == $listener) {
unset($this->listeners[$eventClass][$index]);
}
Expand Down

0 comments on commit b8f15e0

Please sign in to comment.