Completed
Branch master (6576e0)
by Timur
02:16
created

ForgeCredentials   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 33
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Laravel\Forge\Laravel\Commands;
4
5
use Laravel\Forge\Forge;
6
use Illuminate\Console\Command;
7
8
class ForgeCredentials extends Command
9
{
10
    /**
11
     * The name and signature of the console command.
12
     *
13
     * @var string
14
     */
15
    protected $signature = 'forge:credentials';
16
17
    /**
18
     * The console command description.
19
     *
20
     * @var string
21
     */
22
    protected $description = 'Display Forge credentials';
23
24
    /**
25
     * Execute the console command.
26
     *
27
     * @return mixed
28
     */
29
    public function handle(Forge $forge)
30
    {
31
        $credentials = $forge->credentials();
32
33
        $headers = ['ID', 'Name', 'Provider'];
34
        $rows = collect($credentials)->map(function ($credential) {
35
            return [$credential['id'], $credential['name'], $credential['type']];
36
        });
37
38
        $this->table($headers, $rows->toArray());
39
    }
40
}
41