1+
12<?php
23
34use Symfony \Component \VarDumper \VarDumper ;
5+ use Timber \Timber ;
46
57include 'vendor/autoload.php ' ;
68
911 */
1012class Debug_Bar_Timber extends Debug_Bar_Panel {
1113
12- public $ files ;
13- public $ datas ;
14- public $ filenames ;
15- public $ php_files ;
14+ public array $ files ;
15+ public array $ datas ;
16+ public array $ filenames ;
17+ public array $ php_files ;
1618
1719 /**
1820 * Initialize the toolbar
1921 */
20- public function init () {
22+ public function init (): void {
2123 $ this ->php_files = array ();
2224 $ this ->datas = array ();
2325 $ this ->files = array ();
2426 $ this ->filenames = array ();
2527 $ this ->title ('Timber ' );
2628 add_action ('wp_ajax_debug_bar_console ' , array ($ this , 'ajax ' ));
2729
28- $ timber = new \ Timber \ Timber ();
30+ $ timber = new Timber ();
2931 if (version_compare ($ timber ::$ version , '2.0.0 ' , '>= ' )) {
3032 add_action ( 'timber/loader/render_file ' , array ( $ this , 'add_file ' ) );
3133 add_filter ( 'timber/render/file ' , array ( $ this , 'render_file ' ) );
@@ -55,7 +57,7 @@ public function add_php_file($php_file){
5557 /**
5658 * @param $file
5759 */
58- public function add_file ($ file ) {
60+ public function add_file ($ file ): void {
5961 $ this ->files [] = $ file ;
6062 }
6163
@@ -80,21 +82,20 @@ public function render_data($data) {
8082 }
8183
8284
83- public function prerender (){
85+ public function prerender (): void {
8486 $ this ->set_visible (true );
8587 }
8688
8789 /**
8890 * @param mixed ...$vars
8991 */
90- public function dumpAll (...$ vars )
91- {
92+ public function dumpAll (...$ vars ): void {
9293 foreach ($ vars as $ v ) {
9394 VarDumper::dump ($ v );
9495 }
9596 }
9697
97- public function render (){
98+ public function render (): void {
9899 $ i = 0 ;
99100 foreach ($ this ->filenames as $ filename ){
100101 echo '<h3> ' .$ filename .'</h3> ' ;
@@ -135,7 +136,7 @@ public function render(){
135136 $ keynames .= "' " . $ array_keyname . "', " ;
136137 }
137138 $ keynames = substr ($ keynames , 0 , -2 );
138- echo "<div style='text-indent: .25in'> { $ varName} : array of the form array[0][X] where X is { $ keynames} </div> " ;
139+ echo "<div style='text-indent: .25in'> $ varName: array of the form array[0][X] where X is $ keynames</div> " ;
139140 }
140141 $ i ++;
141142 }
0 commit comments