| Conditions | 5 |
| Paths | 5 |
| Total Lines | 16 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 31 | private function getFillables(array $fields): string |
||
| 32 | { |
||
| 33 | $fillables = ''; |
||
| 34 | |||
| 35 | foreach ($fields as $index => $field) { |
||
| 36 | if ($index === 0) { |
||
| 37 | $fillables .= "'{$field['name']}'" . (count($fields) > 1 ? ',' : ''); |
||
| 38 | } elseif ($index === count($fields) - 1) { |
||
| 39 | $fillables .= PHP_EOL . str_repeat(' ', 8) . "'{$field['name']}'"; |
||
| 40 | } else { |
||
| 41 | $fillables .= PHP_EOL . str_repeat(' ', 8) . "'{$field['name']}',"; |
||
| 42 | } |
||
| 43 | } |
||
| 44 | |||
| 45 | return $fillables; |
||
| 46 | } |
||
| 47 | } |
||
| 48 |