From 59982568fbed1a2522a1f3a780f6634f00691c6b Mon Sep 17 00:00:00 2001
From: Adam Bramley <adam.bramley@previousnext.com.au>
Date: Fri, 17 Jan 2025 08:33:11 +1100
Subject: [PATCH 1/2] Fix implicit nullables

---
 src/EventSubscriber/FieldStorageSubscriber.php            | 4 ++--
 src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php | 2 +-
 src/Query/Tables.php                                      | 2 +-
 src/SelectionPluginManager.php                            | 2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/EventSubscriber/FieldStorageSubscriber.php b/src/EventSubscriber/FieldStorageSubscriber.php
index 8d9444b..22a3153 100644
--- a/src/EventSubscriber/FieldStorageSubscriber.php
+++ b/src/EventSubscriber/FieldStorageSubscriber.php
@@ -116,12 +116,12 @@ class FieldStorageSubscriber implements EventSubscriberInterface {
    *
    * @param string $entity_type_id
    *   The entity type ID.
-   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface $field_storage_definition
+   * @param \Drupal\Core\Field\FieldStorageDefinitionInterface|null $field_storage_definition
    *   The field storage definition. It is only necessary to pass this if this
    *   a FieldStorageConfig object during presave and as such the definition is
    *   not yet available to the entity field manager.
    */
-  public function handleEntityType($entity_type_id, FieldStorageDefinitionInterface $field_storage_definition = NULL) {
+  public function handleEntityType($entity_type_id, ?FieldStorageDefinitionInterface $field_storage_definition = NULL) {
     $storage = $this->entityTypeManager->getStorage($entity_type_id);
     $der_fields = $this->entityFieldManager->getFieldMapByFieldType('dynamic_entity_reference');
     if ($field_storage_definition && ($field_storage_definition->getType() === 'dynamic_entity_reference')) {
diff --git a/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php b/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
index 93cfd17..58ef1fd 100644
--- a/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
+++ b/src/Plugin/Field/FieldType/DynamicEntityReferenceItem.php
@@ -150,7 +150,7 @@ class DynamicEntityReferenceItem extends EntityReferenceItem {
    *
    * @see \Drupal\dynamic_entity_reference\Plugin\Field\FieldWidget\DynamicEntityReferenceOptionsTrait::massageFormValues()
    */
-  public function getSettableOptions(AccountInterface $account = NULL) {
+  public function getSettableOptions(?AccountInterface $account = NULL) {
     $field_definition = $this->getFieldDefinition();
     $entity_type_manager = \Drupal::entityTypeManager();
     $entity_type_bundles_info = \Drupal::service('entity_type.bundle.info');
diff --git a/src/Query/Tables.php b/src/Query/Tables.php
index 18e02e8..45542e6 100644
--- a/src/Query/Tables.php
+++ b/src/Query/Tables.php
@@ -15,7 +15,7 @@ class Tables extends BaseTables {
   /**
    * {@inheritdoc}
    */
-  protected function addNextBaseTable(EntityType $entity_type, $table, $sql_column, FieldStorageDefinitionInterface $field_storage = NULL) {
+  protected function addNextBaseTable(EntityType $entity_type, $table, $sql_column, ?FieldStorageDefinitionInterface $field_storage = NULL) {
     // Parent method is overridden in order to choose the correct columns to
     // join on (string or int for the id and type for the entity type
     // specifier).
diff --git a/src/SelectionPluginManager.php b/src/SelectionPluginManager.php
index 4f00334..37a6677 100644
--- a/src/SelectionPluginManager.php
+++ b/src/SelectionPluginManager.php
@@ -17,7 +17,7 @@ class SelectionPluginManager extends CoreSelectionPluginManager {
   /**
    * {@inheritdoc}
    */
-  public function getSelectionHandler(FieldDefinitionInterface $field_definition, EntityInterface $entity = NULL, $target_type = NULL) {
+  public function getSelectionHandler(FieldDefinitionInterface $field_definition, ?EntityInterface $entity = NULL, $target_type = NULL) {
     if ($target_type === NULL) {
       return parent::getSelectionHandler($field_definition, $entity);
     }
-- 
GitLab


From 65b01d003d4137a9870057942a0758488fcbb3cf Mon Sep 17 00:00:00 2001
From: Adam Bramley <adam.bramley@previousnext.com.au>
Date: Fri, 17 Jan 2025 08:37:26 +1100
Subject: [PATCH 2/2] Remove verbose flag

---
 .gitlab-ci.yml | 1 -
 1 file changed, 1 deletion(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 410abd6..e88d3c0 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -57,7 +57,6 @@ variables:
   # Show more log output
   # Convenient, and we have no secrets.
   _SHOW_ENVIRONMENT_VARIABLES: '1'
-  _PHPUNIT_EXTRA: '--verbose'
 
 .run-on-mr: &run-on-mr
   rules:
-- 
GitLab