Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Composer/ComposerOutdatedResponseProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@

final class ComposerOutdatedResponseProvider
{
/**
* @var int
*/
private const WEEK_IN_SECONDS = 60 * 60 * 24 * 7;

public function provide(): string
{
$composerOutdatedFilePath = $this->resolveComposerOutdatedFilePath();
Expand Down Expand Up @@ -67,7 +72,7 @@ private function isFileYoungerThanWeek(string $filePath): bool
return false;
}

return (time() - $fileTime) < DateTime::WEEK;
return (time() - $fileTime) < self::WEEK_IN_SECONDS;
}

private function shouldLoadCacheFile(?string $cacheFilePath): bool
Expand Down