| Conditions | 4 |
| Paths | 6 |
| Total Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 20 |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function oldOrAttribute($model, $default = null, $locale = null) |
||
| 36 | { |
||
| 37 | $name = $this->name(); |
||
| 38 | if ($locale) { |
||
| 39 | $name .= '.'. $locale; |
||
| 40 | } |
||
| 41 | |||
| 42 | if ($this->hasOld($name)) { |
||
| 43 | return $this->old($name); |
||
| 44 | } |
||
| 45 | |||
| 46 | return $this->getAttribute($model, $locale) ?: $default; |
||
| 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.