1 | <?php |
||
7 | class Jetpack_Search_Debug_Bar extends Debug_Bar_Panel { |
||
8 | /** |
||
9 | * Holds singleton instance |
||
10 | * |
||
11 | * @var Jetpack_Search_Debug_Bar |
||
12 | */ |
||
13 | protected static $instance = null; |
||
14 | |||
15 | /** |
||
16 | * Holds an instance of Jetpack_Search |
||
17 | * |
||
18 | * @var Jetpack_Search |
||
19 | */ |
||
20 | private $jetpack_search; |
||
21 | |||
22 | /** |
||
23 | * The title to use in the debug bar navigation |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | public $title; |
||
28 | |||
29 | /** |
||
30 | * Constructor |
||
31 | */ |
||
32 | public function __construct() { |
||
37 | |||
38 | /** |
||
39 | * Returns the singleton instance of Jetpack_Search_Debug_Bar |
||
40 | * |
||
41 | * @return Jetpack_Search_Debug_Bar |
||
42 | */ |
||
43 | public static function instance() { |
||
49 | |||
50 | /** |
||
51 | * Enqueues styles for our panel in the debug bar |
||
52 | * |
||
53 | * @return void |
||
54 | */ |
||
55 | public function enqueue_scripts() { |
||
66 | |||
67 | /** |
||
68 | * Should the Jetpack Search Debug Bar show? |
||
69 | * |
||
70 | * Since we've previously done a check for the search module being activated, let's just return true. |
||
71 | * Later on, we can update this to only show when `is_search()` is true. |
||
72 | * |
||
73 | * @return boolean |
||
74 | */ |
||
75 | public function is_visible() { |
||
78 | |||
79 | /** |
||
80 | * Renders the panel content |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | public function render() { |
||
140 | |||
141 | /** |
||
142 | * Responsible for rendering the HTML necessary for the JSON toggle |
||
143 | * |
||
144 | * @param array $value The resonse from the API as an array. |
||
145 | * @return void |
||
146 | */ |
||
147 | public function render_json_toggle( $value ) { |
||
156 | } |
||
157 |
There are different options of fixing this problem.
If you want to be on the safe side, you can add an additional type-check:
If you are sure that the expression is traversable, you might want to add a doc comment cast to improve IDE auto-completion and static analysis:
Mark the issue as a false-positive: Just hover the remove button, in the top-right corner of this issue for more options.