| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Lines | 13 |
| Ratio | 100 % |
| Tests | 6 |
| CRAP Score | 3.0261 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | 18 | View Code Duplication | public function oldOrAttribute($model, $locale = null) |
| 36 | { |
||
| 37 | 18 | $name = $this->name(); |
|
| 38 | 18 | if ($locale) { |
|
| 39 | $name .= '.'. $locale; |
||
| 40 | } |
||
| 41 | |||
| 42 | 18 | if ($this->hasOld($name)) { |
|
| 43 | 17 | return $this->old($name); |
|
| 44 | } |
||
| 45 | |||
| 46 | 1 | return $this->getAttribute($model, $locale); |
|
| 47 | } |
||
| 48 | |||
| 62 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@returnannotation as described here.