Skip to content

Commit dd4200b

Browse files
committed
fix return none when bool expected
1 parent 8df6c2c commit dd4200b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

Model/Document/Helper/File.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,12 @@ public function deleteFile(string $filePath): bool
115115
{
116116
try {
117117
$directoryWrite = $this->filesystem->getDirectoryWrite(DirectoryList::MEDIA);
118-
if ($filePath && $directoryWrite->isFile($filePath)) {
119-
return $directoryWrite->delete($filePath);
120-
}
118+
return $filePath && $directoryWrite->isFile($filePath) && $directoryWrite->delete($filePath);
121119
} catch (FileSystemException $e) {
122120
$this->logger->error($e->getLogMessage(), $e->getTrace());
123-
124-
return false;
125121
}
122+
123+
return false;
126124
}
127125

128126
private function resolveFileSubPath(DocumentTypeInterface $documentType, string $fileName): string

0 commit comments

Comments
 (0)