Skip to content

Commit

Permalink
improve error message
Browse files Browse the repository at this point in the history
  • Loading branch information
JonPurvis committed Oct 18, 2024
1 parent 7b24b0b commit abf52dd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Expectations/Profanity.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ function (ObjectDescription $object) use (&$foundWords, $excluding, $including,
return $foundWords === [];
},
'to not use profanity: ' . $foundWords,
FileLineFinder::where(function (string $line) use (&$foundWords): bool {
FileLineFinder::where(function (string $line, string $foundWords) use (&$foundWords): bool {

Check failure on line 54 in src/Expectations/Profanity.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 - ubuntu-latest - prefer-stable -

Cannot use lexical variable $foundWords as a parameter name

Check failure on line 54 in src/Expectations/Profanity.php

View workflow job for this annotation

GitHub Actions / PHP 8.3 - ubuntu-latest - prefer-stable - --parallel

Cannot use lexical variable $foundWords as a parameter name
dd($foundWords);
return str_contains(strtolower($line), strtolower((string) array_values($foundWords ?? [])[0]));
})
));

0 comments on commit abf52dd

Please sign in to comment.