Conditions | 4 |
Paths | 3 |
Total Lines | 23 |
Code Lines | 15 |
Lines | 0 |
Ratio | 0 % |
Tests | 15 |
CRAP Score | 4 |
Changes | 0 |
1 | <?php |
||
35 | 4 | public function handle() |
|
36 | { |
||
37 | 4 | $cost = $this->option('cost'); |
|
38 | |||
39 | 4 | $string1 = $this->argument('string1'); |
|
40 | 4 | $string2 = $this->argument('string2'); |
|
41 | |||
42 | 4 | if ($this->isHashed($string1)) { |
|
43 | 2 | $rawString = $string2; |
|
44 | 2 | $hashedString = $string1; |
|
45 | 2 | } elseif ($this->isHashed($string2)) { |
|
46 | 1 | $rawString = $string1; |
|
47 | 1 | $hashedString = $string2; |
|
48 | } else { |
||
49 | 1 | $this->error(sprintf('Error: both "%s" and "%s" are not hashed string.', $string1, $string2)); |
|
50 | |||
51 | 1 | return; |
|
52 | } |
||
53 | |||
54 | 3 | $result = app('hash')->check($string1, $string2); |
|
55 | |||
56 | 3 | $this->info($result ? 'Check OK!' : 'Check NG.'); |
|
57 | 3 | } |
|
58 | |||
64 |