JsonRouteProvider   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 12
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 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