| Conditions | 3 |
| Paths | 3 |
| Total Lines | 25 |
| Code Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 10 | public static function makeColumnPhpCode() |
||
| 11 | { |
||
| 12 | $labels = request('column'); |
||
| 13 | $name = request('name'); |
||
| 14 | $isImage = request('is_image'); |
||
| 15 | $isDownload = request('is_download'); |
||
| 16 | $callback = request('callback'); |
||
| 17 | $width = request('width'); |
||
| 18 | |||
| 19 | $indent = str_repeat(' ', 8); |
||
| 20 | |||
| 21 | $columnScript = []; |
||
| 22 | $columnScript[] = $indent.'$this->col[] = [];'; |
||
| 23 | foreach ($labels as $i => $label) { |
||
| 24 | |||
| 25 | if (! $name[$i]) { |
||
| 26 | continue; |
||
| 27 | } |
||
| 28 | |||
| 29 | $colProperties = ["'label' => '$label'", "'name' => '{$name[$i]}'"]; |
||
| 30 | $colProperties = self::addProperties($colProperties, $isImage[$i], $isDownload[$i], $callback[$i], $width[$i]); |
||
| 31 | |||
| 32 | $columnScript[] = $indent.'$this->col[] = ['.implode(", ", $colProperties).'];'; |
||
| 33 | } |
||
| 34 | return implode("\n", $columnScript); |
||
|
|
|||
| 35 | } |
||
| 62 | } |