HashMakeCommand   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 35
ccs 6
cts 6
cp 1
rs 10
c 1
b 0
f 0
wmc 1
lcom 1
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 10 1
1
<?php
2
3
namespace LaravelPlus\Extension\Commands;
4
5
use Illuminate\Console\Command;
6
7
/**
8
 * @author Fumio Furukawa <[email protected]>
9
 */
10
class HashMakeCommand extends Command
11
{
12
    /**
13
     * The console command signature.
14
     *
15
     * @var string
16
     */
17
    protected $signature = 'hash:make
18
        {string : Plain string.}
19
        {--cost=10 : Cost of generate.}
20
    ';
21
22
    /**
23
     * The console command description.
24
     *
25
     * @var string
26
     */
27
    protected $description = '[+] Make hashed value';
28
29
    /**
30
     * Execute the console command.
31
     *
32
     * @return mixed
33
     */
34 2
    public function handle()
35
    {
36 2
        $cost = $this->option('cost');
37
38 2
        $hashed = app('hash')->make($this->argument('string'), [
39 2
            'rounds' => $cost,
40
        ]);
41
42 2
        $this->info(sprintf('Generated hash: "%s"', $hashed));
43 2
    }
44
}
45