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.

gjk_request()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 1 Features 0
Metric Value
cc 1
eloc 1
c 3
b 1
f 0
nc 1
nop 3
dl 0
loc 3
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
}