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