Application   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 6

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 6
dl 0
loc 30
c 0
b 0
f 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A boot() 0 13 1
1
<?php
2
declare(strict_types=1);
3
4
/*
5
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
8
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
10
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
11
 * THE SOFTWARE.
12
 *
13
 * This software consists of voluntary contributions made by many individuals
14
 * and is licensed under the MIT license.
15
 *
16
 * Copyright (c) 2018 Yuuki Takezawa
17
 */
18
19
namespace Ytake\Lom\Console;
20
21
use PhpParser\Lexer;
22
use PhpParser\Parser\Php7;
23
use Ytake\Lom\CodeParser;
24
use Ytake\Lom\Lom;
25
26
/**
27
 * Class Application.
28
 *
29
 * @author yuuki.takezawa<[email protected]>
30
 */
31
class Application extends \Symfony\Component\Console\Application
32
{
33
    /** @var string */
34
    protected $name = 'lom';
35
36
    /** @var string */
37
    protected $version = '0.2';
38
39
    public function __construct()
40
    {
41
        parent::__construct($this->name, $this->version);
42
    }
43
44
    /**
45
     * @throws \Exception
46
     */
47
    public function boot()
48
    {
49
        $this->add(
50
            new GenerateCommand(
51
                new Lom(
52
                    new CodeParser(
53
                        new Php7(new Lexer())
54
                    )
55
                )
56
            )
57
        );
58
        $this->run();
59
    }
60
}
61