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