Completed
Pull Request — erdiko2 (#29)
by
unknown
01:47
created

App::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 8
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 5
nc 2
nop 1
1
<?php
2
/**
3
 * Erdiko App
4
 *
5
 * Extension of the Slim App
6
 *
7
 * @package     erdiko\core
8
 * @copyright   2012-2017 Arroyo Labs, Inc. http://www.arroyolabs.com
9
 * @author      John Arroyo <[email protected]>
10
 */
11
namespace erdiko;
12
13
14
class App extends \Slim\App
15
{
16
    /**
17
     * Create new application
18
     * 
19
     * Load context settings if nothing specified in the constructor
20
     *
21
     * @param ContainerInterface|array $container Either a ContainerInterface or an associative array of app settings
22
     * @throws InvalidArgumentException when no container is provided that implements ContainerInterface
23
     */
24
    public function __construct($container = null)
25
    {
26
        if($container == null) {
27
            $container = require ERDIKO_ROOT."/contexts/".
28
                getenv('ERDIKO_CONTEXT')."/bootstrap/settings.php";
29
        }
30
        parent::__construct($container);
31
    }
32
}