JsonRouteProvider::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
1
<?php
2
3
namespace MatthiasMullie\Api\Routes\Providers;
4
5
/**
6
 * @author Matthias Mullie <[email protected]>
7
 * @copyright Copyright (c) 2016, Matthias Mullie. All rights reserved
8
 * @license LICENSE MIT
9
 */
10
class JsonRouteProvider extends ArrayRouteProvider implements RouteProviderInterface
11
{
12
    /**
13
     * @param string $path Path to route data
14
     */
15
    public function __construct(string $path)
16
    {
17
        $contents = file_get_contents($path);
18
        $data = json_decode($contents, true);
19
        parent::__construct($data);
20
    }
21
}
22