1 | <?php namespace Arcanedev\Currencies\Entities; |
||
13 | class CurrencyCollection extends Collection |
||
14 | { |
||
15 | /* ------------------------------------------------------------------------------------------------ |
||
16 | | Main Functions |
||
17 | | ------------------------------------------------------------------------------------------------ |
||
18 | */ |
||
19 | /** |
||
20 | * Get a currency from the collection by iso code. |
||
21 | * |
||
22 | * @param string $iso |
||
23 | * @param mixed|null $default |
||
24 | * |
||
25 | * @return \Arcanedev\Currencies\Contracts\Entities\Currency |
||
26 | */ |
||
27 | 108 | public function get($iso, $default = null) |
|
31 | |||
32 | /** |
||
33 | * Load the currencies. |
||
34 | * |
||
35 | * @param array $currencies |
||
36 | * @param bool $includeNonIso |
||
37 | * |
||
38 | * @return self |
||
39 | */ |
||
40 | 612 | public function load(array $currencies, $includeNonIso = false) |
|
52 | |||
53 | /** |
||
54 | * Add a currency to the collection. |
||
55 | * |
||
56 | * @param string $key |
||
57 | * @param array $attributes |
||
58 | * |
||
59 | * @return self |
||
60 | */ |
||
61 | 612 | public function add($key, array $attributes) |
|
68 | |||
69 | /** |
||
70 | * Add a Currency object to the collection. |
||
71 | * |
||
72 | * @param \Arcanedev\Currencies\Contracts\Entities\Currency $currency |
||
73 | * |
||
74 | * @return self |
||
75 | */ |
||
76 | 612 | public function addOne(CurrencyContract $currency) |
|
82 | |||
83 | /** |
||
84 | * Check if the currency exists. |
||
85 | * |
||
86 | * @param string $iso |
||
87 | * |
||
88 | * @return \Arcanedev\Currencies\Contracts\Entities\Currency |
||
89 | * |
||
90 | * @throws \Arcanedev\Currencies\Exceptions\CurrencyNotFoundException |
||
91 | */ |
||
92 | 96 | public function findOrFails($iso) |
|
102 | |||
103 | /* ------------------------------------------------------------------------------------------------ |
||
104 | | Other Functions |
||
105 | | ------------------------------------------------------------------------------------------------ |
||
106 | */ |
||
107 | /** |
||
108 | * Add many currencies. |
||
109 | * |
||
110 | * @param array $items |
||
111 | * @param bool $isIso |
||
112 | */ |
||
113 | 612 | protected function loadMany($items, $isIso = false) |
|
121 | } |
||
122 |
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: