fix: missing != and !== on new toUseStrictEquality arch expectation

This commit is contained in:
Nuno Maduro
2024-09-23 14:08:21 +01:00
parent a55da85dd2
commit 432ff221c6
6 changed files with 15 additions and 7 deletions

View File

@ -380,7 +380,7 @@ final class Expectation
if (self::hasExtend($name)) {
$extend = self::$extends[$name]->bindTo($this, Expectation::class);
if ($extend != false) {
if ($extend != false) { // @pest-arch-ignore-line
return $extend;
}
}
@ -522,9 +522,9 @@ final class Expectation
{
return Targeted::make(
$this,
fn (ObjectDescription $object): bool => ! str_contains((string) file_get_contents($object->path), ' == '), // @pest-arch-ignore-line
fn (ObjectDescription $object): bool => ! str_contains((string) file_get_contents($object->path), ' == ') && ! str_contains((string) file_get_contents($object->path), ' != '),
'to use strict equality',
FileLineFinder::where(fn (string $line): bool => str_contains($line, ' == ')),
FileLineFinder::where(fn (string $line): bool => str_contains($line, ' == ') || str_contains($line, ' != ')),
);
}