1 | <?php |
||
14 | class Rule extends Entity implements JsonSerializable{ |
||
15 | |||
16 | /* |
||
17 | * Rule needs to be validated by the exit code returned by scanner |
||
18 | */ |
||
19 | const RULE_TYPE_CODE = 1; |
||
20 | |||
21 | /* |
||
22 | * Rule needs to be validated by parsing the output returned by scanner with regexp |
||
23 | */ |
||
24 | const RULE_TYPE_MATCH = 2; |
||
25 | |||
26 | /** |
||
27 | * |
||
28 | * @var int groupId - used for sorting |
||
29 | */ |
||
30 | protected $groupId; |
||
31 | |||
32 | /** |
||
33 | * |
||
34 | * @var int statusType - RULE_TYPE_CODE or RULE_TYPE_MATCH defines whether |
||
35 | * rule should be checked by the shell exit code or regexp |
||
36 | */ |
||
37 | protected $statusType; |
||
38 | |||
39 | /** |
||
40 | * |
||
41 | * @var int result - shell exit code for rules |
||
42 | * of the type RULE_TYPE_CODE, 0 otherwise |
||
43 | */ |
||
44 | protected $result; |
||
45 | |||
46 | /** |
||
47 | * |
||
48 | * @var string match - regexp to match for rules |
||
49 | * of the type RULE_TYPE_MATCH, '' otherwise |
||
50 | */ |
||
51 | protected $match; |
||
52 | |||
53 | /** |
||
54 | * |
||
55 | * @var string description - shell exit code meaning for rules |
||
56 | * of the type RULE_TYPE_CODE, '' otherwise |
||
57 | */ |
||
58 | protected $description; |
||
59 | |||
60 | /** |
||
61 | * |
||
62 | * @var int status - file check status. SCANRESULT_UNCHECKED, SCANRESULT_INFECTED, |
||
63 | * SCANRESULT_CLEAN are matching Unknown, Infected and Clean files accordingly. |
||
64 | */ |
||
65 | protected $status; |
||
66 | |||
67 | /** |
||
68 | * Pack data into json |
||
69 | * @return array |
||
70 | */ |
||
71 | public function jsonSerialize() { |
||
82 | } |
||
83 |