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.
Passed
Pull Request — master (#3)
by Matthew
01:43
created

Symbol::make()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 1
dl 0
loc 9
rs 9.6666
c 0
b 0
f 0
1
<?php
2
3
namespace Sphpeme;
4
5
6
class Symbol
7
{
8
    /** @var string */
9
    private $value;
10
11
    /** @var array */
12
    public static $table = [];
13
14
    public static function make($sym): self
15
    {
16
        if (isset(static::$table[$sym])) {
17
            return static::$table[$sym];
18
        }
19
20
        static::$table[$sym] = new static($sym);
21
22
        return static::$table[$sym];
23
    }
24
25
    private function __construct($value)
26
    {
27
        $this->value = $value;
28
    }
29
30
    public function __toString()
31
    {
32
        return $this->value;
33
    }
34
35
}