From 5822cf490b993e9b8faea3552d46455e75a79569 Mon Sep 17 00:00:00 2001
From: Adam Bramley <adam.bramley@previousnext.com.au>
Date: Tue, 14 Jan 2025 12:27:12 +1100
Subject: [PATCH] Fix more implicit nullables

---
 entityqueue.module                                        | 2 +-
 src/Controller/EntityQueueUIController.php                | 2 +-
 src/Plugin/Action/AddItemToSubqueue.php                   | 2 +-
 src/Plugin/Action/RemoveItemFromSubqueue.php              | 2 +-
 src/Plugin/views/relationship/EntityQueueRelationship.php | 2 +-
 5 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/entityqueue.module b/entityqueue.module
index 42943f8..69bec31 100644
--- a/entityqueue.module
+++ b/entityqueue.module
@@ -18,7 +18,7 @@ use Drupal\views\Plugin\views\query\QueryPluginBase;
 /**
  * Implements hook_entity_field_access().
  */
-function entityqueue_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, FieldItemListInterface $items = NULL) {
+function entityqueue_entity_field_access($operation, FieldDefinitionInterface $field_definition, AccountInterface $account, ?FieldItemListInterface $items = NULL) {
   // Only allow edit access on a subqueue title field if the queue doesn't have
   // automated subqueues.
   if ($operation == 'edit' && $field_definition->getName() == 'title' && $items && $items->getEntity()->getEntityTypeId() === 'entity_subqueue') {
diff --git a/src/Controller/EntityQueueUIController.php b/src/Controller/EntityQueueUIController.php
index 5fbedea..34a51c3 100644
--- a/src/Controller/EntityQueueUIController.php
+++ b/src/Controller/EntityQueueUIController.php
@@ -73,7 +73,7 @@ class EntityQueueUIController extends ControllerBase {
    * @return array
    *   Array of page elements to render.
    */
-  public function subqueueListForEntity(RouteMatchInterface $route_match, $entity_type_id = NULL, EntityInterface $entity = NULL) {
+  public function subqueueListForEntity(RouteMatchInterface $route_match, $entity_type_id = NULL, ?EntityInterface $entity = NULL) {
     if (!$entity) {
       $entity = $route_match->getParameter($entity_type_id);
     }
diff --git a/src/Plugin/Action/AddItemToSubqueue.php b/src/Plugin/Action/AddItemToSubqueue.php
index d3e7a92..1ec9ca3 100644
--- a/src/Plugin/Action/AddItemToSubqueue.php
+++ b/src/Plugin/Action/AddItemToSubqueue.php
@@ -51,7 +51,7 @@ class AddItemToSubqueue extends ConfigurableActionBase {
   /**
    * {@inheritdoc}
    */
-  public function access($entity, AccountInterface $account = NULL, $return_as_object = FALSE) {
+  public function access($entity, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
     /** @var \Drupal\entityqueue\EntitySubqueueInterface $subqueue */
     $subqueue = EntitySubqueue::load($this->configuration['subqueue']);
     $access = $subqueue->access('update', $account, TRUE);
diff --git a/src/Plugin/Action/RemoveItemFromSubqueue.php b/src/Plugin/Action/RemoveItemFromSubqueue.php
index 6a94890..eff8202 100644
--- a/src/Plugin/Action/RemoveItemFromSubqueue.php
+++ b/src/Plugin/Action/RemoveItemFromSubqueue.php
@@ -51,7 +51,7 @@ class RemoveItemFromSubqueue extends ConfigurableActionBase {
   /**
    * {@inheritdoc}
    */
-  public function access($entity, AccountInterface $account = NULL, $return_as_object = FALSE) {
+  public function access($entity, ?AccountInterface $account = NULL, $return_as_object = FALSE) {
     /** @var \Drupal\entityqueue\EntitySubqueueInterface $subqueue */
     $subqueue = EntitySubqueue::load($this->configuration['subqueue']);
     $access = $subqueue->access('update', $account, TRUE);
diff --git a/src/Plugin/views/relationship/EntityQueueRelationship.php b/src/Plugin/views/relationship/EntityQueueRelationship.php
index 60f480f..a0ba2aa 100644
--- a/src/Plugin/views/relationship/EntityQueueRelationship.php
+++ b/src/Plugin/views/relationship/EntityQueueRelationship.php
@@ -99,7 +99,7 @@ class EntityQueueRelationship extends RelationshipPluginBase implements Cacheabl
   /**
    * {@inheritdoc}
    */
-  public function init(ViewExecutable $view, DisplayPluginBase $display, array &$options = NULL) {
+  public function init(ViewExecutable $view, DisplayPluginBase $display, ?array &$options = NULL) {
     parent::init($view, $display, $options);
 
     // Add an extra condition to limit results based on the queue selection.
-- 
GitLab