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.
Completed
Push — master ( c19fa0...352711 )
by milkmeowo
02:41
created

helpers.php ➔ is_lumen()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 4
nc 1
nop 0
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0
1
<?php
2
/**
3
 * helpers.php.
4
 *
5
 * Description
6
 *
7
 * @author Milkmeowo <[email protected]>
8
 */
9
if (! function_exists('is_lumen')) {
10
    /**
11
     * Checks whether or not the application is Lumen.
12
     *
13
     * @return bool
14
     */
15
    function is_lumen()
16
    {
17
        $version = app()->version();
18
        $is_lumen = str_contains($version, 'Lumen');
19
20
        return $is_lumen;
21
    }
22
}
23
if (! function_exists('is_laravel')) {
24
    /**
25
     * Checks whether or not the application is Laravel.
26
     *
27
     * @return bool
28
     */
29
    function is_laravel()
30
    {
31
        return ! is_lumen();
32
    }
33
}
34
35
if (! function_exists('app_path')) {
36
    /**
37
     * Get the path to the application folder.
38
     *
39
     * @param  string $path
40
     *
41
     * @return string
42
     */
43
    function app_path($path = '')
44
    {
45
        return app('path').($path ? DIRECTORY_SEPARATOR.$path : $path);
46
    }
47
}
48
49
if (! function_exists('bcrypt')) {
50
    /**
51
     * Hash the given value.
52
     *
53
     * @param  string $value
54
     * @param  array  $options
55
     *
56
     * @return string
57
     */
58
    function bcrypt($value, $options = [])
59
    {
60
        return app('hash')->make($value, $options);
61
    }
62
}
63
64
if (! function_exists('smart_get_client_ip')) {
65
66
    /**
67
     * @return array|string
68
     */
69
    function smart_get_client_ip()
70
    {
71
        $request = app('request');
72
        $clientIp = $request->header('X-Client-Ip');
73
        if (empty($clientIp)) {
74
            $clientIp = $request->getClientIp(true);
75
        }
76
77
        return $clientIp;
78
    }
79
}
80