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   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 56
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 1
dl 0
loc 56
ccs 0
cts 25
cp 0
rs 10
c 0
b 0
f 0

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setParent() 0 4 1
A setScheme() 0 5 1
A path() 0 4 1
A url() 0 8 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