Skip to content

Commit 56cea01

Browse files
authored
Merge branch refs/heads/1.12.x into 2.1.x
2 parents fc35414 + 90b1048 commit 56cea01

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/File/FileMonitor.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function initialize(array $filePaths): void
5454
{
5555
$finderResult = $this->analyseFileFinder->findFiles($this->analysedPaths);
5656
$fileHashes = [];
57-
foreach (array_merge($finderResult->getFiles(), $filePaths, $this->getScannedFiles($finderResult->getFiles())) as $filePath) {
57+
foreach (array_unique(array_merge($finderResult->getFiles(), $filePaths, $this->getScannedFiles($finderResult->getFiles()))) as $filePath) {
5858
$fileHashes[$filePath] = $this->getFileHash($filePath);
5959
}
6060

@@ -73,7 +73,8 @@ public function getChanges(): FileMonitorResult
7373
$newFiles = [];
7474
$changedFiles = [];
7575
$deletedFiles = [];
76-
foreach (array_merge($finderResult->getFiles(), $this->filePaths, $this->getScannedFiles($finderResult->getFiles())) as $filePath) {
76+
$filePaths = array_unique(array_merge($finderResult->getFiles(), $this->filePaths, $this->getScannedFiles($finderResult->getFiles())));
77+
foreach ($filePaths as $filePath) {
7778
if (!array_key_exists($filePath, $oldFileHashes)) {
7879
$newFiles[] = $filePath;
7980
$fileHashes[$filePath] = $this->getFileHash($filePath);

0 commit comments

Comments
 (0)