Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
TelegramUtilsTrait | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
telegramUtils | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
setTelegramUtils | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 |
1 | <?php |
2 | |
3 | namespace Olz\Utils; |
4 | |
5 | use Symfony\Contracts\Service\Attribute\Required; |
6 | |
7 | trait TelegramUtilsTrait { |
8 | protected function telegramUtils(): TelegramUtils { |
9 | $util = WithUtilsCache::get('telegramUtils'); |
10 | assert($util); |
11 | return $util; |
12 | } |
13 | |
14 | #[Required] |
15 | public function setTelegramUtils(TelegramUtils $new): void { |
16 | WithUtilsCache::set('telegramUtils', $new); |
17 | } |
18 | } |