Conditions | 4 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 20 |
Changes | 0 |
1 | <?php |
||
16 | public function addColumns(array $names, $order = false) |
||
17 | { |
||
18 | foreach ($names as $name => $attribute) { |
||
19 | if (is_int($name)) { |
||
20 | $name = $attribute; |
||
21 | } |
||
22 | |||
23 | $this->addColumn($name, function ($model) use ($attribute) { |
||
24 | return $model->getAttribute($attribute); |
||
25 | }, is_int($order) ? $order++ : $order); |
||
26 | } |
||
27 | |||
28 | return $this; |
||
29 | } |
||
30 | } |
||
31 |