Completed
Push — v3.0.0-dev ( c7f980...54069c )
by Hilmi Erdem
28:15
created

StringPasswordGenerator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 14
rs 10
c 0
b 0
f 0
ccs 0
cts 4
cp 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A generate() 0 4 1
1
<?php
2
3
/*
4
 * @copyright 2018 Hilmi Erdem KEREN
5
 * @license MIT
6
 */
7
8
namespace Erdemkeren\TemporaryAccess\PasswordGenerators;
9
10
use Erdemkeren\TemporaryAccess\PasswordGeneratorInterface;
11
12
/**
13
 * Class StringPasswordGenerator.
14
 */
15
class StringPasswordGenerator implements PasswordGeneratorInterface
16
{
17
    /**
18
     * Generate a string password with the given length.
19
     *
20
     * @param int $length
21
     *
22
     * @return string
23
     */
24
    public function generate(int $length): string
25
    {
26
        return str_random($length);
27
    }
28
}
29