| Conditions | 3 |
| Paths | 3 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 3.072 |
| Changes | 0 | ||
| 1 | <?php |
||
| 28 | 16 | public function buildValuesForUpdate($col_values) |
|
| 29 | { |
||
| 30 | 16 | $values = array(); |
|
| 31 | 16 | foreach ($col_values as $col => $value) { |
|
| 32 | 16 | $col = $this->quoter->quoteName($col); |
|
| 33 | 16 | if ($value instanceof RawValue) { |
|
| 34 | $value = $this->quoter->quoteNamesIn((string) $value); |
||
| 35 | } |
||
| 36 | 16 | $values[] = "{$col} = {$value}"; |
|
| 37 | 16 | } |
|
| 38 | |||
| 39 | 16 | return PHP_EOL . 'SET' . $this->indentCsv($values); |
|
| 40 | } |
||
| 41 | } |
||
| 42 |
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: