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.

sphpeme.php ➔ atom()   B
last analyzed

Complexity

Conditions 6
Paths 5

Size

Total Lines 22

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 11
CRAP Score 6

Importance

Changes 0
Metric Value
cc 6
nc 5
nop 1
dl 0
loc 22
ccs 11
cts 11
cp 1
crap 6
rs 8.9457
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 9
    if (is_numeric($val)) {
14 4
        return new Scalar(strpos($val, '.')
15 1
            ? (float)$val
16 4
            : (int)$val);
17
    }
18
19 6
    if (strpos($val, '"') === 0) {
20 2
        return new Scalar(str_replace('"', '', $val));
21
    }
22
23 5
    if ($val === '#t') {
24 1
        return new Scalar(true);
25
    }
26
27 5
    if ($val === '#f') {
28 1
        return new Scalar(false);
29
    }
30
31 4
    return Symbol::make($val);
32
}
33