Passed
Push — master ( 3a35da...a738f6 )
by Nikolaos
02:35
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

Importance

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