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.
Completed
Branch master (ab1dd8)
by Drew
02:12 queued 34s
created

EnvLoader   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
wmc 5
lcom 1
cbo 1
dl 0
loc 29
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
    public function parse()
15
    {
16
        try {
17
            $this->ensureFileIsReadable();
18
        } catch (InvalidPathException $e) {
19
            return [];
20
        }
21
22
        $filePath = $this->filePath;
23
        $lines = $this->readLinesFromFile($filePath);
24
25
        $data = [];
26
        foreach ($lines as $line) {
27
            if (!$this->isComment($line) && $this->looksLikeSetter($line)) {
28
                list($name, $value) = $this->processFilters($line, null);
29
                $data[$name] = $value;
30
            }
31
        }
32
33
        return $data;
34
    }
35
}
36