| Conditions | 3 |
| Paths | 3 |
| Total Lines | 19 |
| Code Lines | 14 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | 22 | public function buildValuesForInsert($col_values) |
|
| 30 | { |
||
| 31 | 22 | $cols = []; |
|
| 32 | 22 | $values = []; |
|
| 33 | 22 | foreach ($col_values as $col => $value) { |
|
| 34 | 22 | $cols[] = $this->quoter->quoteName($col); |
|
| 35 | 22 | if ($value instanceof RawValue) { |
|
| 36 | $values[] = $this->quoter->quoteNamesIn((string) $value); |
||
| 37 | } else { |
||
| 38 | 22 | $values[] = (string) $value; |
|
| 39 | } |
||
| 40 | 22 | } |
|
| 41 | |||
| 42 | return ' (' |
||
| 43 | 22 | . $this->indentCsv($cols) |
|
| 44 | 22 | . PHP_EOL . ') VALUES (' |
|
| 45 | 22 | . $this->indentCsv($values) |
|
| 46 | 22 | . PHP_EOL . ')'; |
|
| 47 | } |
||
| 48 | |||
| 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: