Utils   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 11
dl 0
loc 17
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A createGuid() 0 12 1
1
<?php
2
3
namespace AntonyThorpe\SilverShopUnleashed;
4
5
/**
6
 * Utility
7
 */
8
class Utils
9
{
10
    /**
11
     * Create a global unique id and return it
12
     */
13
    public static function createGuid(): string
14
    {
15
        return strtolower(sprintf(
16
            '%04X%04X-%04X-%04X-%04X-%04X%04X%04X',
17
            mt_rand(0, 65535),
18
            mt_rand(0, 65535),
19
            mt_rand(0, 65535),
20
            mt_rand(16384, 20479),
21
            mt_rand(32768, 49151),
22
            mt_rand(0, 65535),
23
            mt_rand(0, 65535),
24
            mt_rand(0, 65535)
25
        ));
26
    }
27
}
28