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 ( 5bd424...8b450b )
by Matthew
13s
created

get_std_env()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Sphpeme;
4
5
/**
6
 * Parse the given value as its scalar type
7
 *
8
 * @param $val
9
 * @return mixed
10
 */
11
function atom($val)
12
{
13
    if (is_numeric($val)) {
14
        return new Scalar(strpos($val, '.')
15
            ? (float)$val
16
            : (int)$val);
17
    }
18
19
    if (strpos($val, '"') === 0) {
20
        return new Scalar(str_replace('"', '', $val));
21
    }
22
23
    if (\is_bool($val)) {
24
        return new Scalar($val);
25
    }
26
27
    return Symbol::make($val);
28
}
29
30
/**
31
 * Extend the given env with the extension values
32
 *
33
 * @param Env $env
34
 * @param array $extends
35
 * @return Env
36
 */
37
function env_extend(Env $env, array $extends)
38
{
39
    $myenv = clone $env;
40
    foreach ($extends as $key => $value) {
41
        $myenv->$key = $value;
42
    }
43
44
    return $myenv;
45
}
46
47
48
/**
49
 * Provides access to Sphpeme's std env
50
 *
51
 * @return Env
52
 */
53
function get_std_env(): Env
54
{
55
    return require __DIR__ . '/stdenv.php';
56
}
57