GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

Uuid::generate()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 8
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
cc 1
eloc 6
c 1
b 0
f 1
nc 1
nop 0
dl 0
loc 8
rs 10
1
<?php
2
/**
3
 * This file is part of the O2System Framework package.
4
 *
5
 * For the full copyright and license information, please view the LICENSE
6
 * file that was distributed with this source code.
7
 *
8
 * @author         Steeve Andrian Salim
9
 * @copyright      Copyright (c) Steeve Andrian Salim
10
 */
11
12
// ------------------------------------------------------------------------
13
14
namespace O2System\Security\Generators;
15
16
// ------------------------------------------------------------------------
17
18
/**
19
 * Class Uuid
20
 *
21
 * UUID (Universally Unique Identifier) Generator.
22
 * A UUID is a 16-octet (128-bit) number.
23
 * In its canonical form, a UUID is represented by 32 hexadecimal digits, displayed in five groups separated by hyphens,
24
 * in the form 8-4-4-4-12 for a total of 36 characters (32 alphanumeric characters and four hyphens).
25
 *
26
 * @package O2System\Security\Generators
27
 */
28
class Uuid
29
{
30
    /**
31
     * Uuid::generate
32
     *
33
     * @return string
34
     */
35
    public static function generate()
36
    {
37
        return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x',
38
            mt_rand(0, 0xffff), mt_rand(0, 0xffff),
39
            mt_rand(0, 0xffff),
40
            mt_rand(0, 0x0C2f) | 0x4000,
41
            mt_rand(0, 0x3fff) | 0x8000,
42
            mt_rand(0, 0x2Aff), mt_rand(0, 0xffD3), mt_rand(0, 0xff4B)
43
        );
44
    }
45
}