RandomGenerator   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A generator() 0 11 2
1
<?php
2
/**
3
 * Created by PhpStorm.
4
 * User: device
5
 * Date: 20.03.16
6
 * Time: 10:40
7
 */
8
9
namespace AppBundle\Services;
10
11
12
class RandomGenerator
13
{
14
    public function generator()
15
    {
16
        $key = '';
17
        $array = array_merge(range('A','Z'),range('a','z'),range('0','9'));
18
        $c = count($array)-1;
19
        for($i = 0; $i < 6; $i++) {
20
            $key .= $array[rand(0, $c)];
21
        }
22
23
        return $key;
24
    }
25
}