diff --git a/core/lib/Drupal/Core/Access/AccessCheckInterface.php b/core/lib/Drupal/Core/Access/AccessCheckInterface.php index a15b5c5..049f5dd 100644 --- a/core/lib/Drupal/Core/Access/AccessCheckInterface.php +++ b/core/lib/Drupal/Core/Access/AccessCheckInterface.php @@ -3,12 +3,11 @@ namespace Drupal\Core\Access; use Symfony\Component\Routing\Route; -use Drupal\Core\Routing\Access\AccessInterface as RoutingAccessInterface; /** * An access check service determines access rules for particular routes. */ -interface AccessCheckInterface extends RoutingAccessInterface { +interface AccessCheckInterface { /** * Declares whether the access check applies to a specific route or not. diff --git a/core/lib/Drupal/Core/Access/AccessManagerInterface.php b/core/lib/Drupal/Core/Access/AccessManagerInterface.php index fc2a0e8..bb10d47 100644 --- a/core/lib/Drupal/Core/Access/AccessManagerInterface.php +++ b/core/lib/Drupal/Core/Access/AccessManagerInterface.php @@ -29,9 +29,10 @@ * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". */ public function checkNamedRoute($route_name, array $parameters = array(), AccountInterface $account = NULL, $return_as_object = FALSE); @@ -49,9 +50,10 @@ public function checkNamedRoute($route_name, array $parameters = array(), Accoun * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". */ public function checkRequest(Request $request, AccountInterface $account = NULL, $return_as_object = FALSE); @@ -74,9 +76,10 @@ public function checkRequest(Request $request, AccountInterface $account = NULL, * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". */ public function check(RouteMatchInterface $route_match, AccountInterface $account = NULL, Request $request = NULL, $return_as_object = FALSE); diff --git a/core/lib/Drupal/Core/Access/AccessibleInterface.php b/core/lib/Drupal/Core/Access/AccessibleInterface.php index eea600a..48fb3e4 100644 --- a/core/lib/Drupal/Core/Access/AccessibleInterface.php +++ b/core/lib/Drupal/Core/Access/AccessibleInterface.php @@ -25,9 +25,10 @@ * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". */ public function access($operation, AccountInterface $account = NULL, $return_as_object = FALSE); diff --git a/core/lib/Drupal/Core/Access/CheckProvider.php b/core/lib/Drupal/Core/Access/CheckProvider.php index c68cf38..ac34124 100644 --- a/core/lib/Drupal/Core/Access/CheckProvider.php +++ b/core/lib/Drupal/Core/Access/CheckProvider.php @@ -2,7 +2,6 @@ namespace Drupal\Core\Access; -use Drupal\Core\Routing\Access\AccessInterface; use Symfony\Component\DependencyInjection\ContainerAwareInterface; use Symfony\Component\DependencyInjection\ContainerAwareTrait; use Symfony\Component\Routing\Route; @@ -25,7 +24,7 @@ class CheckProvider implements CheckProviderInterface, ContainerAwareInterface { /** * Array of access check objects keyed by service id. * - * @var \Drupal\Core\Routing\Access\AccessInterface[] + * @var object[] */ protected $checks; @@ -99,9 +98,6 @@ public function loadCheck($service_id) { $check = $this->container->get($service_id); - if (!($check instanceof AccessInterface)) { - throw new AccessException('All access checks must implement AccessInterface.'); - } if (!is_callable(array($check, $this->checkMethods[$service_id]))) { throw new AccessException(sprintf('Access check method %s in service %s must be callable.', $this->checkMethods[$service_id], $service_id)); } diff --git a/core/lib/Drupal/Core/Access/CsrfAccessCheck.php b/core/lib/Drupal/Core/Access/CsrfAccessCheck.php index c72b116..85d57a8 100644 --- a/core/lib/Drupal/Core/Access/CsrfAccessCheck.php +++ b/core/lib/Drupal/Core/Access/CsrfAccessCheck.php @@ -2,7 +2,6 @@ namespace Drupal\Core\Access; -use Drupal\Core\Routing\Access\AccessInterface as RoutingAccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Symfony\Component\Routing\Route; use Symfony\Component\HttpFoundation\Request; @@ -14,7 +13,7 @@ * a token generated by \Drupal::csrfToken()->get() using the same value as the * "_csrf_token" parameter in the route. */ -class CsrfAccessCheck implements RoutingAccessInterface { +class CsrfAccessCheck { /** * The CSRF token generator. diff --git a/core/lib/Drupal/Core/Access/CustomAccessCheck.php b/core/lib/Drupal/Core/Access/CustomAccessCheck.php index e7a3b08..6afbd24 100644 --- a/core/lib/Drupal/Core/Access/CustomAccessCheck.php +++ b/core/lib/Drupal/Core/Access/CustomAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\Core\Access; use Drupal\Core\Controller\ControllerResolverInterface; -use Drupal\Core\Routing\Access\AccessInterface as RoutingAccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; @@ -18,7 +17,7 @@ * cannot reuse any stored property of your actual controller instance used * to generate the output. */ -class CustomAccessCheck implements RoutingAccessInterface { +class CustomAccessCheck { /** * The controller resolver. diff --git a/core/lib/Drupal/Core/Access/DefaultAccessCheck.php b/core/lib/Drupal/Core/Access/DefaultAccessCheck.php index a70b58d..f8a3f04 100644 --- a/core/lib/Drupal/Core/Access/DefaultAccessCheck.php +++ b/core/lib/Drupal/Core/Access/DefaultAccessCheck.php @@ -2,13 +2,12 @@ namespace Drupal\Core\Access; -use Drupal\Core\Routing\Access\AccessInterface as RoutingAccessInterface; use Symfony\Component\Routing\Route; /** * Allows access to routes to be controlled by an '_access' boolean parameter. */ -class DefaultAccessCheck implements RoutingAccessInterface { +class DefaultAccessCheck { /** * Checks access to the route based on the _access parameter. diff --git a/core/lib/Drupal/Core/Action/ActionInterface.php b/core/lib/Drupal/Core/Action/ActionInterface.php index 5158f96..c991b26 100644 --- a/core/lib/Drupal/Core/Action/ActionInterface.php +++ b/core/lib/Drupal/Core/Action/ActionInterface.php @@ -52,9 +52,10 @@ public function executeMultiple(array $objects); * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". */ public function access($object, AccountInterface $account = NULL, $return_as_object = FALSE); diff --git a/core/lib/Drupal/Core/Block/BlockPluginInterface.php b/core/lib/Drupal/Core/Block/BlockPluginInterface.php index 66ef836..cc3cde2 100644 --- a/core/lib/Drupal/Core/Block/BlockPluginInterface.php +++ b/core/lib/Drupal/Core/Block/BlockPluginInterface.php @@ -47,9 +47,10 @@ public function label(); * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". * * @see \Drupal\block\BlockAccessControlHandler */ diff --git a/core/lib/Drupal/Core/Entity/EntityAccessCheck.php b/core/lib/Drupal/Core/Entity/EntityAccessCheck.php index 0de9b01..1f489ff 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessCheck.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\Core\Entity; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; @@ -11,7 +10,7 @@ /** * Provides a generic access checker for entities. */ -class EntityAccessCheck implements AccessInterface { +class EntityAccessCheck { /** * Checks access to the entity operation on the given route. diff --git a/core/lib/Drupal/Core/Entity/EntityAccessControlHandlerInterface.php b/core/lib/Drupal/Core/Entity/EntityAccessControlHandlerInterface.php index 0bec9c2..441cd4b 100644 --- a/core/lib/Drupal/Core/Entity/EntityAccessControlHandlerInterface.php +++ b/core/lib/Drupal/Core/Entity/EntityAccessControlHandlerInterface.php @@ -32,9 +32,10 @@ * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". */ public function access(EntityInterface $entity, $operation, AccountInterface $account = NULL, $return_as_object = FALSE); @@ -56,9 +57,10 @@ public function access(EntityInterface $entity, $operation, AccountInterface $ac * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". */ public function createAccess($entity_bundle = NULL, AccountInterface $account = NULL, array $context = array(), $return_as_object = FALSE); @@ -103,9 +105,10 @@ public function setModuleHandler(ModuleHandlerInterface $module_handler); * @return bool|\Drupal\Core\Access\AccessResultInterface * The access result. Returns a boolean if $return_as_object is FALSE (this * is the default) and otherwise an AccessResultInterface object. - * When a boolean is returned, the result of AccessInterface::isAllowed() is - * returned, i.e. TRUE means access is explicitly allowed, FALSE means - * access is either explicitly forbidden or "no opinion". + * When a boolean is returned, the result of + * AccessResultInterface::isAllowed() is returned, i.e. TRUE means access is + * explicitly allowed, FALSE means access is either explicitly forbidden or + * "no opinion". * * @see \Drupal\Core\Entity\EntityAccessControlHandlerInterface::access() */ diff --git a/core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php b/core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php index 9ceac52..86e3080 100644 --- a/core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php +++ b/core/lib/Drupal/Core/Entity/EntityCreateAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\Core\Entity; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; @@ -11,7 +10,7 @@ /** * Defines an access checker for entity creation. */ -class EntityCreateAccessCheck implements AccessInterface { +class EntityCreateAccessCheck { /** * The entity manager. diff --git a/core/lib/Drupal/Core/Entity/EntityCreateAnyAccessCheck.php b/core/lib/Drupal/Core/Entity/EntityCreateAnyAccessCheck.php index a6ff094..c9a14e6 100644 --- a/core/lib/Drupal/Core/Entity/EntityCreateAnyAccessCheck.php +++ b/core/lib/Drupal/Core/Entity/EntityCreateAnyAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\Core\Entity; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; @@ -11,7 +10,7 @@ /** * Defines an access checker for creating an entity of any bundle. */ -class EntityCreateAnyAccessCheck implements AccessInterface { +class EntityCreateAnyAccessCheck { /** * The entity type manager. diff --git a/core/lib/Drupal/Core/Routing/Access/AccessInterface.php b/core/lib/Drupal/Core/Routing/Access/AccessInterface.php index c280b4c..234be49 100644 --- a/core/lib/Drupal/Core/Routing/Access/AccessInterface.php +++ b/core/lib/Drupal/Core/Routing/Access/AccessInterface.php @@ -9,7 +9,4 @@ */ interface AccessInterface { - // @todo Remove this interface since it no longer defines any methods? - // @see https://www.drupal.org/node/2266817. - } diff --git a/core/lib/Drupal/Core/Theme/ThemeAccessCheck.php b/core/lib/Drupal/Core/Theme/ThemeAccessCheck.php index c8e56ec..f030174 100644 --- a/core/lib/Drupal/Core/Theme/ThemeAccessCheck.php +++ b/core/lib/Drupal/Core/Theme/ThemeAccessCheck.php @@ -4,7 +4,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Extension\ThemeHandlerInterface; -use Drupal\Core\Routing\Access\AccessInterface; /** * Provides access checking for themes for routing and theme negotiation. diff --git a/core/modules/book/src/Access/BookNodeIsRemovableAccessCheck.php b/core/modules/book/src/Access/BookNodeIsRemovableAccessCheck.php index ffe124c..5146a9b 100644 --- a/core/modules/book/src/Access/BookNodeIsRemovableAccessCheck.php +++ b/core/modules/book/src/Access/BookNodeIsRemovableAccessCheck.php @@ -4,13 +4,12 @@ use Drupal\book\BookManagerInterface; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\node\NodeInterface; /** * Determines whether the requested node can be removed from its book. */ -class BookNodeIsRemovableAccessCheck implements AccessInterface { +class BookNodeIsRemovableAccessCheck { /** * Book Manager Service. diff --git a/core/modules/config_translation/src/Access/ConfigTranslationOverviewAccess.php b/core/modules/config_translation/src/Access/ConfigTranslationOverviewAccess.php index 91ccf49..57eca5b 100644 --- a/core/modules/config_translation/src/Access/ConfigTranslationOverviewAccess.php +++ b/core/modules/config_translation/src/Access/ConfigTranslationOverviewAccess.php @@ -5,14 +5,13 @@ use Drupal\Core\Language\LanguageManagerInterface; use Drupal\config_translation\ConfigMapperManagerInterface; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; /** * Checks access for displaying the configuration translation overview. */ -class ConfigTranslationOverviewAccess implements AccessInterface { +class ConfigTranslationOverviewAccess { /** * The mapper plugin discovery service. diff --git a/core/modules/contact/src/Access/ContactPageAccess.php b/core/modules/contact/src/Access/ContactPageAccess.php index 4030753..f8980cb 100644 --- a/core/modules/contact/src/Access/ContactPageAccess.php +++ b/core/modules/contact/src/Access/ContactPageAccess.php @@ -4,7 +4,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Config\ConfigFactoryInterface; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Drupal\user\UserDataInterface; use Drupal\user\UserInterface; @@ -12,7 +11,7 @@ /** * Access check for contact_personal_page route. */ -class ContactPageAccess implements AccessInterface { +class ContactPageAccess { /** * The contact settings config object. diff --git a/core/modules/content_translation/src/Access/ContentTranslationManageAccessCheck.php b/core/modules/content_translation/src/Access/ContentTranslationManageAccessCheck.php index 6a4be1e..a199492 100644 --- a/core/modules/content_translation/src/Access/ContentTranslationManageAccessCheck.php +++ b/core/modules/content_translation/src/Access/ContentTranslationManageAccessCheck.php @@ -6,7 +6,6 @@ use Drupal\Core\Entity\EntityManagerInterface; use Drupal\Core\Language\LanguageInterface; use Drupal\Core\Language\LanguageManagerInterface; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; @@ -14,7 +13,7 @@ /** * Access check for entity translation CRUD operation. */ -class ContentTranslationManageAccessCheck implements AccessInterface { +class ContentTranslationManageAccessCheck { /** * The entity type manager. diff --git a/core/modules/content_translation/src/Access/ContentTranslationOverviewAccess.php b/core/modules/content_translation/src/Access/ContentTranslationOverviewAccess.php index dce604d..07e4af1 100644 --- a/core/modules/content_translation/src/Access/ContentTranslationOverviewAccess.php +++ b/core/modules/content_translation/src/Access/ContentTranslationOverviewAccess.php @@ -4,14 +4,13 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; /** * Access check for entity translation overview. */ -class ContentTranslationOverviewAccess implements AccessInterface { +class ContentTranslationOverviewAccess { /** * The entity type manager. diff --git a/core/modules/field_ui/src/Access/FormModeAccessCheck.php b/core/modules/field_ui/src/Access/FormModeAccessCheck.php index 6bc0b2f..e97049b 100644 --- a/core/modules/field_ui/src/Access/FormModeAccessCheck.php +++ b/core/modules/field_ui/src/Access/FormModeAccessCheck.php @@ -4,7 +4,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; @@ -14,7 +13,7 @@ * * @see \Drupal\Core\Entity\Entity\EntityFormMode */ -class FormModeAccessCheck implements AccessInterface { +class FormModeAccessCheck { /** * The entity manager. diff --git a/core/modules/field_ui/src/Access/ViewModeAccessCheck.php b/core/modules/field_ui/src/Access/ViewModeAccessCheck.php index e6b4e6c..ceaf90a 100644 --- a/core/modules/field_ui/src/Access/ViewModeAccessCheck.php +++ b/core/modules/field_ui/src/Access/ViewModeAccessCheck.php @@ -4,7 +4,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Routing\RouteMatchInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; diff --git a/core/modules/node/src/Access/NodeAddAccessCheck.php b/core/modules/node/src/Access/NodeAddAccessCheck.php index 8d9d119..014aac3 100644 --- a/core/modules/node/src/Access/NodeAddAccessCheck.php +++ b/core/modules/node/src/Access/NodeAddAccessCheck.php @@ -4,7 +4,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Drupal\node\NodeTypeInterface; @@ -13,7 +12,7 @@ * * @ingroup node_access */ -class NodeAddAccessCheck implements AccessInterface { +class NodeAddAccessCheck { /** * The entity manager. @@ -41,8 +40,8 @@ public function __construct(EntityManagerInterface $entity_manager) { * (optional) The node type. If not specified, access is allowed if there * exists at least one node type for which the user may create a node. * - * @return string - * A \Drupal\Core\Access\AccessInterface constant value. + * @return \Drupal\Core\Access\AccessResultInterface + * The access result. */ public function access(AccountInterface $account, NodeTypeInterface $node_type = NULL) { $access_control_handler = $this->entityManager->getAccessControlHandler('node'); diff --git a/core/modules/node/src/Access/NodePreviewAccessCheck.php b/core/modules/node/src/Access/NodePreviewAccessCheck.php index 831bc65..1a6a56e 100644 --- a/core/modules/node/src/Access/NodePreviewAccessCheck.php +++ b/core/modules/node/src/Access/NodePreviewAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\node\Access; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Drupal\node\NodeInterface; @@ -12,7 +11,7 @@ * * @ingroup node_access */ -class NodePreviewAccessCheck implements AccessInterface { +class NodePreviewAccessCheck { /** * The entity manager. @@ -39,8 +38,8 @@ public function __construct(EntityManagerInterface $entity_manager) { * @param \Drupal\node\NodeInterface $node_preview * The node that is being previewed. * - * @return string - * A \Drupal\Core\Access\AccessInterface constant value. + * @return \Drupal\Core\Access\AccessResultInterface + * The access result. */ public function access(AccountInterface $account, NodeInterface $node_preview) { if ($node_preview->isNew()) { diff --git a/core/modules/node/src/Access/NodeRevisionAccessCheck.php b/core/modules/node/src/Access/NodeRevisionAccessCheck.php index 2005ec7..51b64af 100644 --- a/core/modules/node/src/Access/NodeRevisionAccessCheck.php +++ b/core/modules/node/src/Access/NodeRevisionAccessCheck.php @@ -4,7 +4,6 @@ use Drupal\Core\Access\AccessResult; use Drupal\Core\Entity\EntityManagerInterface; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Drupal\node\NodeInterface; use Symfony\Component\Routing\Route; @@ -14,7 +13,7 @@ * * @ingroup node_access */ -class NodeRevisionAccessCheck implements AccessInterface { +class NodeRevisionAccessCheck { /** * The node storage. diff --git a/core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php b/core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php index 7b38838..48b2fe6 100644 --- a/core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php +++ b/core/modules/quickedit/src/Access/EditEntityFieldAccessCheck.php @@ -3,14 +3,13 @@ namespace Drupal\quickedit\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Entity\EntityInterface; /** * Access check for editing entity fields. */ -class EditEntityFieldAccessCheck implements AccessInterface, EditEntityFieldAccessCheckInterface { +class EditEntityFieldAccessCheck implements EditEntityFieldAccessCheckInterface { /** * Checks Quick Edit access to the field. diff --git a/core/modules/system/src/Access/CronAccessCheck.php b/core/modules/system/src/Access/CronAccessCheck.php index bdc582d..b36ea5f 100644 --- a/core/modules/system/src/Access/CronAccessCheck.php +++ b/core/modules/system/src/Access/CronAccessCheck.php @@ -3,12 +3,11 @@ namespace Drupal\system\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; /** * Access check for cron routes. */ -class CronAccessCheck implements AccessInterface { +class CronAccessCheck { /** * Checks access. diff --git a/core/modules/system/src/Access/DbUpdateAccessCheck.php b/core/modules/system/src/Access/DbUpdateAccessCheck.php index 2bcc5fb..01ab0b3 100644 --- a/core/modules/system/src/Access/DbUpdateAccessCheck.php +++ b/core/modules/system/src/Access/DbUpdateAccessCheck.php @@ -2,7 +2,6 @@ namespace Drupal\system\Access; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Access\AccessResult; use Drupal\Core\Session\AccountInterface; use Drupal\Core\Site\Settings; @@ -10,7 +9,7 @@ /** * Access check for database update routes. */ -class DbUpdateAccessCheck implements AccessInterface { +class DbUpdateAccessCheck { /** * Checks access for update routes. @@ -18,8 +17,8 @@ class DbUpdateAccessCheck implements AccessInterface { * @param \Drupal\Core\Session\AccountInterface $account * The currently logged in account. * - * @return string - * A \Drupal\Core\Access\AccessInterface constant value. + * @return \Drupal\Core\Access\AccessResultInterface + * The access result. */ public function access(AccountInterface $account) { // Allow the global variable in settings.php to override the access check. diff --git a/core/modules/system/tests/modules/menu_test/src/Access/AccessCheck.php b/core/modules/system/tests/modules/menu_test/src/Access/AccessCheck.php index 1b67579..67a6e56 100644 --- a/core/modules/system/tests/modules/menu_test/src/Access/AccessCheck.php +++ b/core/modules/system/tests/modules/menu_test/src/Access/AccessCheck.php @@ -3,12 +3,11 @@ namespace Drupal\menu_test\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; /** * Checks access based on the 'menu_test' key in session. */ -class AccessCheck implements AccessInterface { +class AccessCheck { /** * Check to see if user accessed this page. diff --git a/core/modules/system/tests/modules/router_test_directory/src/Access/DefinedTestAccessCheck.php b/core/modules/system/tests/modules/router_test_directory/src/Access/DefinedTestAccessCheck.php index 43dc25b..ab4feb8 100644 --- a/core/modules/system/tests/modules/router_test_directory/src/Access/DefinedTestAccessCheck.php +++ b/core/modules/system/tests/modules/router_test_directory/src/Access/DefinedTestAccessCheck.php @@ -3,13 +3,12 @@ namespace Drupal\router_test\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Symfony\Component\Routing\Route; /** * Defines an access checker similar to DefaultAccessCheck */ -class DefinedTestAccessCheck implements AccessInterface { +class DefinedTestAccessCheck { /** * Checks access. diff --git a/core/modules/system/tests/modules/router_test_directory/src/Access/TestAccessCheck.php b/core/modules/system/tests/modules/router_test_directory/src/Access/TestAccessCheck.php index afce2d8..551cebd 100644 --- a/core/modules/system/tests/modules/router_test_directory/src/Access/TestAccessCheck.php +++ b/core/modules/system/tests/modules/router_test_directory/src/Access/TestAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\router_test\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; /** * Access check for test routes. @@ -13,8 +12,8 @@ class TestAccessCheck { /** * Checks access. * - * @return string - * A \Drupal\Core\Access\AccessInterface constant value. + * @return \Drupal\Core\Access\AccessResultInterface + * The access result. */ public function access() { // No opinion, so other access checks should decide if access should be diff --git a/core/modules/tracker/src/Access/ViewOwnTrackerAccessCheck.php b/core/modules/tracker/src/Access/ViewOwnTrackerAccessCheck.php index 5e0ef44..f2b864e 100644 --- a/core/modules/tracker/src/Access/ViewOwnTrackerAccessCheck.php +++ b/core/modules/tracker/src/Access/ViewOwnTrackerAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\tracker\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Drupal\user\UserInterface; diff --git a/core/modules/update/src/Access/UpdateManagerAccessCheck.php b/core/modules/update/src/Access/UpdateManagerAccessCheck.php index 001dc00..851dfc1 100644 --- a/core/modules/update/src/Access/UpdateManagerAccessCheck.php +++ b/core/modules/update/src/Access/UpdateManagerAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\update\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Site\Settings; /** diff --git a/core/modules/user/src/Access/LoginStatusCheck.php b/core/modules/user/src/Access/LoginStatusCheck.php index 3212c0a..41c12fb 100644 --- a/core/modules/user/src/Access/LoginStatusCheck.php +++ b/core/modules/user/src/Access/LoginStatusCheck.php @@ -3,14 +3,13 @@ namespace Drupal\user\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; /** * Determines access to routes based on login status of current user. */ -class LoginStatusCheck implements AccessInterface { +class LoginStatusCheck { /** * Checks access. diff --git a/core/modules/user/src/Access/PermissionAccessCheck.php b/core/modules/user/src/Access/PermissionAccessCheck.php index 2232085..f3cc6a4 100644 --- a/core/modules/user/src/Access/PermissionAccessCheck.php +++ b/core/modules/user/src/Access/PermissionAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\user\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route; @@ -11,7 +10,7 @@ * Determines access to routes based on permissions defined via * $module.permissions.yml files. */ -class PermissionAccessCheck implements AccessInterface { +class PermissionAccessCheck { /** * Checks access. diff --git a/core/modules/user/src/Access/RegisterAccessCheck.php b/core/modules/user/src/Access/RegisterAccessCheck.php index a60227b..7001050 100644 --- a/core/modules/user/src/Access/RegisterAccessCheck.php +++ b/core/modules/user/src/Access/RegisterAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\user\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; /** diff --git a/core/modules/user/src/Access/RoleAccessCheck.php b/core/modules/user/src/Access/RoleAccessCheck.php index eddf5f3..88e56d8 100644 --- a/core/modules/user/src/Access/RoleAccessCheck.php +++ b/core/modules/user/src/Access/RoleAccessCheck.php @@ -3,7 +3,6 @@ namespace Drupal\user\Access; use Drupal\Core\Access\AccessResult; -use Drupal\Core\Routing\Access\AccessInterface; use Drupal\Core\Session\AccountInterface; use Symfony\Component\Routing\Route;