summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNathaniel Catchpole2016-07-12 12:17:16 +0100
committerNathaniel Catchpole2016-07-12 12:17:16 +0100
commitee76fe4ae96761083e9b0c621b71e62529517175 (patch)
treeb15c4966f5a552e9205b0feb9d7bbaf5da4872c6
parent8a1341ac97fa1e3d9eebbfaffc3fc44669f41581 (diff)
Issue #2624822 by chgasparoto, Lars Toomre, markdorison, anish.a, joshi.rohit100, Mile23, alexpott: Remove unused variables in user.module
-rw-r--r--core/modules/user/src/Form/UserPermissionsForm.php3
-rw-r--r--core/modules/user/src/Tests/UserAdminTest.php4
-rw-r--r--core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php2
3 files changed, 3 insertions, 6 deletions
diff --git a/core/modules/user/src/Form/UserPermissionsForm.php b/core/modules/user/src/Form/UserPermissionsForm.php
index 01e8755..7a06219 100644
--- a/core/modules/user/src/Form/UserPermissionsForm.php
+++ b/core/modules/user/src/Form/UserPermissionsForm.php
@@ -100,7 +100,6 @@ class UserPermissionsForm extends FormBase {
'#value' => $role_names,
);
// Render role/permission overview:
- $options = array();
$hide_descriptions = system_admin_compact_mode();
$form['system_compact_link'] = array(
@@ -145,7 +144,6 @@ class UserPermissionsForm extends FormBase {
'restrict access' => FALSE,
'warning' => !empty($perm_item['restrict access']) ? $this->t('Warning: Give to trusted roles only; this permission has security implications.') : '',
);
- $options[$perm] = $perm_item['title'];
$form['permissions'][$perm]['description'] = array(
'#type' => 'inline_template',
'#template' => '<div class="permission"><span class="title">{{ title }}</span>{% if description or warning %}<div class="description">{% if warning %}<em class="permission-warning">{{ warning }}</em> {% endif %}{{ description }}</div>{% endif %}</div>',
@@ -158,7 +156,6 @@ class UserPermissionsForm extends FormBase {
$form['permissions'][$perm]['description']['#context']['description'] = $perm_item['description'];
$form['permissions'][$perm]['description']['#context']['warning'] = $perm_item['warning'];
}
- $options[$perm] = '';
foreach ($role_names as $rid => $name) {
$form['permissions'][$perm][$rid] = array(
'#title' => $name . ': ' . $perm_item['title'],
diff --git a/core/modules/user/src/Tests/UserAdminTest.php b/core/modules/user/src/Tests/UserAdminTest.php
index 60fd56b..8d4a22b 100644
--- a/core/modules/user/src/Tests/UserAdminTest.php
+++ b/core/modules/user/src/Tests/UserAdminTest.php
@@ -174,8 +174,8 @@ class UserAdminTest extends WebTestBase {
->save();
// Register a new user account.
$edit = array();
- $edit['name'] = $name = $this->randomMachineName();
- $edit['mail'] = $mail = $edit['name'] . '@example.com';
+ $edit['name'] = $this->randomMachineName();
+ $edit['mail'] = $edit['name'] . '@example.com';
$this->drupalPostForm('user/register', $edit, t('Create new account'));
$subject = 'Account details for ' . $edit['name'] . ' at ' . $system->get('name') . ' (pending admin approval)';
// Ensure that admin notification mail is sent to the configured
diff --git a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
index 4a83c41..4022972 100644
--- a/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
+++ b/core/modules/user/tests/src/Kernel/UserAccountFormFieldsTest.php
@@ -135,7 +135,7 @@ class UserAccountFormFieldsTest extends KernelTestBase {
$entity = $this->container->get('entity.manager')
->getStorage($entity_type)
->create($fields);
- $form_object = $this->container->get('entity.manager')
+ $this->container->get('entity.manager')
->getFormObject($entity_type, $operation)
->setEntity($entity);