Completed
Pull Request — master (#265)
by Enrico
14:16
created

DumpDocumentationCommand::configure()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 1
b 0
f 0
1
<?php
2
3
namespace PHPSA\Command;
4
5
use PHPSA\Analyzer;
6
use Symfony\Component\Console\Command\Command;
7
use Symfony\Component\Console\Input\InputInterface;
8
use Symfony\Component\Console\Output\OutputInterface;
9
10
class DumpDocumentationCommand extends Command
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    protected function configure()
16
    {
17
        $this
18
            ->setName('config:dump-documentation')
19
            ->setDescription('Dumps the analyzer documentation')
20
        ;
21
    }
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    protected function execute(InputInterface $input, OutputInterface $output)
27
    {
28
        $metaArray = Analyzer\Factory::getPassesMetadata();
29
        
30
        $output->writeln("# Analyzers");
31
        $output->writeln("This doc gives an overview about what the different analyzers do.");
32
        $output->writeln("");
33
34
        foreach ($metaArray as $analyzer) {
35
            $output->writeln("#### " . $analyzer->getName());
36
            $output->writeln("");
37
            $output->writeln($analyzer->getDescription());
38
            $output->writeln("");
39
        }
40
41
        $output->writeln("Next: [How To: Write own Analyzer](./06_HowTo_Own_Analyzer.md)");
42
    }
43
}
44