Conditions | 5 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 30 |
Changes | 0 |
1 | <?php |
||
20 | public function getFirstAvailable() |
||
21 | { |
||
22 | foreach (['eur', 'usd'] as $attribute) { |
||
23 | if ($this->hasProperty($attribute) && !empty($this->{$attribute})) { |
||
24 | foreach ($this->{$attribute} as $field => $value) { |
||
25 | $this->{$field} = $value; |
||
26 | } |
||
27 | break; |
||
28 | } |
||
29 | } |
||
30 | |||
31 | return $this; |
||
32 | } |
||
34 |