1 | <?php |
||
16 | class ECBSource implements SourceInterface |
||
17 | { |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private $rates; |
||
22 | |||
23 | /** |
||
24 | * @var CachedRemoteData |
||
25 | */ |
||
26 | private $cachedRemoteData; |
||
27 | |||
28 | /** |
||
29 | * @param CacheItemPoolInterface $cachePool |
||
30 | * @param string $key |
||
31 | */ |
||
32 | 1 | public function __construct(CacheItemPoolInterface $cachePool, $key = 'ECBSource') |
|
40 | |||
41 | /** |
||
42 | * @return CachedRemoteData |
||
43 | */ |
||
44 | 1 | public function getCachedRemoteData() |
|
48 | |||
49 | /** |
||
50 | * @return string |
||
51 | * @throws Exception If error retrieving remote data |
||
52 | */ |
||
53 | 1 | public function getData() |
|
57 | |||
58 | /** |
||
59 | * @return array |
||
60 | * @throws Exception If error retrieving remote data |
||
61 | */ |
||
62 | 2 | public function getRates() |
|
82 | |||
83 | /** |
||
84 | * @param Currency $currency |
||
85 | * @return float |
||
86 | * @throws Exception If error retrieving remote data |
||
87 | */ |
||
88 | 1 | public function getRate(Currency $currency) |
|
101 | |||
102 | /** |
||
103 | * @param Currency $from |
||
104 | * @param Currency $to |
||
105 | * @return float |
||
106 | */ |
||
107 | 1 | public function getRateBetween(Currency $from, Currency $to) |
|
114 | } |
||
115 |
This check marks implicit conversions of arrays to boolean values in a comparison. While in PHP an empty array is considered to be equal (but not identical) to false, this is not always apparent.
Consider making the comparison explicit by using
empty(..)
or! empty(...)
instead.