| Total Complexity | 2 |
| Total Lines | 35 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 15 | final class StockTickerFacade extends AbstractFacade |
||
| 16 | { |
||
| 17 | private const DEFAULT_MAX_NEWS_TO_FETCH = 9; |
||
| 18 | |||
| 19 | /** |
||
| 20 | * @param string[] $channelNames |
||
| 21 | */ |
||
| 22 | 2 | public function sendNotifications( |
|
| 23 | array $channelNames, |
||
| 24 | NotifierPolicy $policy, |
||
| 25 | int $maxNewsToFetch = self::DEFAULT_MAX_NEWS_TO_FETCH, |
||
| 26 | ): NotifyResult { |
||
| 27 | 2 | $channels = $this->getFactory() |
|
| 28 | 2 | ->createChannels($channelNames); |
|
| 29 | |||
| 30 | 2 | $crawlResult = $this->crawlStock($policy->symbols(), $maxNewsToFetch); |
|
| 31 | |||
| 32 | 2 | return $this->getFactory() |
|
| 33 | 2 | ->createNotifier($policy, ...$channels) |
|
| 34 | 2 | ->notify($crawlResult); |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @param string[] $symbols |
||
| 39 | */ |
||
| 40 | 4 | public function crawlStock( |
|
| 50 | } |
||
| 51 | } |
||
| 52 |