| Total Complexity | 3 |
| Total Lines | 29 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 13 | abstract class AbstractService |
||
| 14 | { |
||
| 15 | use ClearCache; |
||
| 16 | |||
| 17 | private SessionInterface $session; |
||
| 18 | private CsrfTokenManagerInterface $tokenManager; |
||
| 19 | |||
| 20 | public function __construct(CsrfTokenManagerInterface $tokenManager, RequestStack $requestStack) |
||
| 21 | { |
||
| 22 | $this->tokenManager = $tokenManager; |
||
| 23 | $this->session = $requestStack->getSession(); |
||
| 24 | } |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Checks the validity of a CSRF token. |
||
| 28 | */ |
||
| 29 | protected function isCsrfTokenValid(string $id, ?string $token): bool |
||
| 32 | } |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Adds a flash message to the current session for type. |
||
| 36 | * |
||
| 37 | * @throws \LogicException |
||
| 38 | */ |
||
| 39 | protected function addFlash(string $type, string $message): void |
||
| 44 |