| Conditions | 3 |
| Paths | 4 |
| Total Lines | 13 |
| Lines | 13 |
| Ratio | 100 % |
| Tests | 0 |
| CRAP Score | 12 |
| Changes | 0 | ||
| 1 | <?php |
||
| 21 | View Code Duplication | public function oldOrDefault($locale = null) |
|
| 22 | { |
||
| 23 | $name = $this->name(); |
||
| 24 | if ($locale) { |
||
| 25 | $name .= '.'. $locale; |
||
| 26 | } |
||
| 27 | |||
| 28 | if ($this->hasOld($name)) { |
||
| 29 | return $this->old($name); |
||
| 30 | } |
||
| 31 | |||
| 32 | return $this->getDefault(); |
||
| 33 | } |
||
| 34 | |||
| 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.