1 | <?php |
||
25 | class HTMLConverter |
||
26 | { |
||
27 | /** |
||
28 | * table class attribute value. |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $class_name = 'table-csv-data'; |
||
33 | |||
34 | /** |
||
35 | * table id attribute value. |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | protected $id_value = ''; |
||
40 | |||
41 | /** |
||
42 | * @var XMLConverter |
||
43 | */ |
||
44 | protected $xml_converter; |
||
45 | |||
46 | /** |
||
47 | 6 | * New Instance. |
|
48 | */ |
||
49 | 6 | public function __construct() |
|
57 | |||
58 | /** |
||
59 | * Convert an Record collection into a DOMDocument. |
||
60 | * |
||
61 | 3 | * @param array|Traversable $records The tabular data collection |
|
62 | * @param array $headerRecord An optional array of headers to output to the table using `<thead>` and `<th>` elements |
||
63 | 3 | * @param array $footerRecord An optional array of footers to output to the table using `<tfoot>` and `<th>` elements |
|
64 | 3 | * |
|
65 | 3 | * @return string |
|
66 | */ |
||
67 | 3 | public function convert($records, array $headerRecord = [], array $footerRecord = []): string |
|
101 | 3 | ||
102 | /** |
||
103 | 3 | * HTML table class name setter. |
|
104 | 3 | * |
|
105 | * @throws DOMException if the id_value contains any type of whitespace |
||
106 | 3 | */ |
|
107 | public function table(string $class_name, string $id_value = ''): self |
||
118 | |||
119 | /** |
||
120 | * HTML tr record offset attribute setter. |
||
121 | */ |
||
122 | public function tr(string $record_offset_attribute_name): self |
||
129 | |||
130 | /** |
||
131 | * HTML td field name attribute setter. |
||
132 | */ |
||
133 | public function td(string $fieldname_attribute_name): self |
||
140 | |||
141 | /** |
||
142 | * Create a DOMElement representing a single record of data |
||
143 | * |
||
144 | * @param string $recordTagName |
||
145 | * @param string $fieldTagName |
||
146 | * @param array $record |
||
147 | * @param DOMDocument $doc |
||
148 | * |
||
149 | * @return DOMElement |
||
150 | */ |
||
151 | private function createRecordRow(string $recordTagName, string $fieldTagName, array $record, DOMDocument $doc) : DOMElement |
||
162 | |||
163 | /** |
||
164 | * Style the table dom element |
||
165 | * |
||
166 | * @param DOMElement $table_element |
||
167 | */ |
||
168 | private function styleTableElement(DOMElement $table_element) |
||
173 | } |
||
174 |
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: