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

AbstractApplication::prepareContainer()   A

Complexity

Conditions 2
Paths 3

Size

Total Lines 63
Code Lines 42

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
dl 0
loc 63
ccs 0
cts 0
cp 0
rs 9.4347
c 0
b 0
f 0
cc 2
eloc 42
nc 3
nop 0
crap 6

1 Method

Rating   Name   Duplication   Size   Complexity  
AbstractApplication::run() 0 1 ?

How to fix   Long Method   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

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