1 | <?php |
||
21 | class Supervisor implements SupervisorInterface |
||
22 | { |
||
23 | /** |
||
24 | * Used to create unique node names when required. |
||
25 | * |
||
26 | * @var int |
||
27 | */ |
||
28 | private static $index = 0; |
||
29 | |||
30 | /** |
||
31 | * Active set of imports. |
||
32 | * |
||
33 | * @var ImporterInterface[] |
||
34 | */ |
||
35 | private $importers = []; |
||
36 | |||
37 | /** |
||
38 | * @var SyntaxInterface |
||
39 | */ |
||
40 | protected $syntax = null; |
||
41 | |||
42 | /** |
||
43 | * @var LoaderInterface |
||
44 | */ |
||
45 | protected $loader = null; |
||
46 | |||
47 | /** |
||
48 | * @param LoaderInterface $loader |
||
49 | * @param SyntaxInterface $syntax |
||
50 | */ |
||
51 | public function __construct(LoaderInterface $loader, SyntaxInterface $syntax) |
||
56 | |||
57 | /** |
||
58 | * {@inheritdoc} |
||
59 | */ |
||
60 | public function syntax() |
||
64 | |||
65 | /** |
||
66 | * Add new elements import locator. |
||
67 | * |
||
68 | * @param ImporterInterface $import |
||
69 | */ |
||
70 | public function registerImporter(ImporterInterface $import) |
||
74 | |||
75 | /** |
||
76 | * Active templater imports. |
||
77 | * |
||
78 | * @return ImporterInterface[] |
||
79 | */ |
||
80 | public function getImporters() |
||
84 | |||
85 | /** |
||
86 | * Remove all element importers. |
||
87 | */ |
||
88 | public function flushImporters() |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | public function tokenBehaviour(array $token, array $content, Node $node) |
||
142 | |||
143 | /** |
||
144 | * Create node based on given location with identical supervisor (cloned). |
||
145 | * |
||
146 | * @param string $path |
||
147 | * @param array $token Context token. |
||
148 | * @return Node |
||
149 | * @throws StemplerException |
||
150 | */ |
||
151 | public function createNode($path, array $token = []) |
||
171 | |||
172 | /** |
||
173 | * Get unique placeholder name, unique names are required in some cases to correctly process |
||
174 | * includes and etc. |
||
175 | * |
||
176 | * @return string |
||
177 | */ |
||
178 | public function uniquePlaceholder() |
||
182 | |||
183 | /** |
||
184 | * Clarify exeption with it's actual location. |
||
185 | * |
||
186 | * @param string $path |
||
187 | * @param StemplerException $exception |
||
188 | * @return StemplerException |
||
189 | */ |
||
190 | protected function clarifyException($path, StemplerException $exception) |
||
214 | } |
Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.
The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.
This check looks for comments that seem to be mostly valid code and reports them.