Completed
Push — master ( 4672bf...c09367 )
by Vladimir
02:46
created

ListIntents::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 10
c 0
b 0
f 0
cc 1
eloc 6
nc 1
nop 1
ccs 0
cts 5
cp 0
crap 2
rs 9.4285
1
<?php
2
3
declare(strict_types=1);
4
5
namespace FondBot\Toolbelt;
6
7
use Illuminate\Console\Command;
8
use FondBot\Contracts\Conversation\Manager;
9
10
class ListIntents extends Command
11
{
12
    protected $signature = 'fondbot:intent-list';
13
    protected $description = 'List all registered intents';
14
15
    public function handle(Manager $manager): void
16
    {
17
        $rows = collect($manager->getIntents())
18
            ->transform(function ($item) {
19
                return [$item];
20
            })
21
            ->toArray();
22
23
        $this->table(['Class'], $rows);
24
    }
25
}
26