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
Push — master ( 636f6e...ab1dd8 )
by Drew
04:13
created

EnvLoader::parse()   A

Complexity

Conditions 5
Paths 4

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 9.2728
c 0
b 0
f 0
cc 5
nc 4
nop 0
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