diff --git a/src/Form/RevisionRevertForm.php b/src/Form/RevisionRevertForm.php
index f1e57077af7cadc6c6b8f0a5652649c210cc64df..fc7ee777af0af8c480964d2381de43b29751d85c 100644
--- a/src/Form/RevisionRevertForm.php
+++ b/src/Form/RevisionRevertForm.php
@@ -3,6 +3,7 @@
 namespace Drupal\entity\Form;
 
 use Drupal\Core\Datetime\DateFormatterInterface;
+use Drupal\Core\Entity\EntityInterface;
 use Drupal\Core\Entity\EntityTypeBundleInfoInterface;
 use Drupal\Core\Entity\RevisionableInterface;
 use Drupal\Core\Form\ConfirmFormBase;
@@ -11,6 +12,9 @@ use Drupal\Core\Entity\RevisionLogInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\HttpFoundation\Request;
 
+/**
+ * Form to confirm reverting an entity revision.
+ */
 class RevisionRevertForm extends ConfirmFormBase {
 
   /**
@@ -101,7 +105,7 @@ class RevisionRevertForm extends ConfirmFormBase {
   /**
    * {@inheritdoc}
    */
-  public function buildForm(array $form, FormStateInterface $form_state, $_entity_revision = NULL, Request $request = NULL) {
+  public function buildForm(array $form, FormStateInterface $form_state, EntityInterface|RevisionableInterface|RevisionLogInterface|NULL $_entity_revision = NULL, ?Request $request = NULL) {
     $this->revision = $_entity_revision;
     $form = parent::buildForm($form, $form_state);
 
diff --git a/src/QueryAccess/EventOnlyQueryAccessHandler.php b/src/QueryAccess/EventOnlyQueryAccessHandler.php
index 1f657451cdc6ac2bb0cba07832472b55ed51dc5d..c58ec243db5c80f1053294aed035614bcb243c2b 100644
--- a/src/QueryAccess/EventOnlyQueryAccessHandler.php
+++ b/src/QueryAccess/EventOnlyQueryAccessHandler.php
@@ -68,7 +68,7 @@ final class EventOnlyQueryAccessHandler implements EntityHandlerInterface, Query
   /**
    * {@inheritdoc}
    */
-  public function getConditions($operation, AccountInterface $account = NULL) {
+  public function getConditions($operation, ?AccountInterface $account = NULL) {
     $account = $account ?: $this->currentUser;
     $entity_type_id = $this->entityType->id();
     $conditions = new ConditionGroup('OR');
diff --git a/src/QueryAccess/QueryAccessHandlerBase.php b/src/QueryAccess/QueryAccessHandlerBase.php
index 8df9c47f116524401901a5f3e0310a6a7e95c43b..2285f334559a7babadf026f384717cf75ecdfa56 100644
--- a/src/QueryAccess/QueryAccessHandlerBase.php
+++ b/src/QueryAccess/QueryAccessHandlerBase.php
@@ -81,7 +81,7 @@ abstract class QueryAccessHandlerBase implements EntityHandlerInterface, QueryAc
   /**
    * {@inheritdoc}
    */
-  public function getConditions($operation, AccountInterface $account = NULL) {
+  public function getConditions($operation, ?AccountInterface $account = NULL) {
     $account = $account ?: $this->currentUser;
     $entity_type_id = $this->entityType->id();
     $conditions = $this->buildConditions($operation, $account);
diff --git a/src/QueryAccess/QueryAccessHandlerInterface.php b/src/QueryAccess/QueryAccessHandlerInterface.php
index 36e8324be98cf38c31c889f144af2f46615936bd..ea7e1dccbc9d77d0312be498a3020e1f2ec7a068 100644
--- a/src/QueryAccess/QueryAccessHandlerInterface.php
+++ b/src/QueryAccess/QueryAccessHandlerInterface.php
@@ -30,13 +30,13 @@ interface QueryAccessHandlerInterface {
    * @param string $operation
    *   The access operation. Usually one of "view", "update", "duplicate",
    *   or "delete".
-   * @param \Drupal\Core\Session\AccountInterface $account
+   * @param \Drupal\Core\Session\AccountInterface|null $account
    *   The user for which to restrict access, or NULL
    *   to assume the current user. Defaults to NULL.
    *
    * @return \Drupal\entity\QueryAccess\ConditionGroup
    *   The conditions.
    */
-  public function getConditions($operation, AccountInterface $account = NULL);
+  public function getConditions($operation, ?AccountInterface $account = NULL);
 
 }