Completed
Push — master ( d0bd4d...b4b0fd )
by Igor
23:04
created

Random   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A fileName() 0 5 1
1
<?php
2
3
namespace app\helpers;
4
5
class Random
6
{
7
    /**
8
     * Generate a file name
9
     *
10
     * @param string $extension The file extension
11
     * @return string
12
     */
13
    public static function fileName(string $extension): string
14
    {
15
        $name = date('YmdHis') . substr(md5(microtime() . uniqid()), 0, 10);
16
        return $name . '.' . $extension;
17
    }
18
}
19