diff --git a/app/Browser/JobDebugScreenshot.php b/app/Browser/JobDebugScreenshot.php index cc28557..3a3ac98 100644 --- a/app/Browser/JobDebugScreenshot.php +++ b/app/Browser/JobDebugScreenshot.php @@ -9,19 +9,19 @@ use function rtrim; class JobDebugScreenshot { public const IMG_FILE_NAME = "debug-"; - public static function getFileName(int $jobId): string { - return static::IMG_FILE_NAME . $jobId . ".png"; + public static function getFileName(int $jobId, bool $withExtension = false): string { + return static::IMG_FILE_NAME . $jobId . ($withExtension ? ".png": ""); } public static function getImgFileAbsolutePath(int $jobId): string { - return rtrim(Browser::$storeScreenshotsAt, '/') . "/" . static::getFileName($jobId); + return rtrim(Browser::$storeScreenshotsAt, '/') . "/" . static::getFileName($jobId, true); } public static function getImgFileProjectPath(int $jobId): string { - return app_path("Browser/screenshots/" . static::getFileName($jobId)); + return app_path("Browser/screenshots/" . static::getFileName($jobId, true)); } public static function getImgFileExternalPath(int $jobId): string { - return "screenshots/" . static::getFileName($jobId); + return "screenshots/" . static::getFileName($jobId, true); } }