Skip to content

Commit 83a7392

Browse files
authored
remove DateTime class trigger (#17)
1 parent d54628d commit 83a7392

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Composer/ComposerOutdatedResponseProvider.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
final class ComposerOutdatedResponseProvider
1212
{
13+
/**
14+
* @var int
15+
*/
16+
private const WEEK_IN_SECONDS = 60 * 60 * 24 * 7;
17+
1318
public function provide(): string
1419
{
1520
$composerOutdatedFilePath = $this->resolveComposerOutdatedFilePath();
@@ -67,7 +72,7 @@ private function isFileYoungerThanWeek(string $filePath): bool
6772
return false;
6873
}
6974

70-
return (time() - $fileTime) < DateTime::WEEK;
75+
return (time() - $fileTime) < self::WEEK_IN_SECONDS;
7176
}
7277

7378
private function shouldLoadCacheFile(?string $cacheFilePath): bool

0 commit comments

Comments
 (0)