mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
[ticket/17176] Ensure helpers are of expected type
PHPBB3-17176
This commit is contained in:
parent
0af921d870
commit
c91e758902
2 changed files with 10 additions and 0 deletions
|
@ -21,6 +21,7 @@ use phpbb\language\language;
|
||||||
use phpbb\passwords\manager;
|
use phpbb\passwords\manager;
|
||||||
use phpbb\user;
|
use phpbb\user;
|
||||||
use Symfony\Component\Console\Command\Command as symfony_command;
|
use Symfony\Component\Console\Command\Command as symfony_command;
|
||||||
|
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
|
@ -184,6 +185,10 @@ class add extends command
|
||||||
protected function interact(InputInterface $input, OutputInterface $output)
|
protected function interact(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$helper = $this->getHelper('question');
|
$helper = $this->getHelper('question');
|
||||||
|
if (!$helper instanceof QuestionHelper)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$this->data = array(
|
$this->data = array(
|
||||||
'username' => $input->getOption('username'),
|
'username' => $input->getOption('username'),
|
||||||
|
|
|
@ -19,6 +19,7 @@ use phpbb\log\log_interface;
|
||||||
use phpbb\user;
|
use phpbb\user;
|
||||||
use phpbb\user_loader;
|
use phpbb\user_loader;
|
||||||
use Symfony\Component\Console\Command\Command as symfony_command;
|
use Symfony\Component\Console\Command\Command as symfony_command;
|
||||||
|
use Symfony\Component\Console\Helper\QuestionHelper;
|
||||||
use Symfony\Component\Console\Input\InputArgument;
|
use Symfony\Component\Console\Input\InputArgument;
|
||||||
use Symfony\Component\Console\Input\InputInterface;
|
use Symfony\Component\Console\Input\InputInterface;
|
||||||
use Symfony\Component\Console\Input\InputOption;
|
use Symfony\Component\Console\Input\InputOption;
|
||||||
|
@ -151,6 +152,10 @@ class delete extends command
|
||||||
protected function interact(InputInterface $input, OutputInterface $output)
|
protected function interact(InputInterface $input, OutputInterface $output)
|
||||||
{
|
{
|
||||||
$helper = $this->getHelper('question');
|
$helper = $this->getHelper('question');
|
||||||
|
if (!$helper instanceof QuestionHelper)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$question = new ConfirmationQuestion(
|
$question = new ConfirmationQuestion(
|
||||||
$this->language->lang('CLI_USER_DELETE_CONFIRM', $input->getArgument('username')),
|
$this->language->lang('CLI_USER_DELETE_CONFIRM', $input->getArgument('username')),
|
||||||
|
|
Loading…
Add table
Reference in a new issue