Conditions | 2 |
Paths | 2 |
Total Lines | 24 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
29 | public function fromArray(array $rates): Rate |
||
30 | { |
||
31 | if (empty($rates)) { |
||
32 | throw new EmptyRateListException(); |
||
33 | } |
||
34 | |||
35 | $ratesSum = array_sum( |
||
36 | array_map( |
||
37 | function(Rate $rate): float |
||
38 | { |
||
39 | return $rate->getRate(); |
||
40 | }, |
||
41 | $rates |
||
42 | ) |
||
43 | ); |
||
44 | |||
45 | $averageRate = $ratesSum / count($rates); |
||
46 | $firstRate = array_shift($rates); |
||
47 | |||
48 | return new Rate( |
||
49 | $firstRate->getCurrencyFrom(), |
||
50 | $firstRate->getCurrencyTo(), |
||
51 | $firstRate->getDate(), |
||
52 | $averageRate |
||
53 | ); |
||
56 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"]
, you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths