From 75be782651afe0cb20b92eaabd97669ca84290b4 Mon Sep 17 00:00:00 2001
From: catch <catch@35733.no-reply.drupal.org>
Date: Sat, 1 Jun 2024 08:18:43 +0100
Subject: [PATCH] Issue #3450890 by kristiaanvandeneynde: Provide default
 values for an Access Policy API method that was overlooked

---
 .../Drupal/Core/Session/RefinableCalculatedPermissions.php | 2 +-
 .../Session/RefinableCalculatedPermissionsInterface.php    | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/core/lib/Drupal/Core/Session/RefinableCalculatedPermissions.php b/core/lib/Drupal/Core/Session/RefinableCalculatedPermissions.php
index 410d96c377b9..13356979ef30 100644
--- a/core/lib/Drupal/Core/Session/RefinableCalculatedPermissions.php
+++ b/core/lib/Drupal/Core/Session/RefinableCalculatedPermissions.php
@@ -28,7 +28,7 @@ public function addItem(CalculatedPermissionsItemInterface $item, bool $overwrit
   /**
    * {@inheritdoc}
    */
-  public function removeItem(string $scope, string|int $identifier): self {
+  public function removeItem(string $scope = AccessPolicyInterface::SCOPE_DRUPAL, string|int $identifier = AccessPolicyInterface::SCOPE_DRUPAL): self {
     unset($this->items[$scope][$identifier]);
     return $this;
   }
diff --git a/core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php b/core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php
index 8f78d17b4a93..5965d91ce8dc 100644
--- a/core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php
+++ b/core/lib/Drupal/Core/Session/RefinableCalculatedPermissionsInterface.php
@@ -27,13 +27,14 @@ public function addItem(CalculatedPermissionsItemInterface $item, bool $overwrit
    * Removes a single calculated permission item from a given scope.
    *
    * @param string $scope
-   *   The scope name to remove the item from.
+   *   (optional) The scope name to remove the item from, defaults to 'drupal'.
    * @param string|int $identifier
-   *   The scope identifier to remove the item from.
+   *   (optional) The scope identifier to remove the item from, defaults to
+   *   'drupal'.
    *
    * @return self
    */
-  public function removeItem(string $scope, string|int $identifier): self;
+  public function removeItem(string $scope = AccessPolicyInterface::SCOPE_DRUPAL, string|int $identifier = AccessPolicyInterface::SCOPE_DRUPAL): self;
 
   /**
    * Removes all of the calculated permission items, regardless of scope.
-- 
GitLab