• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

nepada / bust-cache / 5143471446

pending completion
5143471446

Pull #96

github

web-flow
Merge 22bd8fddd into c682a9643
Pull Request #96: Update phpstan/phpstan requirement from 1.10.14 to 1.10.15

310 of 314 relevant lines covered (98.73%)

0.99 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

100.0
/src/BustCache/CacheBustingStrategies/ModificationTime.php
1
<?php
2
declare(strict_types = 1);
3

4
namespace Nepada\BustCache\CacheBustingStrategies;
5

6
use Nepada\BustCache\CacheBustingStrategy;
7
use Nepada\BustCache\FileSystem\File;
8
use Nepada\BustCache\FileSystem\IOException;
9

10
final class ModificationTime implements CacheBustingStrategy
11
{
12

13
    public const NAME = 'modificationTime';
14

15
    /**
16
     * @param File $file
17
     * @return string
18
     * @throws IOException
19
     */
20
    public function calculateHash(File $file): string
1✔
21
    {
22
        $timestamp = @filemtime($file->getPath()->toString());
1✔
23
        if ($timestamp === false) {
1✔
24
            throw IOException::failedToReadModificationTime($file->getPath()->toString());
1✔
25
        }
26

27
        return (string) $timestamp;
1✔
28
    }
29

30
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc