1 | <?php namespace Arcanedev\Currencies\Entities; |
||
13 | class CurrencyCollection extends Collection |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Main Functions |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * @param array $currencies |
||
21 | * @param bool $includeNonIso |
||
22 | * |
||
23 | * @return self |
||
24 | */ |
||
25 | 180 | public function load(array $currencies, $includeNonIso = false) |
|
37 | |||
38 | /** |
||
39 | * Add a currency to the collection. |
||
40 | * |
||
41 | * @param string $key |
||
42 | * @param array $attributes |
||
43 | * |
||
44 | * @return self |
||
45 | */ |
||
46 | 180 | public function add($key, array $attributes) |
|
55 | |||
56 | /** |
||
57 | * Add a Currency object to the collection. |
||
58 | * |
||
59 | * @param \Arcanedev\Currencies\Contracts\Entities\Currency $currency |
||
60 | * |
||
61 | * @return self |
||
62 | */ |
||
63 | 180 | public function addOne(CurrencyContract $currency) |
|
69 | |||
70 | /** |
||
71 | * Check if the currency exists. |
||
72 | * |
||
73 | * @param string $iso |
||
74 | * |
||
75 | * @return \Arcanedev\Currencies\Entities\Currency |
||
76 | * |
||
77 | * @throws \Arcanedev\Currencies\Exceptions\CurrencyNotFoundException |
||
78 | */ |
||
79 | 24 | public function findOrFails($iso) |
|
89 | |||
90 | /* ------------------------------------------------------------------------------------------------ |
||
91 | | Other Functions |
||
92 | | ------------------------------------------------------------------------------------------------ |
||
93 | */ |
||
94 | /** |
||
95 | * Add many currencies. |
||
96 | * |
||
97 | * @param array $items |
||
98 | * @param bool $isIso |
||
99 | */ |
||
100 | 180 | protected function loadMany($items, $isIso = false) |
|
108 | } |
||
109 |
If you access a property on an interface, you most likely code against a concrete implementation of the interface.
Available Fixes
Adding an additional type check:
Changing the type hint: