@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | |
22 | 22 | class Configure extends Command { |
23 | 23 | /** @var AGateway[] */ |
24 | - private array $gateways = []; |
|
24 | + private array $gateways = [ ]; |
|
25 | 25 | |
26 | 26 | public function __construct( |
27 | 27 | private Factory $gatewayFactory, |
@@ -31,24 +31,24 @@ discard block |
||
31 | 31 | $fqcnList = $this->gatewayFactory->getFqcnList(); |
32 | 32 | foreach ($fqcnList as $fqcn) { |
33 | 33 | $gateway = $this->gatewayFactory->get($fqcn); |
34 | - $this->gateways[$gateway->getSettings()->id] = $gateway; |
|
34 | + $this->gateways[ $gateway->getSettings()->id ] = $gateway; |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | $this->addArgument( |
38 | 38 | 'gateway', |
39 | 39 | InputArgument::OPTIONAL, |
40 | - 'The name of the gateway: ' . implode(', ', array_keys($this->gateways)) |
|
40 | + 'The name of the gateway: '.implode(', ', array_keys($this->gateways)) |
|
41 | 41 | ); |
42 | 42 | } |
43 | 43 | |
44 | - #[\Override] |
|
44 | + #[\Override ] |
|
45 | 45 | protected function execute(InputInterface $input, OutputInterface $output) { |
46 | 46 | $gatewayName = strtolower((string)$input->getArgument('gateway')); |
47 | 47 | if (!array_key_exists($gatewayName, $this->gateways)) { |
48 | 48 | $helper = new QuestionHelper(); |
49 | 49 | $choiceQuestion = new ChoiceQuestion('Please choose a provider:', array_keys($this->gateways)); |
50 | 50 | $selectedIndex = $helper->ask($input, $output, $choiceQuestion); |
51 | - $gateway = $this->gateways[$selectedIndex]; |
|
51 | + $gateway = $this->gateways[ $selectedIndex ]; |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | try { |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | class Remove extends Command { |
22 | 22 | /** @var AGateway[] */ |
23 | - private array $gateways = []; |
|
23 | + private array $gateways = [ ]; |
|
24 | 24 | |
25 | 25 | public function __construct( |
26 | 26 | private Factory $gatewayFactory, |
@@ -30,24 +30,24 @@ discard block |
||
30 | 30 | $fqcnList = $this->gatewayFactory->getFqcnList(); |
31 | 31 | foreach ($fqcnList as $fqcn) { |
32 | 32 | $gateway = $this->gatewayFactory->get($fqcn); |
33 | - $this->gateways[$gateway->getSettings()->id] = $gateway; |
|
33 | + $this->gateways[ $gateway->getSettings()->id ] = $gateway; |
|
34 | 34 | } |
35 | 35 | |
36 | 36 | $this->addArgument( |
37 | 37 | 'gateway', |
38 | 38 | InputArgument::OPTIONAL, |
39 | - 'The name of the gateway: ' . implode(', ', array_keys($this->gateways)) |
|
39 | + 'The name of the gateway: '.implode(', ', array_keys($this->gateways)) |
|
40 | 40 | ); |
41 | 41 | } |
42 | 42 | |
43 | - #[\Override] |
|
43 | + #[\Override ] |
|
44 | 44 | protected function execute(InputInterface $input, OutputInterface $output) { |
45 | 45 | $gatewayName = strtolower((string)$input->getArgument('gateway')); |
46 | 46 | if (!array_key_exists($gatewayName, $this->gateways)) { |
47 | 47 | $helper = new QuestionHelper(); |
48 | 48 | $choiceQuestion = new ChoiceQuestion('Please choose a provider:', array_keys($this->gateways)); |
49 | 49 | $selected = $helper->ask($input, $output, $choiceQuestion); |
50 | - $gateway = $this->gateways[$selected]; |
|
50 | + $gateway = $this->gateways[ $selected ]; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | $gateway->remove(); |
@@ -25,16 +25,16 @@ discard block |
||
25 | 25 | parent::__construct('twofactorauth:gateway:test'); |
26 | 26 | |
27 | 27 | $fqcnList = $this->gatewayFactory->getFqcnList(); |
28 | - $gateways = []; |
|
28 | + $gateways = [ ]; |
|
29 | 29 | foreach ($fqcnList as $fqcn) { |
30 | 30 | $gateway = $this->gatewayFactory->get($fqcn); |
31 | - $gateways[$gateway->getSettings()->id] = $gateway; |
|
31 | + $gateways[ $gateway->getSettings()->id ] = $gateway; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $this->addArgument( |
35 | 35 | 'gateway', |
36 | 36 | InputArgument::REQUIRED, |
37 | - 'The name of the gateway: ' . implode(', ', array_keys($gateways)) |
|
37 | + 'The name of the gateway: '.implode(', ', array_keys($gateways)) |
|
38 | 38 | ); |
39 | 39 | $this->addArgument( |
40 | 40 | 'identifier', |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | ); |
44 | 44 | } |
45 | 45 | |
46 | - #[\Override] |
|
46 | + #[\Override ] |
|
47 | 47 | protected function execute(InputInterface $input, OutputInterface $output) { |
48 | 48 | $gatewayName = $input->getArgument('gateway'); |
49 | 49 | $identifier = $input->getArgument('identifier'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | return 1; |
60 | 60 | } |
61 | 61 | |
62 | - $gateway->send($identifier, 'Test', ['code' => '123456']); |
|
62 | + $gateway->send($identifier, 'Test', [ 'code' => '123456' ]); |
|
63 | 63 | return 0; |
64 | 64 | } |
65 | 65 | } |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | parent::__construct('twofactorauth:gateway:status'); |
23 | 23 | } |
24 | 24 | |
25 | - #[\Override] |
|
25 | + #[\Override ] |
|
26 | 26 | protected function execute(InputInterface $input, OutputInterface $output) { |
27 | 27 | $fqcnList = $this->gatewayFactory->getFqcnList(); |
28 | 28 | foreach ($fqcnList as $fqcn) { |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | $gateway = $this->gatewayFactory->get($fqcn); |
31 | 31 | $isConfigured = $gateway->isComplete(); |
32 | 32 | $settings = $gateway->getSettings(); |
33 | - $output->writeln($settings->name . ': ' . ($isConfigured ? 'configured' : 'not configured')); |
|
33 | + $output->writeln($settings->name.': '.($isConfigured ? 'configured' : 'not configured')); |
|
34 | 34 | } |
35 | 35 | return 0; |
36 | 36 | } |