1 | <?php |
||
7 | class Box extends Widget implements Renderable |
||
8 | { |
||
9 | /** |
||
10 | * @var string |
||
11 | */ |
||
12 | protected $view = 'admin::widgets.box'; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | protected $title = 'Box header'; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $content = 'here is the box content.'; |
||
23 | |||
24 | /** |
||
25 | * @var array |
||
26 | */ |
||
27 | protected $tools = []; |
||
28 | |||
29 | /** |
||
30 | * Box constructor. |
||
31 | * |
||
32 | * @param string $title |
||
33 | * @param string $content |
||
34 | */ |
||
35 | public function __construct($title = '', $content = '') |
||
47 | |||
48 | /** |
||
49 | * Set box content. |
||
50 | * |
||
51 | * @param string $content |
||
52 | * |
||
53 | * @return $this |
||
54 | */ |
||
55 | public function content($content) |
||
65 | /** |
||
66 | * add tools . |
||
67 | * |
||
68 | * @param $content |
||
69 | * @return $this |
||
70 | * @internal param string $title |
||
71 | * |
||
72 | */ |
||
73 | public function addTools($content) |
||
79 | /** |
||
80 | * Set box title. |
||
81 | * |
||
82 | * @param string $title |
||
83 | * |
||
84 | * @return $this |
||
85 | */ |
||
86 | public function title($title) |
||
92 | |||
93 | /** |
||
94 | * Set box as collapsable. |
||
95 | * |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function collapsable() |
||
105 | |||
106 | /** |
||
107 | * Set box as removable. |
||
108 | * |
||
109 | * @return $this |
||
110 | */ |
||
111 | public function removable() |
||
118 | |||
119 | /** |
||
120 | * Set box style. |
||
121 | * |
||
122 | * @param string $styles |
||
123 | * |
||
124 | * @return $this|Box |
||
125 | */ |
||
126 | public function style($styles) |
||
140 | |||
141 | /** |
||
142 | * Add `box-solid` class to box. |
||
143 | * |
||
144 | * @return $this |
||
145 | */ |
||
146 | public function solid() |
||
150 | |||
151 | /** |
||
152 | * Variables in view. |
||
153 | * |
||
154 | * @return array |
||
155 | */ |
||
156 | protected function variables() |
||
165 | |||
166 | /** |
||
167 | * Render box. |
||
168 | * |
||
169 | * @return string |
||
170 | */ |
||
171 | public function render() |
||
175 | } |
||
176 |
It seems like the method you are trying to call exists only in some of the possible types.
Let’s take a look at an example:
Available Fixes
Add an additional type-check:
Only allow a single type to be passed if the variable comes from a parameter: