• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

sineflow / clamav / 22552200290

01 Mar 2026 08:41PM UTC coverage: 75.893% (-0.2%) from 76.106%
22552200290

Pull #14

github

pmishev
Modernise codebase for PHP 8.2+ with minor API changes

- [BC] ScanStrategyClamdNetwork port is now int, not string
- [BC] Scanner::$scanStrategy is now private
- [BC] ScannerFactory throws \InvalidArgumentException for unknown strategies
- [BC] ScannedFile::__construct throws FileScanException on failure to parse clamav response
Pull Request #14: 2.0.0

13 of 22 new or added lines in 7 files covered. (59.09%)

4 existing lines in 3 files now uncovered.

85 of 112 relevant lines covered (75.89%)

50.63 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

83.33
/src/DTO/ScannedFile.php
1
<?php
2

3
namespace Sineflow\ClamAV\DTO;
4

5
use Sineflow\ClamAV\Exception\FileScanException;
6

7
class ScannedFile
8
{
9
    private string $rawResponse;
10

11
    private string $fileName;
12

13
    private bool $isClean;
14

15
    private string $virusName;
16

17
    public function __construct(string $rawResponse)
90✔
18
    {
19
        $isParsed = preg_match('/(.*):(.*)(FOUND|OK|ERROR)/', $rawResponse, $matches);
90✔
20

21
        if (!$isParsed) {
90✔
NEW
22
            throw new FileScanException('', sprintf('Failed to parse clamav response: %s', $rawResponse));
×
23
        }
24

25
        if ($matches[3] === 'ERROR') {
90✔
26
            throw new FileScanException($matches[1], trim($matches[2]));
18✔
27
        }
28

29
        $this->rawResponse = $rawResponse;
72✔
30
        $this->fileName = $matches[1];
72✔
31
        $this->virusName = trim($matches[2]);
72✔
32
        $this->isClean = ($matches[3] === 'OK');
72✔
33
    }
34

UNCOV
35
    public function getRawResponse(): string
×
36
    {
37
        return $this->rawResponse;
×
38
    }
39

40
    public function getFileName(): string
72✔
41
    {
42
        return $this->fileName;
72✔
43
    }
44

45
    public function isClean(): bool
72✔
46
    {
47
        return $this->isClean;
72✔
48
    }
49

50
    public function getVirusName(): string
72✔
51
    {
52
        return $this->virusName;
72✔
53
    }
54
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc