Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| DbUtilsTrait | |
100.00% |
3 / 3 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| dbUtils | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| setDbUtils | |
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 DbUtilsTrait { |
| 8 | protected function dbUtils(): DbUtils { |
| 9 | $util = WithUtilsCache::get('dbUtils'); |
| 10 | assert($util); |
| 11 | return $util; |
| 12 | } |
| 13 | |
| 14 | #[Required] |
| 15 | public function setDbUtils(DbUtils $new): void { |
| 16 | WithUtilsCache::set('dbUtils', $new); |
| 17 | } |
| 18 | } |