Passed
Push — master ( b01812...3926c4 )
by Gabor
03:44
created

AbstractApplication   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 0
dl 0
loc 34
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getContainer() 0 4 1
run() 0 1 ?
1
<?php
2
/**
3
 * WebHemi.
4
 *
5
 * PHP version 5.6
6
 *
7
 * @copyright 2012 - 2016 Gixx-web (http://www.gixx-web.com)
8
 * @license   https://opensource.org/licenses/MIT The MIT License (MIT)
9
 *
10
 * @link      http://www.gixx-web.com
11
 */
12
namespace WebHemi\Application;
13
14
use WebHemi\Adapter\DependencyInjection\DependencyInjectionAdapterInterface;
15
16
/**
17
 * Class AbstractApplication.
18
 */
19
abstract class AbstractApplication implements ApplicationInterface
20
{
21
    /** @var DependencyInjectionAdapterInterface */
22
    private $container;
23
24
    /**
25
     * ApplicationInterface constructor.
26
     *
27
     * @param DependencyInjectionAdapterInterface $container
28
     */
29 5
    public function __construct(DependencyInjectionAdapterInterface $container)
30
    {
31 5
        $this->container = $container;
32 5
    }
33
34
    /**
35
     * Returns the DI Adapter instance.
36
     *
37
     * @return DependencyInjectionAdapterInterface
38
     */
39 5
    final public function getContainer()
40
    {
41 5
        return $this->container;
42
    }
43
44
   /**
45
     * Runs the application. This is where the magic happens.
46
     * For example for a web application this initializes the Request and Response objects, builds the middleware
47
     * pipeline, applies the Routing and the Dispatch.
48
     *
49
     * @return void
50
     */
51
    abstract public function run();
52
}
53