diff --git a/core/lib/Drupal/Core/Access/AccessResult.php b/core/lib/Drupal/Core/Access/AccessResult.php index 959a93978eb..693434e1230 100644 --- a/core/lib/Drupal/Core/Access/AccessResult.php +++ b/core/lib/Drupal/Core/Access/AccessResult.php @@ -6,8 +6,6 @@ use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheableDependencyInterface; use Drupal\Core\Cache\RefinableCacheableDependencyInterface; use Drupal\Core\Cache\RefinableCacheableDependencyTrait; -use Drupal\Core\Config\ConfigBase; -use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Session\AccountInterface; /** @@ -278,37 +276,6 @@ abstract class AccessResult implements AccessResultInterface, RefinableCacheable return $this; } - /** - * Convenience method, adds the entity's cache tag. - * - * @param \Drupal\Core\Entity\EntityInterface $entity - * The entity whose cache tag to set on the access result. - * - * @return $this - * - * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use - * ::addCacheableDependency() instead. - */ - public function cacheUntilEntityChanges(EntityInterface $entity) { - return $this->addCacheableDependency($entity); - } - - /** - * Convenience method, adds the configuration object's cache tag. - * - * @param \Drupal\Core\Config\ConfigBase $configuration - * The configuration object whose cache tag to set on the access result. - * - * @return $this - * - * @deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use - * \Drupal\Core\Access\AccessResult::addCacheableDependency() instead. - */ - public function cacheUntilConfigurationChanges(ConfigBase $configuration) { - @trigger_error(__METHOD__ . ' is deprecated in drupal:8.0.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Access\AccessResult::addCacheableDependency() instead.', E_USER_DEPRECATED); - return $this->addCacheableDependency($configuration); - } - /** * {@inheritdoc} */ diff --git a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php index c2ecf092630..e3f8ad4ad16 100644 --- a/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php +++ b/core/tests/Drupal/Tests/Core/Access/AccessResultTest.php @@ -13,7 +13,6 @@ use Drupal\Core\Access\AccessResultNeutral; use Drupal\Core\Access\AccessResultReasonInterface; use Drupal\Core\Cache\Cache; use Drupal\Core\Cache\CacheableDependencyInterface; -use Drupal\Core\Config\Config; use Drupal\Core\DependencyInjection\ContainerBuilder; use Drupal\Tests\UnitTestCase; @@ -969,21 +968,6 @@ class AccessResultTest extends UnitTestCase { return $data; } - /** - * @expectedDeprecation Drupal\Core\Access\AccessResult::cacheUntilConfigurationChanges is deprecated in drupal:8.0.0 and is removed in drupal:9.0.0. Use \Drupal\Core\Access\AccessResult::addCacheableDependency() instead. - * @group legacy - */ - public function testCacheUntilConfigurationChanges() { - $config = $this->prophesize(Config::class); - $config->getCacheContexts()->willReturn(['context']); - $config->getCacheTags()->willReturn(['tag']); - $config->getCacheMaxAge()->willReturn(10); - $access_result = AccessResult::neutral()->cacheUntilConfigurationChanges($config->reveal()); - $this->assertSame(['context'], $access_result->getCacheContexts()); - $this->assertSame(['tag'], $access_result->getCacheTags()); - $this->assertSame(10, $access_result->getCacheMaxAge()); - } - } class UncacheableTestAccessResult implements AccessResultInterface {