1 | <?php |
||
15 | class Status { |
||
16 | |||
17 | /* |
||
18 | * The file was not checked (e.g. because the AV daemon wasn't running). |
||
19 | */ |
||
20 | const SCANRESULT_UNCHECKED = -1; |
||
21 | |||
22 | /* |
||
23 | * The file was checked and found to be clean. |
||
24 | */ |
||
25 | const SCANRESULT_CLEAN = 0; |
||
26 | |||
27 | /* |
||
28 | * The file was checked and found to be infected. |
||
29 | */ |
||
30 | const SCANRESULT_INFECTED = 1; |
||
31 | |||
32 | /* |
||
33 | * Should be SCANRESULT_UNCHECKED | SCANRESULT_INFECTED | SCANRESULT_CLEAN |
||
34 | */ |
||
35 | protected $numericStatus = self::SCANRESULT_UNCHECKED; |
||
36 | |||
37 | /* |
||
38 | * Virus name or error message |
||
39 | */ |
||
40 | protected $details = ''; |
||
41 | |||
42 | /** @var RuleMapper */ |
||
43 | protected $ruleMapper; |
||
44 | |||
45 | /** @var ILogger */ |
||
46 | protected $logger; |
||
47 | |||
48 | /** |
||
49 | * Status constructor. |
||
50 | * |
||
51 | * @param RuleMapper $ruleMapper |
||
52 | * @param ILogger $logger |
||
53 | */ |
||
54 | 1 | public function __construct(RuleMapper $ruleMapper, ILogger $logger){ |
|
58 | |||
59 | /** |
||
60 | * Get scan status as integer |
||
61 | * @return int |
||
62 | */ |
||
63 | 1 | public function getNumericStatus(){ |
|
66 | |||
67 | /** |
||
68 | * Get scan status as string |
||
69 | * @return string |
||
70 | */ |
||
71 | 1 | public function getDetails(){ |
|
74 | |||
75 | public function setNumericStatus(int $numericStatus): void { |
||
78 | |||
79 | public function setDetails(string $details): void { |
||
82 | |||
83 | /** |
||
84 | * @param string $rawResponse |
||
85 | * @param integer $result |
||
86 | */ |
||
87 | 1 | public function parseResponse($rawResponse, $result = null){ |
|
144 | |||
145 | /** |
||
146 | * @return Rule[] |
||
147 | */ |
||
148 | 1 | protected function getResponseRules(){ |
|
160 | |||
161 | public function dispatch(Item $item){ |
||
174 | } |
||
175 |