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.

Storage::getPath()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 7

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 7
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 2
eloc 7
c 1
b 0
f 0
nc 2
nop 0
dl 0
loc 10
ccs 7
cts 7
cp 1
crap 2
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
6
namespace Enjoys\Dotenv;
7
8
9
final class Storage implements StorageInterface
10
{
11
    /**
12
     * @var string[]
13
     */
14
    private array $loadedPaths = [];
15
    /**
16
     * @var string[]
17
     */
18
    private array $paths = [];
19
20 44
    #[\Override]
21
    public function getPath(): string|false
22
    {
23 44
        $key = key($this->paths);
24 44
        if ($key === null) {
25 42
            return false;
26
        }
27 44
        $result = $this->paths[$key];
28 44
        unset($this->paths[$key]);
29 44
        return $result;
30
    }
31
32 44
    #[\Override]
33
    public function isLoaded(string $path): bool
34
    {
35 44
        return in_array($path, $this->loadedPaths, true);
36
    }
37
38 42
    #[\Override]
39
    public function markLoaded(string $path): void
40
    {
41 42
        $this->loadedPaths[] = $path;
42
    }
43
44 44
    #[\Override]
45
    public function addPath(string $path): void
46
    {
47 44
        $path = realpath($path);
48 44
        if ($path !== false) {
49 44
            $this->paths[] = $path;
50
        }
51
    }
52
53
    /**
54
     * @return string[]
55
     */
56 2
    #[\Override]
57
    public function getLoadedPaths(): array
58
    {
59 2
        return $this->loadedPaths;
60
    }
61
}
62