Passed
Push — master ( 554f4f...40d218 )
by James
03:44 queued 16s
created

ShowVersion::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
declare(strict_types=1);
3
/**
4
 * ShowVersion.php
5
 * Copyright (c) 2020 [email protected]
6
 *
7
 * This file is part of the Firefly III CSV importer
8
 * (https://github.com/firefly-iii/csv-importer).
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU Affero General Public License as
12
 * published by the Free Software Foundation, either version 3 of the
13
 * License, or (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU Affero General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU Affero General Public License
21
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
22
 */
23
24
namespace App\Console\Commands;
25
26
use Illuminate\Console\Command;
27
28
/**
29
 * Class ShowVersion
30
 */
31
class ShowVersion extends Command
32
{
33
    /**
34
     * The console command description.
35
     *
36
     * @var string
37
     */
38
    protected $description = 'Echoes the current version and some debug info.';
39
    /**
40
     * The name and signature of the console command.
41
     *
42
     * @var string
43
     */
44
    protected $signature = 'csv:version';
45
46
    /**
47
     * Execute the console command.
48
     *
49
     * @return int
50
     */
51
    public function handle(): int
52
    {
53
        $this->line(sprintf('Firefly III CSV importer v%s', config('csv_importer.version')));
54
        $this->line(sprintf('PHP: %s %s %s', PHP_SAPI, PHP_VERSION, PHP_OS));
55
56
        return 0;
57
    }
58
}
59