Skip to content
Snippets Groups Projects
Commit 276e51fc authored by Pedro Cambra's avatar Pedro Cambra Committed by Sascha Grossenbacher
Browse files

Issue #3500327 by pcambra, klausi: Nullable types must be explicit

parent 51bc434f
No related branches found
No related tags found
No related merge requests found
......@@ -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);
......
......@@ -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');
......
......@@ -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);
......
......@@ -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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment