From b17f9fc81c40a6b7a5a45cc53e378274e1b6922b Mon Sep 17 00:00:00 2001 From: Matt Friedman Date: Mon, 29 Feb 2016 21:04:16 -0800 Subject: [PATCH] [ticket/12684] Allowed to use $this in enclosure PHPBB3-12684 --- phpBB/phpbb/console/command/user/add.php | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/phpBB/phpbb/console/command/user/add.php b/phpBB/phpbb/console/command/user/add.php index 6edd214d14..6f0988db5e 100644 --- a/phpBB/phpbb/console/command/user/add.php +++ b/phpBB/phpbb/console/command/user/add.php @@ -140,14 +140,13 @@ class add extends \phpbb\console\command\command if (!$data['new_password']) { - $self = $this; $question = new Question($this->ask_user('PASSWORD')); - $question->setValidator(function ($value) use ($self, $helper, $input, $output) { - $question = new Question($self->ask_user('CONFIRM_PASSWORD')); + $question->setValidator(function ($value) use ($helper, $input, $output) { + $question = new Question($this->ask_user('CONFIRM_PASSWORD')); $question->setHidden(true); if ($helper->ask($input, $output, $question) != $value) { - throw new runtime_exception($self->language->lang('NEW_PASSWORD_ERROR')); + throw new runtime_exception($this->language->lang('NEW_PASSWORD_ERROR')); } return $value; });