| Conditions | 3 |
| Paths | 2 |
| Total Lines | 14 |
| Code Lines | 8 |
| Lines | 14 |
| Ratio | 100 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 34 | View Code Duplication | protected function setKeysForSaveQuery(Builder $query) |
|
| 35 | { |
||
| 36 | $key = $this->getKeyName(); |
||
| 37 | |||
| 38 | if (is_array($key)) { |
||
| 39 | foreach ($key as $k) { |
||
| 40 | $query->where($k, '=', $this->getKeyValueForSaveQuery($k)); |
||
| 41 | } |
||
| 42 | } else { |
||
| 43 | $query->where($this->getKeyName(), '=', $this->getKeyForSaveQuery()); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $query; |
||
| 47 | } |
||
| 48 | |||
| 64 |
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: