Helpers   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A uuid() 0 14 1
1
<?php
2
 
3
namespace PatricPoba\MtnMomo\Utilities;
4
 
5
trait Helpers
6
{
7
    /**
8
     * Returns a UUID4 string.
9
     *
10
     * @return string uuid4
11
     */
12
    public static function uuid()
13
    {
14
        return sprintf(
15
            '%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
16
            mt_rand(0, 0xffff),
17
            mt_rand(0, 0xffff),
18
            mt_rand(0, 0xffff),
19
            mt_rand(0, 0x0fff) | 0x4000,
20
            mt_rand(0, 0x3fff) | 0x8000,
21
            mt_rand(0, 0xffff),
22
            mt_rand(0, 0xffff),
23
            mt_rand(0, 0xffff)
24
        );
25
    }
26
}
27