diff options
author | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-09-29 18:23:20 +0300 |
---|---|---|
committer | Côme Chilliet <come.chilliet@nextcloud.com> | 2022-09-29 18:23:20 +0300 |
commit | 9e12a9e6623c5b39ab3127e48ed3388d3702d1ab (patch) | |
tree | a4f31ced66aac3d5f209498444cc3f0f5ad8128d | |
parent | ecf9bb9572a32293aa7fb74b5afa847e5a3caa76 (diff) |
Fix status initialization problems
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
-rw-r--r-- | lib/Scanner/ScannerBase.php | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/Scanner/ScannerBase.php b/lib/Scanner/ScannerBase.php index 4914b2d..f1620bc 100644 --- a/lib/Scanner/ScannerBase.php +++ b/lib/Scanner/ScannerBase.php @@ -58,6 +58,7 @@ abstract class ScannerBase implements IScanner { $this->appConfig = $config; $this->logger = $logger; $this->statusFactory = $statusFactory; + $this->status = $this->statusFactory->newStatus(); } /** @@ -72,10 +73,7 @@ abstract class ScannerBase implements IScanner { if ($this->infectedStatus instanceof Status) { return $this->infectedStatus; } - if ($this->status instanceof Status) { - return $this->status; - } - return $this->statusFactory->newStatus(); + return $this->status; } /** @@ -140,7 +138,7 @@ abstract class ScannerBase implements IScanner { */ public function initScanner() { $this->byteCount = 0; - if ($this->status instanceof Status && $this->status->getNumericStatus() === Status::SCANRESULT_INFECTED) { + if ($this->status->getNumericStatus() === Status::SCANRESULT_INFECTED) { $this->infectedStatus = clone $this->status; } $this->status = $this->statusFactory->newStatus(); |