Conditions | 1 |
Paths | 1 |
Total Lines | 21 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
15 | public function addIndex(array $attributes = []) |
||
16 | { |
||
17 | $indexColumn = $this->config->get('datatables.index_column', 'DT_RowIndex'); |
||
|
|||
18 | |||
19 | $attributes = array_merge([ |
||
20 | 'defaultContent' => '', |
||
21 | 'data' => $indexColumn, |
||
22 | 'name' => $indexColumn, |
||
23 | 'title' => '', |
||
24 | 'render' => null, |
||
25 | 'orderable' => false, |
||
26 | 'searchable' => false, |
||
27 | 'exportable' => false, |
||
28 | 'printable' => true, |
||
29 | 'footer' => '', |
||
30 | ], $attributes); |
||
31 | |||
32 | $this->collection->push(new Column($attributes)); |
||
33 | |||
34 | return $this; |
||
35 | } |
||
36 | } |
||
37 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: