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.

EnvLoader   A
last analyzed

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A parse() 0 21 5
1
<?php
2
namespace Dbtlr\PHPEnvBuilder;
3
4
use Dotenv\Exception\InvalidPathException;
5
use Dotenv\Loader;
6
7
class EnvLoader extends Loader
8
{
9
    /**
10
     * Load the environment if we need to or can.
11
     *
12
     * @return array
13
     */
14 4
    public function parse()
15
    {
16
        try {
17 4
            $this->ensureFileIsReadable();
18 2
        } catch (InvalidPathException $e) {
19 2
            return [];
20
        }
21
22 2
        $filePath = $this->filePath;
23 2
        $lines = $this->readLinesFromFile($filePath);
24
25 2
        $data = [];
26 2
        foreach ($lines as $line) {
27 2
            if (!$this->isComment($line) && $this->looksLikeSetter($line)) {
28 2
                list($name, $value) = $this->processFilters($line, null);
29 2
                $data[$name] = $value;
30
            }
31
        }
32
33 2
        return $data;
34
    }
35
}
36