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 21, 2024
1 parent 356c10a commit eebe70c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,12 @@
</errorLevel>
</PossiblyInvalidArgument>

<RiskyTruthyFalsyComparison>
<errorLevel type="suppress">
<file name="src/CsrfMiddleware.php" />
<file name="src/MaskedCsrfToken.php" />
</errorLevel>
</RiskyTruthyFalsyComparison>

</issueHandlers>
</psalm>
1 change: 1 addition & 0 deletions src/SecurityHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public function generateToken(int $length = 32): string
*/
public function addMask(string $token): string
{
/** @psalm-suppress InvalidArgument $mask */
$mask = random_bytes(strlen($token));

$token = $mask ^ $token;
Expand Down

0 comments on commit eebe70c

Please sign in to comment.