RandomGenerator::generator()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 11
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 11
ccs 0
cts 8
cp 0
rs 9.4285
cc 2
eloc 7
nc 2
nop 0
crap 6
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
}