Passed
Push — master ( 26d549...0e9514 )
by Alain
02:38
created

Loader::load()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
c 1
b 0
f 1
dl 0
loc 6
ccs 3
cts 3
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Bright Nucleus Config Component.
4
 *
5
 * @package   BrightNucleus\Config
6
 * @author    Alain Schlesser <[email protected]>
7
 * @license   MIT
8
 * @link      http://www.brightnucleus.com/
9
 * @copyright 2016 Alain Schlesser, Bright Nucleus
10
 */
11
12
namespace BrightNucleus\Config;
13
14
use BrightNucleus\Config\Exception\FailedToLoadConfigException;
15
use BrightNucleus\Config\Loader\LoaderFactory;
16
17
/**
18
 * Class Loader.
19
 *
20
 * @since   0.4.0
21
 *
22
 * @package BrightNucleus\Config
23
 * @author  Alain Schlesser <[email protected]>
24
 */
25
class Loader
26
{
27
28
    /**
29
     * Static convenience function to load a configuration from an URI.
30
     *
31
     * @since 0.4.0
32
     *
33
     * @param string $uri URI of the resource to load.
34
     *
35
     * @return array|null Parsed data loaded from the resource.
36
     * @throws FailedToLoadConfigException If the configuration could not be loaded.
37
     */
38 1
    public static function load($uri)
39
    {
40 1
        $loader = LoaderFactory::createFromUri($uri);
41
42 1
        return $loader->load($uri);
43
    }
44
}
45