Skip to content

Commit

Permalink
[Core] Early assign $smartFileInfo->getPathname() to variable for Rem…
Browse files Browse the repository at this point in the history
…ovedAndAddedFilesCollector::isFileRemoved() (#256)

* [Core] Early assign $smartFileInfo->getPathname() to variable for RemovedAndAddedFilesCollector::isFileRemoved()

* [ci-review] Rector Rectify

Co-authored-by: GitHub Action <action@github.com>
  • Loading branch information
samsonasik and actions-user committed Jun 20, 2021
1 parent b62161e commit d0e6a3b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/Application/FileSystem/RemovedAndAddedFilesCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,13 @@ public function getRemovedFiles(): array

public function isFileRemoved(SmartFileInfo $smartFileInfo): bool
{
if ($this->removedFileInfos === []) {
return false;
}

$pathname = $smartFileInfo->getPathname();
foreach ($this->removedFileInfos as $removedFileInfo) {
if ($removedFileInfo->getPathname() !== $smartFileInfo->getPathname()) {
if ($removedFileInfo->getPathname() !== $pathname) {
continue;
}

Expand Down

0 comments on commit d0e6a3b

Please sign in to comment.