Command::validateInput()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 3
rs 10
cc 1
eloc 1
nc 1
nop 1
1
<?php
2
3
namespace Sugarcrm\UpgradeSpec\Command;
4
5
use Symfony\Component\Console\Command\Command as SymfonyCommand;
6
use Symfony\Component\Console\Input\InputInterface;
7
use Symfony\Component\Console\Output\OutputInterface;
8
9
class Command extends SymfonyCommand
10
{
11
    /**
12
     * @param InputInterface  $input
13
     * @param OutputInterface $output
14
     *
15
     * @return int
16
     */
17
    public function run(InputInterface $input, OutputInterface $output)
18
    {
19
        try {
20
            return parent::run($input, $output);
21
        } catch (\Exception $e) {
22
            $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));
23
24
            return 1;
25
        }
26
    }
27
28
    /**
29
     * Initialize command and validate input.
30
     *
31
     * @param InputInterface  $input
32
     * @param OutputInterface $output
33
     */
34
    protected function initialize(InputInterface $input, OutputInterface $output)
35
    {
36
        $this->validateInput($input);
37
    }
38
39
    /**
40
     * Validate user input.
41
     *
42
     * @param InputInterface $input
43
     */
44
    protected function validateInput(InputInterface $input)
45
    {
46
    }
47
}
48