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.

Loader::load()   A
last analyzed

Complexity

Conditions 4
Paths 3

Size

Total Lines 17
Code Lines 10

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 10
CRAP Score 4

Importance

Changes 0
Metric Value
dl 0
loc 17
ccs 10
cts 10
cp 1
rs 9.2
c 0
b 0
f 0
cc 4
eloc 10
nc 3
nop 0
crap 4
1
<?php
2
/**
3
 * Laravel-Env-Sync
4
 *
5
 * @author Julien Tant - Craftyx <[email protected]>
6
 */
7
8
namespace Jtant\LaravelEnvSync\Reader\File;
9
10
use Dotenv\Loader as OriginalLoader;
11
12
class Loader extends OriginalLoader
13
{
14
    /**
15
     * Load `.env` file in given directory.
16
     *
17
     * @return array
18
     */
19 8
    public function load()
20
    {
21 8
        $this->ensureFileIsReadable();
22
23 8
        $filePath = $this->filePath;
24 8
        $lines = $this->readLinesFromFile($filePath);
25
26 8
        $finalLines = [];
27 8
        foreach ($lines as $line) {
28 8
            if (!$this->isComment($line) && $this->looksLikeSetter($line)) {
29 8
                list($name, $value) = $this->normaliseEnvironmentVariable($line, null);
30 8
                $finalLines[$name] = $value;
31
            }
32
        }
33
34 8
        return $finalLines;
35
    }
36
}
37