1 | <?php |
||
22 | class Analyzer implements AnalyzerInterface, LoggerAwareInterface |
||
23 | { |
||
24 | use LoggerAwareTrait; |
||
25 | |||
26 | /** |
||
27 | * @var AnalyzerInterface[] |
||
28 | */ |
||
29 | private const DEFAULTS = [ |
||
30 | // Change opcodes priorities |
||
31 | PrioritizeAnalyzer::class, |
||
32 | |||
33 | // Should be last |
||
34 | LoggerAnalyzer::class, |
||
35 | ]; |
||
36 | |||
37 | /** |
||
38 | * @var array|AnalyzerInterface[] |
||
39 | */ |
||
40 | private $instances = []; |
||
41 | |||
42 | /** |
||
43 | * Analyzer constructor. |
||
44 | */ |
||
45 | public function __construct() |
||
49 | |||
50 | /** |
||
51 | * @return void |
||
52 | */ |
||
53 | private function bootDefaults(): void |
||
59 | |||
60 | /** |
||
61 | * @param AnalyzerInterface $analyzer |
||
62 | * @return Analyzer |
||
63 | */ |
||
64 | public function addAnalyzer(AnalyzerInterface $analyzer): Analyzer |
||
74 | |||
75 | /** |
||
76 | * @param LoggerInterface $logger |
||
77 | * @return Analyzer |
||
78 | */ |
||
79 | public function setLogger(LoggerInterface $logger): Analyzer |
||
91 | |||
92 | /** |
||
93 | * @param iterable $opcodes |
||
94 | * @return iterable |
||
95 | */ |
||
96 | public function analyze(iterable $opcodes): iterable |
||
104 | } |
||
105 |