AbstractCommand   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
eloc 5
c 2
b 0
f 0
dl 0
loc 16
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 3 1
A initialize() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Incapsula\Command;
6
7
use Incapsula\Client;
8
use Symfony\Component\Console\Command\Command;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Input\InputOption;
11
use Symfony\Component\Console\Output\OutputInterface;
12
13
abstract class AbstractCommand extends Command
14
{
15
    /**
16
     * @var Client;
17
     */
18
    protected $client;
19
20
    protected function configure(): void
21
    {
22
        $this->addOption('profile', 'p', InputOption::VALUE_OPTIONAL, 'Incapsula profile');
23
    }
24
25
    protected function initialize(InputInterface $input, OutputInterface $output): void
26
    {
27
        $this->client = new Client([
28
            'profile' => $input->getParameterOption(['--profile', '-p']),
29
        ]);
30
    }
31
}
32