Passed
Pull Request — master (#48)
by Arman
03:56
created

VersionCommand   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 9
c 1
b 0
f 0
dl 0
loc 38
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A exec() 0 11 1
1
<?php
2
3
/**
4
 * Quantum PHP Framework
5
 *
6
 * An open source software development framework for PHP
7
 *
8
 * @package Quantum
9
 * @author Arman Ag. <[email protected]>
10
 * @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
11
 * @link http://quantum.softberg.org/
12
 * @since 2.6.0
13
 */
14
15
namespace Quantum\Console\Commands;
16
17
use Quantum\Environment\Environment;
18
use Quantum\Console\QtCommand;
19
use Quantum\Loader\Setup;
20
use Figlet\Figlet;
21
22
/**
23
 * Class VersionCommand
24
 * @package Quantum\Console\Commands
25
 */
26
class VersionCommand extends QtCommand
27
{
28
29
    /**
30
     * Command name
31
     * @var string
32
     */
33
    protected $name = 'core:version';
34
35
    /**
36
     * Command description
37
     * @var string
38
     */
39
    protected $description = 'Core version';
40
41
    /**
42
     * Command help text
43
     * @var string
44
     */
45
    protected $help = 'Printing the current version of the framework into the terminal';
46
47
    /**
48
     * Executes the command and prints greetings into the terminal
49
     * @throws \Quantum\Exceptions\DiException
50
     * @throws \Quantum\Exceptions\EnvException
51
     * @throws \ReflectionException
52
     */
53
    public function exec()
54
    {
55
        Environment::getInstance()->load(new Setup('config', 'env'));
56
57
        $figlet = new Figlet();
58
59
        $figlet->setFont('slant.flf')->setSmushMode(Figlet::SM_SMUSH);
60
61
        $this->info($figlet->render('QUANTUM PHP ' . env('APP_VERSION')));
62
63
        $this->info('- - - Q U A N T U M   P H P   F R A M E W O R K  ' . env('APP_VERSION') . '  I N S T A L L E D - - -');
64
    }
65
66
}
67