diff --git a/src/Support/Screenshot.php b/src/Support/Screenshot.php index 57b9e996..7a55d8bd 100644 --- a/src/Support/Screenshot.php +++ b/src/Support/Screenshot.php @@ -42,10 +42,8 @@ public static function save(string $binary, ?string $filename = null): string { $decodedBinary = (string) base64_decode($binary, true); - if ($filename === null) { - // @phpstan-ignore-next-line - $filename = str_replace('__pest_evaluable_', '', test()->name()); - } + // @phpstan-ignore-next-line + $filename ??= str_replace('__pest_evaluable_', '', test()->name()); if (is_dir(self::dir()) === false) { @mkdir(self::dir(), 0755, true);