Skip to content

Commit 724fc3a

Browse files
committed
fix: remove warning for deleted file
1 parent 0663dfc commit 724fc3a

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Watcher.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,11 @@ public function __construct(private array $watchFor, array $excludes, callable $
3333

3434
protected function addChange(string $filename, ChangeType $type): void
3535
{
36-
$this->changes[] = ['name' => $filename, 'type' => $type, 'data' => filemtime($filename)];
36+
$this->changes[] = [
37+
'name' => $filename,
38+
'type' => $type,
39+
'data' => $type !== ChangeType::DELETED ? filemtime($filename) : null,
40+
];
3741
}
3842

3943
protected function checkFile(string $file, bool $checkForDelete = false): void

0 commit comments

Comments
 (0)