1 | <?php |
||
19 | final class Analyzer implements AnalyzeDriver |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * @var AnalyzeAdapter |
||
24 | */ |
||
25 | private $adapter; |
||
26 | |||
27 | |||
28 | /** |
||
29 | * @var boolean |
||
30 | */ |
||
31 | private $started = false; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | private $analyzeResult = []; |
||
37 | |||
38 | |||
39 | /** |
||
40 | * @param AnalyzeAdapter $adapter |
||
41 | */ |
||
42 | public function __construct(AnalyzeAdapter $adapter) |
||
46 | |||
47 | |||
48 | public function start() |
||
49 | { |
||
50 | $this->adapter->start(); |
||
51 | $this->started = true; |
||
52 | } |
||
53 | |||
54 | public function stop() |
||
55 | { |
||
56 | $result = $this->adapter->stop(); |
||
57 | $this->analyzeResult = $result; |
||
58 | $this->started = false; |
||
59 | } |
||
60 | |||
61 | /** |
||
62 | * @return boolean |
||
63 | */ |
||
64 | public function isStarted() |
||
68 | |||
69 | /** |
||
70 | * @return AnalyzedResult |
||
71 | */ |
||
72 | public function getAnalyzeResult() |
||
76 | |||
77 | } |
||
78 |