1 | <?php |
||
24 | class Table |
||
25 | { |
||
26 | /** |
||
27 | * @var array |
||
28 | */ |
||
29 | protected $rows = []; |
||
30 | |||
31 | /** |
||
32 | * @var array |
||
33 | */ |
||
34 | protected $headerRows = []; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | protected $footerRows = []; |
||
40 | |||
41 | /** |
||
42 | * @var Row The row that new cells will be added to |
||
43 | */ |
||
44 | protected $currentRow = null; |
||
45 | |||
46 | /** |
||
47 | * @var array |
||
48 | */ |
||
49 | protected $attributes = []; |
||
50 | |||
51 | /** |
||
52 | * Adds a Cell to the current Row |
||
53 | * |
||
54 | * @param mixed $content Anything that is not a Cell will be added as content to a new Cell |
||
55 | * @param array $attributes The array of attributes to assign the new Cell |
||
56 | * |
||
57 | * @return $this |
||
58 | */ |
||
59 | public function addCell($content, $attributes = array()) |
||
74 | |||
75 | /** |
||
76 | * Creates a new Cell with the given content |
||
77 | * |
||
78 | * @param mixed $content The content for the new Cell |
||
79 | * @param array $attributes The attributes for the Cell |
||
80 | * |
||
81 | * @return Cell |
||
82 | */ |
||
83 | protected function constructCell($content = null, $attributes = array()) |
||
90 | |||
91 | /** |
||
92 | * Creates a new Row object and assigns it as the currently active row |
||
93 | * |
||
94 | * @param EnumRowType $type The type of the new row, uses Body by default |
||
95 | * |
||
96 | * @return $this |
||
97 | */ |
||
98 | public function createRow($type = EnumRowType::Body) |
||
105 | |||
106 | /** |
||
107 | * Adds the Row that's currently being constructed to the list of finished Rows |
||
108 | * |
||
109 | * @return $this |
||
110 | */ |
||
111 | public function addRow() |
||
132 | |||
133 | /** |
||
134 | * Returns a list of all currently consructed Rows |
||
135 | * |
||
136 | * @return array |
||
137 | */ |
||
138 | public function getRows() |
||
142 | |||
143 | /** |
||
144 | * Returns a list of currently constructed header rows |
||
145 | * |
||
146 | * @return array |
||
147 | */ |
||
148 | public function getHeaderRows() |
||
152 | |||
153 | /** |
||
154 | * Returns a list of currently constructed footer rows |
||
155 | * |
||
156 | * @return array |
||
157 | */ |
||
158 | public function getFooterRows() |
||
162 | |||
163 | /** |
||
164 | * Gets the currently active row. The row will not be added until addRow() is called |
||
165 | * |
||
166 | * @return Row |
||
167 | */ |
||
168 | public function getCurrentRow() |
||
177 | |||
178 | /** |
||
179 | * Sets the attributes for the currently active Row |
||
180 | * |
||
181 | * @param array $attributes |
||
182 | * |
||
183 | * @return $this |
||
184 | */ |
||
185 | public function setCurrentRowAttributes(array $attributes) |
||
191 | |||
192 | /** |
||
193 | * Returns the attributes of this Table |
||
194 | * |
||
195 | * @return array |
||
196 | */ |
||
197 | public function getAttributes() |
||
201 | |||
202 | /** |
||
203 | * Sets the atributes of the Table |
||
204 | * |
||
205 | * @param array $newAttributes |
||
206 | * |
||
207 | * @return $this |
||
208 | */ |
||
209 | public function setAttributes(array $newAttributes) |
||
215 | } |
||
216 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: