| Conditions | 3 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 13 |
| CRAP Score | 3 |
| Changes | 0 | ||
| 1 | <?php |
||
| 56 | 20 | public function buildValuesForBulkInsert($col_order, $col_values_bulk) |
|
| 57 | { |
||
| 58 | 20 | $cols = []; |
|
| 59 | 20 | foreach ($col_order as $col) { |
|
| 60 | 20 | $cols[] = $this->quoter->quoteName($col); |
|
| 61 | 20 | } |
|
| 62 | 20 | $cols = " (" . implode(', ', $cols) . ")"; |
|
| 63 | |||
| 64 | 20 | $vals = array(); |
|
| 65 | 20 | foreach ($col_values_bulk as $row_values) { |
|
| 66 | 20 | $vals[] = " (" . implode(', ', $row_values) . ")"; |
|
| 67 | 20 | } |
|
| 68 | |||
| 69 | 20 | return PHP_EOL . $cols . PHP_EOL |
|
| 70 | 20 | . "VALUES" . PHP_EOL |
|
| 71 | 20 | . implode("," . PHP_EOL, $vals); |
|
| 72 | } |
||
| 73 | } |
||
| 74 |
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: