1 | <?php |
||
24 | class Indexer implements ListenerRegistry { |
||
25 | /** |
||
26 | * @var Log |
||
27 | */ |
||
28 | protected $log; |
||
29 | |||
30 | /** |
||
31 | * @var Insert |
||
32 | */ |
||
33 | protected $insert; |
||
34 | |||
35 | /** |
||
36 | * @var \PhpParser\Parser |
||
37 | */ |
||
38 | protected $parser; |
||
39 | |||
40 | /** |
||
41 | * @var array string => array() |
||
42 | */ |
||
43 | protected $listeners_enter_definition; |
||
44 | |||
45 | /** |
||
46 | * @var array string => array() |
||
47 | */ |
||
48 | protected $listeners_enter_misc; |
||
49 | |||
50 | 53 | public function __construct(Log $log, \PhpParser\Parser $parser, Insert $insert) { |
|
61 | |||
62 | /** |
||
63 | * Index a directory. |
||
64 | * |
||
65 | * @param string $path |
||
66 | * @param array $ignore_paths |
||
67 | * @return null |
||
68 | */ |
||
69 | 7 | public function index_directory($path, array $ignore_paths) { |
|
93 | |||
94 | /** |
||
95 | * Initialize the filesystem abstraction. |
||
96 | * |
||
97 | * @return Flightcontrol |
||
98 | */ |
||
99 | 7 | public function init_flightcontrol($path) { |
|
104 | |||
105 | /** |
||
106 | * @param string $base_dir |
||
107 | * @param string $path |
||
108 | * @return null |
||
109 | */ |
||
110 | public function index_file($base_dir, $path) { |
||
121 | |||
122 | /** |
||
123 | * @param string $path |
||
124 | * @param string $content |
||
125 | * @return null |
||
126 | */ |
||
127 | 53 | public function index_content($path, $content) { |
|
143 | |||
144 | // from ListenerRegistry |
||
145 | |||
146 | /** |
||
147 | * @inheritdoc |
||
148 | */ |
||
149 | public function on_enter_definition($types, \Closure $listener) { |
||
153 | |||
154 | /** |
||
155 | * @inheritdoc |
||
156 | */ |
||
157 | 25 | public function on_enter_misc($classes, \Closure $listener) { |
|
161 | |||
162 | // generalizes over over on_enter |
||
163 | |||
164 | /** |
||
165 | * TODO: Maybe remove this in favour of duplicates. |
||
166 | * |
||
167 | * @param string $what |
||
168 | * @param array|null $things |
||
169 | */ |
||
170 | 25 | protected function on_enter_something($what, $things, \Closure $listener) { |
|
185 | } |
||
186 |