Command::createDocs()   A
last analyzed

Complexity

Conditions 2
Paths 3

Size

Total Lines 8
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 7
nc 3
nop 2
dl 0
loc 8
rs 10
c 0
b 0
f 0
1
<?php
2
namespace application;
3
require 'FilesTreatment.php';
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
/**
10
 * Class Command
11
 * @package application
12
 */
13
class Command extends SymfonyCommand {
14
15
    /**
16
     * Command constructor.
17
     */
18
    public function __construct() {
19
        parent::__construct();
20
    }
21
22
    /**
23
     * @param InputInterface $input
24
     * @param OutputInterface $output
25
     */
26
    protected function createDocs(InputInterface $input, OutputInterface $output): void {
27
        $inputPath = $input->getArgument('inputPath');
28
        $outputPath = $input->getArgument('outputPath');
29
        try {
30
            $filesTreatment = new FilesTreatment($inputPath);
31
            $filesTreatment->createDocs($output, $outputPath);
32
        } catch (\Exception $e) {
33
            $output->writeln('Documentation could not be created.');
34
        }
35
    }
36
}