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

App   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 19
rs 10
c 0
b 0
f 0

1 Method

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