Version   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 2
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
dl 0
loc 29
rs 10
c 2
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 3 1
A handle() 0 5 1
1
<?php
2
3
namespace Sfneal\Cruise\Commands;
4
5
use Illuminate\Console\Command;
6
use Illuminate\Contracts\Console\PromptsForMissingInput;
7
8
class Version extends Command implements PromptsForMissingInput
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'version';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Display the application version';
23
24
    /**
25
     * Execute the console command.
26
     */
27
    public function handle(): int
28
    {
29
        $this->info('v'.self::get());
30
31
        return self::SUCCESS;
32
    }
33
34
    public static function get(): string
35
    {
36
        return file_get_contents(base_path('version.txt'));
37
    }
38
}
39