• 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

50.0
/src/Bundle/ScannerFactory.php
1
<?php
2

3
namespace Sineflow\ClamAV\Bundle;
4

5
use Sineflow\ClamAV\Scanner;
6
use Sineflow\ClamAV\ScanStrategy\ScanStrategyClamdNetwork;
7
use Sineflow\ClamAV\ScanStrategy\ScanStrategyClamdUnix;
8

9
/**
10
 * Instantiates a Scanner using a ScanStrategy based on the configuration
11
 */
12
class ScannerFactory
13
{
14
    public static function createScanner(array $options): Scanner
9✔
15
    {
16
        $scanStrategy = match ($options['strategy']) {
9✔
17
            'clamd_unix' => new ScanStrategyClamdUnix(
9✔
18
                $options['socket'] ?? ScanStrategyClamdUnix::DEFAULT_SOCKET
9✔
19
            ),
9✔
NEW
20
            'clamd_network' => new ScanStrategyClamdNetwork(
×
NEW
21
                $options['host'] ?? ScanStrategyClamdNetwork::DEFAULT_HOST,
×
NEW
22
                $options['port'] ?? ScanStrategyClamdNetwork::DEFAULT_PORT
×
NEW
23
            ),
×
NEW
24
            default => throw new \InvalidArgumentException(
×
NEW
25
                sprintf('Unsupported scan strategy "%s" configured', $options['strategy'])
×
NEW
26
            ),
×
27
        };
9✔
28

29
        return new Scanner($scanStrategy);
9✔
30
    }
31
}
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