Total Complexity | 4 |
Total Lines | 27 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | class DebugBarExtension implements ExtensionInterface |
||
15 | { |
||
16 | public ?Template $template = null; |
||
17 | public JavascriptRenderer $renderer; |
||
18 | |||
19 | public function __construct( |
||
20 | private Engine $engine, |
||
21 | private DebugBar $debugBar, |
||
22 | ) { |
||
23 | $this->renderer = $this->debugBar->getJavascriptRenderer('https://' . getenv('DOMAIN_NAME') . '/debug-bar'); |
||
24 | } |
||
25 | |||
26 | public function register(Engine $engine) |
||
27 | { |
||
28 | $engine->registerFunction('debugBarJs', [$this, 'debugBarJs']); |
||
29 | $engine->registerFunction('debugBarHtml', [$this, 'debugBarHtml']); |
||
30 | } |
||
31 | |||
32 | public function debugBarJs() : string |
||
36 | } |
||
37 | |||
38 | public function debugBarHtml() : string |
||
41 | } |
||
42 | } |
||
43 |