1 | <?php |
||
31 | class Manager implements ManagerInterface |
||
32 | { |
||
33 | use LoggerAwareTrait; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | protected $baseCurrency; |
||
39 | |||
40 | /** |
||
41 | * @var RepositoryInterface |
||
42 | */ |
||
43 | protected $repository; |
||
44 | |||
45 | /** |
||
46 | * @var SourcesRegistryInterface |
||
47 | */ |
||
48 | protected $sources; |
||
49 | |||
50 | /** |
||
51 | * @var ProcessorsRegistryInterface |
||
52 | */ |
||
53 | protected $processors; |
||
54 | |||
55 | /** |
||
56 | * @var RatesConfigurationRegistryInterface |
||
57 | */ |
||
58 | protected $configurations; |
||
59 | |||
60 | public function __construct($baseCurrency, RepositoryInterface $repository, SourcesRegistryInterface $sources, ProcessorsRegistryInterface $processors, RatesConfigurationRegistryInterface $configurations) |
||
61 | { |
||
62 | $this->baseCurrency = CurrencyCodeUtil::clean($baseCurrency); |
||
63 | $this->repository = $repository; |
||
64 | $this->configurations = $configurations; |
||
65 | $this->sources = $sources; |
||
66 | $this->processors = $processors; |
||
67 | } |
||
68 | |||
69 | /** |
||
70 | * {@inheritdoc} |
||
71 | */ |
||
72 | public function has($sourceName, $currencyCode, $date = null, $rateType = 'default') |
||
73 | { |
||
74 | return $this->repository->has($sourceName, CurrencyCodeUtil::clean($currencyCode), $date, $rateType); |
||
75 | } |
||
76 | |||
77 | /** |
||
78 | * {@inheritdoc} |
||
79 | */ |
||
80 | public function get($sourceName, $currencyCode, $date = null, $rateType = 'default') |
||
84 | |||
85 | /** |
||
86 | * {@inheritdoc} |
||
87 | */ |
||
88 | public function latest($sourceName, $currencyCode, $rateType = 'default') |
||
92 | |||
93 | /** |
||
94 | * {@inheritdoc} |
||
95 | */ |
||
96 | public function today($sourceName, $currencyCode, $rateType = 'default') |
||
118 | |||
119 | /** |
||
120 | * {@inheritdoc} |
||
121 | */ |
||
122 | public function fetch($sourceName = null, $date = null) |
||
152 | } |
||
153 |
If a method or function can return multiple different values and unless you are sure that you only can receive a single value in this context, we recommend to add an additional type check:
If this a common case that PHP Analyzer should handle natively, please let us know by opening an issue.