| Total Complexity | 2 |
| Total Lines | 19 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 12 | class BotFactory |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * @var TelegramApiFactoryInterface|null |
||
| 16 | */ |
||
| 17 | private $telegramApiFactory; |
||
| 18 | |||
| 19 | public function create(): BotInterface |
||
| 20 | { |
||
| 21 | $this->telegramApiFactory = $this->telegramApiFactory ?? new TelegramApiFactory(); |
||
| 22 | |||
| 23 | return new UpdateBot($this->telegramApiFactory->create()); |
||
| 24 | } |
||
| 25 | |||
| 26 | public function setTelegramApiFactory(TelegramApiFactoryInterface $telegramApiFactory): self |
||
| 31 | } |
||
| 32 | } |
||
| 33 |