Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
100.00% |
23 / 23 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
HydeDebugCommand | |
100.00% |
23 / 23 |
|
100.00% |
2 / 2 |
5 | |
100.00% |
1 / 1 |
__construct | |
100.00% |
3 / 3 |
|
100.00% |
1 / 1 |
2 | |||
handle | |
100.00% |
20 / 20 |
|
100.00% |
1 / 1 |
3 |
1 | <?php |
2 | |
3 | namespace Hyde\Framework\Commands; |
4 | |
5 | use Hyde\Framework\Hyde; |
6 | use LaravelZero\Framework\Commands\Command; |
7 | |
8 | /** |
9 | * Hyde Command to print debug information. |
10 | */ |
11 | class HydeDebugCommand extends Command |
12 | { |
13 | /** |
14 | * The signature of the command. |
15 | * |
16 | * @var string |
17 | */ |
18 | protected $signature = 'debug'; |
19 | |
20 | /** |
21 | * The description of the command. |
22 | * |
23 | * @var string |
24 | */ |
25 | protected $description = 'Print debug info'; |
26 | |
27 | public function __construct() |
28 | { |
29 | parent::__construct(); |
30 | |
31 | if (config('app.env', 'production') !== 'development') { |
32 | $this->setHidden(); |
33 | } |
34 | } |
35 | |
36 | /** |
37 | * Execute the console command. |
38 | * |
39 | * @return int |
40 | */ |
41 | public function handle(): int |
42 | { |
43 | $this->info('HydePHP Debug Screen'); |
44 | |
45 | $this->newLine(); |
46 | $this->comment('Git Version: '.app('git.version')); |
47 | $this->comment('Hyde Version: '.app('hyde.version')); |
48 | $this->comment('Framework Version: '.app('framework.version')); |
49 | |
50 | $this->newLine(); |
51 | $this->comment('App Env: '.app('env')); |
52 | |
53 | $this->newLine(); |
54 | if ($this->getOutput()->isVerbose()) { |
55 | $this->line('Project directory:'); |
56 | $this->line(' > '.realpath(Hyde::path())); |
57 | $this->line('Framework vendor path:'); |
58 | $this->line(' > '.(str_replace('/', DIRECTORY_SEPARATOR, Hyde::vendorPath()).' (vendor)')); |
59 | $this->line(' > '.realpath(Hyde::vendorPath()).' (real)'); |
60 | } else { |
61 | $this->comment('Project directory: '.Hyde::path()); |
62 | } |
63 | |
64 | $this->newLine(); |
65 | |
66 | $this->line('Enabled features:'); |
67 | foreach (config('hyde.features') as $feature) { |
68 | $this->line(" - $feature"); |
69 | } |
70 | |
71 | return 0; |
72 | } |
73 | } |