StringPasswordGenerator::generate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
ccs 2
cts 2
cp 1
cc 1
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * @copyright 2018 Hilmi Erdem KEREN
5
 * @license MIT
6
 */
7
8
namespace Erdemkeren\Otp\PasswordGenerators;
9
10
use Erdemkeren\Otp\PasswordGeneratorInterface;
11
use Illuminate\Support\Str;
12
13
/**
14
 * Class StringPasswordGenerator.
15
 */
16
class StringPasswordGenerator implements PasswordGeneratorInterface
17
{
18
    /**
19
     * Generate a string password with the given length.
20
     *
21
     * @param int $length
22
     *
23
     * @return string
24
     */
25 1
    public function generate(int $length): string
26
    {
27 1
        return Str::random($length);
28
    }
29
}
30