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