Test Failed
Push — master ( d3e9ef...1b9271 )
by Johannes
04:34
created

ParseContentCommand   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 4
lcom 1
cbo 1
dl 0
loc 40
rs 10
c 0
b 0
f 0

4 Methods

Rating   Name   Duplication   Size   Complexity  
A setParseContentExecutor() 0 4 1
A getParseContentExecutor() 0 4 1
A configure() 0 5 1
A execute() 0 4 1
1
<?php
2
/**
3
 * Lichtenwallner  (https://lichtenwallner.at)
4
 *
5
 * @see https://github.com/jolicht/markdown-cms for the canonical source repository
6
 * @license https://github.com/jolicht/markdown-cms/blob/master/LICENSE MIT
7
 * @copyright Copyright (c) Johannes Lichtenwallner
8
 */
9
declare(strict_types = 1);
10
namespace Jolicht\MarkdownCms\Command;
11
12
use Symfony\Component\Console\Command\Command;
13
use Symfony\Component\Console\Input\InputInterface;
14
use Symfony\Component\Console\Output\OutputInterface;
15
use Jolicht\MarkdownCms\Parser\ParseContentExecutor;
16
17
class ParseContentCommand extends Command
18
{
19
    /**
20
     * Parse content executor
21
     *
22
     * @var ParseContentExecutor
23
     */
24
    private $parseContentExecutor;
25
26
    /**
27
     * Set parse content executor
28
     *
29
     * @param ParseContentExecutor $parseContentExecutor
30
     */
31
    public function setParseContentExecutor(ParseContentExecutor $parseContentExecutor)
32
    {
33
        $this->parseContentExecutor = $parseContentExecutor;
34
    }
35
36
    /**
37
     * Get parse content executor
38
     *
39
     * @return ParseContentExecutor
40
     */
41
    public function getParseContentExecutor() : ParseContentExecutor
42
    {
43
        return $this->parseContentExecutor;
44
    }
45
46
    protected function configure()
47
    {
48
        $this->setName('markdown-cms:parse')
49
            ->setDescription('parse markdown documents in content directory');
50
    }
51
52
    protected function execute(InputInterface $input, OutputInterface $output)
53
    {
54
        ($this->getParseContentExecutor())();
55
    }
56
}