Completed
Push — master ( 50809e...8af631 )
by Tomáš
04:38 queued 02:05
created

MultiCsFileLoader::getMcsFileLocation()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
/*
4
 * This file is part of Symplify
5
 * Copyright (c) 2016 Tomas Votruba (http://tomasvotruba.cz).
6
 */
7
8
namespace Symplify\MultiCodingStandard\Configuration;
9
10
use Nette\Utils\Json;
11
use Symplify\MultiCodingStandard\Contract\Configuration\MultiCsFileLoaderInterface;
12
13
final class MultiCsFileLoader implements MultiCsFileLoaderInterface
14
{
15
    /**
16
     * @var string
17
     */
18
    private $multiCsJsonFile;
19
20
    /**
21
     * @param string $multiCsJsonFile
22
     */
23 5
    public function __construct($multiCsJsonFile)
24
    {
25 5
        $this->multiCsJsonFile = $multiCsJsonFile;
26 5
    }
27
28
    /**
29
     * {@inheritdoc}
30
     */
31 5
    public function load()
32
    {
33 5
        $fileContent = file_get_contents($this->multiCsJsonFile);
34 5
        return Json::decode($fileContent, true);
0 ignored issues
show
Documentation introduced by
true is of type boolean, but the function expects a integer.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
35
    }
36
}
37