Skip to content
Snippets Groups Projects
Open Nitin Lama requested to merge issue/sessionless-3295666:1.x into 1.x
Files
12
@@ -22,18 +22,64 @@ use Drupal\sessionless\CryptoService;
*/
class SessionlessFormCache implements FormCacheInterface {
/**
* The root directory of the Drupal installation.
*
* @var string
*/
protected string $root;
/**
* The module handler.
*
* @var \Drupal\Core\Extension\ModuleHandlerInterface
*/
protected ModuleHandlerInterface $moduleHandler;
/**
* The currently logged-in user account.
*
* @var \Drupal\Core\Session\AccountInterface
*/
protected AccountInterface $currentUser;
/**
* The CSRF token generator.
*
* @var \Drupal\Core\Access\CsrfTokenGenerator
*/
protected CsrfTokenGenerator $csrfToken;
/**
* The logger channel.
*
* @var \Drupal\Core\Logger\LoggerChannelInterface
*/
protected LoggerChannelInterface $logger;
/**
* The cryptography service.
*
* @var \Drupal\sessionless\CryptoService
*/
protected CryptoService $cryptoService;
/**
* Constructs a new Drupal\sessionless_forms\SessionlessFormCache object.
*
* @param string $root
* The app root.
* @param \Drupal\Core\Extension\ModuleHandlerInterface $moduleHandler
* The module handler.
* @param \Drupal\Core\Session\AccountInterface $currentUser
* The current user.
* @param \Drupal\Core\Access\CsrfTokenGenerator $csrfToken
* The CSRF token generator.
* @param \Drupal\Core\Logger\LoggerChannelInterface $logger
* The logger.
* @param \Drupal\sessionless\CryptoService $cryptoService
* The cryptography service.
*/
public function __construct(string $root, ModuleHandlerInterface $moduleHandler, AccountInterface $currentUser, CsrfTokenGenerator $csrfToken, LoggerChannelInterface $logger, CryptoService $cryptoService) {
$this->root = $root;
$this->moduleHandler = $moduleHandler;
@@ -43,6 +89,9 @@ class SessionlessFormCache implements FormCacheInterface {
$this->cryptoService = $cryptoService;
}
/**
* {@inheritdoc}
*/
public function getCache($form_build_id, FormStateInterface $form_state) {
$input = $form_state->getUserInput();
if (
@@ -120,6 +169,9 @@ class SessionlessFormCache implements FormCacheInterface {
}
}
/**
* {@inheritdoc}
*/
public function deleteCache($form_build_id) {}
}
Loading