1 | <?php |
||
10 | class AuditManager |
||
11 | { |
||
12 | /** |
||
13 | * Audit objects. |
||
14 | * |
||
15 | * @var array |
||
16 | */ |
||
17 | protected $audits = []; |
||
18 | |||
19 | /** |
||
20 | * Process builder object. |
||
21 | * |
||
22 | * @var ProcessBuilder |
||
23 | */ |
||
24 | protected $processBuilder; |
||
25 | |||
26 | /** |
||
27 | * Console input interface. |
||
28 | * |
||
29 | * @var InputInterface |
||
30 | */ |
||
31 | protected $input; |
||
32 | |||
33 | /** |
||
34 | * Console output interface. |
||
35 | * |
||
36 | * @var OutputInterface |
||
37 | */ |
||
38 | protected $output; |
||
39 | |||
40 | /** |
||
41 | * Current filename. |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | protected $filename; |
||
46 | |||
47 | /** |
||
48 | * AuditManager constructor. |
||
49 | * |
||
50 | * @param ProcessBuilder $processBuilder |
||
51 | * @param InputInterface $input |
||
52 | * @param OutputInterface $output |
||
53 | * @param string $filename |
||
54 | */ |
||
55 | public function __construct(ProcessBuilder $processBuilder, InputInterface $input, OutputInterface $output, string $filename) |
||
62 | |||
63 | /** |
||
64 | * Get the default audit name. |
||
65 | * |
||
66 | * @return string |
||
67 | */ |
||
68 | public function getDefaultAudit() :string |
||
74 | |||
75 | /** |
||
76 | * Get an audit instance. |
||
77 | * |
||
78 | * @param string|null $audit |
||
79 | * @return AbstractAudit |
||
80 | */ |
||
81 | public function audit(string $audit = null) :AbstractAudit |
||
91 | |||
92 | /** |
||
93 | * Create a new audit instance based on |
||
94 | * the given audit name. |
||
95 | * |
||
96 | * @param string $audit |
||
97 | * @return AbstractAudit |
||
98 | */ |
||
99 | protected function createAudit(string $audit) :AbstractAudit |
||
109 | |||
110 | /** |
||
111 | * Create a new desktop audit instance. |
||
112 | * |
||
113 | * @return AbstractAudit |
||
114 | */ |
||
115 | protected function createDesktopAudit() :AbstractAudit |
||
124 | |||
125 | /** |
||
126 | * Create a new mobile audit instance. |
||
127 | * |
||
128 | * @return AbstractAudit |
||
129 | */ |
||
130 | protected function createMobileAudit() :AbstractAudit |
||
139 | |||
140 | /** |
||
141 | * Dynamically call the default audit instance. |
||
142 | * |
||
143 | * @param string $method |
||
144 | * @param array $parameters |
||
145 | * @return mixed |
||
146 | */ |
||
147 | public function __call($method, $parameters) |
||
151 | } |
||
152 |