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.
Passed
Push — master ( 8a6204...f86781 )
by herry
35:26 queued 26:38
created

str_random()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 1 Features 0
Metric Value
cc 2
eloc 6
c 1
b 1
f 0
nc 2
nop 1
dl 0
loc 9
rs 10
1
<?php
2
3
use MuCTS\Laravel\GuiJK\Facades\Gjk;
4
5
if (!function_exists('gjk_request')) {
6
    /**
7
     * Gjk API Request
8
     *
9
     * @param string $route
10
     * @param array $params
11
     * @param int $timeOut
12
     * @return string|array|null
13
     */
14
    function gjk_request($route, $params, $timeOut = 15)
15
    {
16
        return Gjk::request($route, $params, $timeOut);
17
    }
18
}
19
20
if (!function_exists("str_random")) {
21
    /**
22
     * string random
23
     * @param int $length
24
     * @return string
25
     * @throws Exception
26
     */
27
    function str_random(int $length)
28
    {
29
        $string = '';
30
        while (($len = strlen($string)) < $length) {
31
            $size = $length - $len;
32
            $bytes = random_bytes($size);
33
            $string .= substr(str_replace(['/', '+', '='], '', base64_encode($bytes)), 0, $size);
34
        }
35
        return $string;
36
    }
37
}