From 393e3c50348c86d3b3c16d1af47140629836ca64 Mon Sep 17 00:00:00 2001 From: Byron Duvall Date: Wed, 8 Apr 2020 13:05:11 -0400 Subject: [PATCH] remove unused property, local variable, and update hook example --- workbench_access_protect/src/Access/DeleteAccessCheck.php | 7 ------- .../tests/src/Functional/TaxonomyProtectTest.php | 1 - workbench_access_protect/workbench_access_protect.api.php | 4 +++- 3 files changed, 3 insertions(+), 9 deletions(-) diff --git a/workbench_access_protect/src/Access/DeleteAccessCheck.php b/workbench_access_protect/src/Access/DeleteAccessCheck.php index 3d345c18..357c57d1 100644 --- a/workbench_access_protect/src/Access/DeleteAccessCheck.php +++ b/workbench_access_protect/src/Access/DeleteAccessCheck.php @@ -17,13 +17,6 @@ */ class DeleteAccessCheck implements DeleteAccessCheckInterface { - /** - * User account. - * - * @var \Drupal\Core\Session\AccountInterface - */ - private $account; - /** * Default object for current_route_match service. * diff --git a/workbench_access_protect/tests/src/Functional/TaxonomyProtectTest.php b/workbench_access_protect/tests/src/Functional/TaxonomyProtectTest.php index 9f88d63f..d15f9b5b 100644 --- a/workbench_access_protect/tests/src/Functional/TaxonomyProtectTest.php +++ b/workbench_access_protect/tests/src/Functional/TaxonomyProtectTest.php @@ -159,7 +159,6 @@ protected function setUpTestContent() { */ protected function setUpTestUser() { $user_storage = \Drupal::service('workbench_access.user_section_storage'); - $role_storage = \Drupal::service('workbench_access.role_section_storage'); // Add the user to the base section. $user_storage->addUser($this->scheme, $this->editor, [$this->term->id()]); $expected = [$this->editor->id()]; diff --git a/workbench_access_protect/workbench_access_protect.api.php b/workbench_access_protect/workbench_access_protect.api.php index 8e9ab908..8aaa276d 100644 --- a/workbench_access_protect/workbench_access_protect.api.php +++ b/workbench_access_protect/workbench_access_protect.api.php @@ -24,5 +24,7 @@ function hook_workbench_access_protect_list_alter(array &$list) { // Our example module uses node types as the access scheme. They have no // parents. - $list['node_type'] => ['node_type']; + return [ + $list['node_type'] => ['node_type'], + ]; }