CliFactory   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 5

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 5
dl 0
loc 19
ccs 7
cts 7
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A getInstance() 0 11 1
1
<?php
2
3
/**
4
 * This file is part of the CloverToHtml package.
5
 *
6
 * (c) Stéphane Demonchaux <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
namespace CloverToHtml\Service;
12
13
use Symfony\Component\Console\Application;
14
use Symfony\Component\Console\Helper\QuestionHelper;
15
use Symfony\Component\Console\Helper\FormatterHelper;
16
use CloverToHtml\Command\ConvertCommandFactory;
17
18
/**
19
 * Create CLI instance.
20
 *
21
 * @author Stéphane Demonchaux
22
 */
23
class CliFactory
24
{
25
    /**
26
     * Create CLI instance.
27
     *
28
     * @return Application
29
     */
30 1
    public static function getInstance(): Application
31
    {
32 1
        $questionHelper = new QuestionHelper();
33 1
        $application    = new Application('CloverToHtml Command Line Interface', 'Beta 0.1.0');
34 1
        $application->getHelperSet()->set(new FormatterHelper(), 'formatter');
35 1
        $application->getHelperSet()->set($questionHelper, 'question');
36
37 1
        $application->add(ConvertCommandFactory::getInstance());
38
39 1
        return $application;
40
    }
41
}
42