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.

GlobIteratorFileInfo   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 0
dl 0
loc 33
rs 10
c 0
b 0
f 0
ccs 16
cts 16
cp 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getIteratorId() 0 4 1
A setIteratorId() 0 4 1
A setPath() 0 4 1
A processFilename() 0 6 1
1
<?php
2
3
namespace Gielfeldt\Iterators;
4
5
class GlobIteratorFileInfo extends \SplFileInfo
6
{
7
    private static $iteratorId;
8
    private static $paths = [];
9
10 5
    public function __construct($fileName)
11
    {
12 5
        $fileName = $this->processFilename($fileName);
13 5
        parent::__construct($fileName);
14 5
    }
15
16 5
    public function getIteratorId()
17
    {
18 5
        return self::$iteratorId;
19
    }
20
21 5
    public static function setIteratorId($iteratorId)
22
    {
23 5
        self::$iteratorId = $iteratorId;
24 5
    }
25
26 6
    public static function setPath($iteratorId, $path, $realPath)
27
    {
28 6
        self::$paths[$iteratorId] = [$path, $realPath];
29 6
    }
30
31 5
    protected function processFilename($fileName)
32
    {
33 5
        $iteratorId = self::getIteratorId();
34 5
        $pathName = self::$paths[$iteratorId][0] . substr($fileName, strlen(self::$paths[$iteratorId][1]));
35 5
        return $pathName;
36
    }
37
}
38