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

parse()   B

Complexity

Conditions 5
Paths 5

Size

Total Lines 21
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 5
eloc 16
nc 5
nop 1
dl 0
loc 21
rs 8.7624
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A get_std_env() 0 3 1
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