| Conditions | 5 |
| Paths | 8 |
| Total Lines | 17 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 7 |
| CRAP Score | 5.0488 |
| Changes | 0 | ||
| 1 | <?php |
||
| 60 | 1 | public function isFresh(?int $timestamp = null): bool |
|
| 61 | 1 | { |
|
| 62 | if (null === $timestamp) { |
||
| 63 | $timestamp = $this->createdAt; |
||
| 64 | 1 | } |
|
| 65 | 1 | ||
| 66 | foreach ($this->fileResources as $filepath) { |
||
| 67 | if (!file_exists($filepath)) { |
||
| 68 | return false; |
||
| 69 | 1 | } |
|
| 70 | 1 | ||
| 71 | if ($timestamp < filemtime($filepath)) { |
||
| 72 | return false; |
||
| 73 | } |
||
| 74 | 1 | } |
|
| 75 | |||
| 76 | return true; |
||
| 77 | } |
||
| 101 |