Passed
Push — master ( 52ecf5...abf332 )
by Nikolaos
02:34
created

Json::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1.0046

Importance

Changes 0
Metric Value
eloc 4
dl 0
loc 6
ccs 5
cts 6
cp 0.8333
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
crap 1.0046
1
<?php
2
3
/**
4
 * This file is part of the Phalcon Framework.
5
 *
6
 * (c) Phalcon Team <[email protected]>
7
 *
8
 * For the full copyright and license information, please view the LICENSE.txt
9
 * file that was distributed with this source code.
10
 */
11
12
declare(strict_types=1);
13
14
namespace Phalcon\Config\Adapter;
15
16
use Phalcon\Config;
17
use Phalcon\Helper\Json as JsonHelper;
18
19
use function file_get_contents;
20
21
class Json extends Config
22
{
23
    /**
24
     * Json constructor.
25
     *
26
     * @param string $filePath
27
     */
28 28
    public function __construct(string $filePath)
29
    {
30 28
        parent::__construct(
31 28
            JsonHelper::decode(
32 28
                file_get_contents($filePath),
33 28
                true
34
            )
35
        );
36 28
    }
37
}
38