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.

Root::path()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
/*
3
 * This file is part of the php-vfs package.
4
 *
5
 * (c) Michael Donat <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace VirtualFileSystem\Structure;
12
13
/**
14
 * FileSystem Root representation.
15
 *
16
 * Specialised Directory that does not allow for basename or parent setting.
17
 *
18
 * @author Michael Donat <[email protected]>
19
 * @package php-vfs
20
 */
21
class Root extends Directory
22
{
23
    const BASENAME = '/';
24
    protected $scheme;
25
26
    /**
27
     * Class constructor.
28
     */
29
    public function __construct()
30
    {
31
        $this->basename = self::BASENAME;
32
        $this->chmod(static::DEF_MODE);
33
    }
34
35
    /**
36
     * Defined to prevent setting parent on Root.
37
     *
38
     * @param Directory $parent
39
     *
40
     * @throws \LogicException
41
     */
42
    protected function setParent(Directory $parent)
43
    {
44
        throw new \LogicException('Root cannot have a parent.');
45
    }
46
47
    /**
48
     * Set root scheme for use in path method.
49
     *
50
     * @param string $scheme
51
     */
52
    public function setScheme($scheme)
53
    {
54
        list($scheme) = explode(':', $scheme);
55
        $this->scheme = $scheme.'://';
56
    }
57
58
    /**
59
     * Returns URL to file.
60
     *
61
     * @return string
62
     */
63
    public function path()
64
    {
65
        return '/';
66
    }
67
68
    public function url()
69
    {
70
        if (!$this->scheme) {
71
            throw new \RuntimeException('No scheme set');
72
        }
73
74
        return $this->scheme;
75
    }
76
}
77