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

AbstractApplication::run()

Size

Total Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 1
ccs 0
cts 0
cp 0
c 0
b 0
f 0
nc 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