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.

Symbol::make()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 2

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 0
loc 10
ccs 5
cts 5
cp 1
crap 2
rs 9.9332
c 0
b 0
f 0
1
<?php
2
3
namespace Sphpeme;
4
5
6
class Symbol
0 ignored issues
show
Coding Style introduced by
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
7
{
8
    /** @var string */
9
    private $value;
10
11
    /** @var array */
12
    public static $table = [];
13
14 25
    public static function make($sym): self
15
    {
16 25
        if (isset(static::$table[$sym])) {
17 23
            return static::$table[$sym];
18
        }
19
20 11
        static::$table[$sym] = new static($sym);
21
22 11
        return static::$table[$sym];
23
    }
24
25 11
    private function __construct($value)
26
    {
27 11
        $this->value = $value;
28 11
    }
29
30 3
    public function __toString()
31
    {
32 3
        return $this->value;
33
    }
34
35
}