Application::getLongVersion()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
rs 9.4285
cc 2
eloc 6
nc 2
nop 0
1
<?php
2
3
namespace Yoghi\Bundle\MaddaBundle\Console;
4
5
/*
6
 * This file is part of the MADDA project.
7
 *
8
 * (c) Stefano Tamagnini <>
9
 *
10
 * This source file is subject to the GPLv3 license that is bundled
11
 * with this source code in the file LICENSE.
12
 */
13
14
use Symfony\Component\Console\Application as BaseApplication;
15
use Yoghi\Bundle\MaddaBundle\Command\CheckSecurityCommand;
16
use Yoghi\Bundle\MaddaBundle\Command\GenerateModelCommand;
17
18
/**
19
 * @author Stefano Tamagnini <>
20
 */
21
class Application extends BaseApplication
22
{
23
    const VERSION = '1.0.0-DEV';
24
25
    /**
26
     * Constructor.
27
     */
28
    public function __construct()
29
    {
30
        error_reporting(-1);
31
        parent::__construct('Madda', self::VERSION);
32
        $this->add(new CheckSecurityCommand());
33
        $this->add(new GenerateModelCommand());
34
    }
35
    public function getLongVersion()
36
    {
37
        $version = parent::getLongVersion().' by <comment>Stefano Tamagnini</comment>';
38
        $commit = '@git-commit@';
39
        if ('@'.'git-commit@' !== $commit) {
40
            $version .= ' ('.substr($commit, 0, 7).')';
41
        }
42
43
        return $version;
44
    }
45
}
46