DeploymentWrapper   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 42
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 42
c 0
b 0
f 0
wmc 3
lcom 1
cbo 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A injectDeployment() 0 4 1
A getDeployment() 0 4 1
A deploy() 0 4 1
1
<?php
2
3
/**
4
 * \AppserverIo\Psr\Deployment\DeploymentWrapper
5
 *
6
 * NOTICE OF LICENSE
7
 *
8
 * This source file is subject to the Open Software License (OSL 3.0)
9
 * that is available through the world-wide-web at this URL:
10
 * http://opensource.org/licenses/osl-3.0.php
11
 *
12
 * PHP version 5
13
 *
14
 * @author    Tim Wagner <[email protected]>
15
 * @copyright 2015 TechDivision GmbH <[email protected]>
16
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
17
 * @link      https://github.com/appserver-io-psr/deployment
18
 * @link      http://www.appserver.io
19
 */
20
21
namespace AppserverIo\Psr\Deployment;
22
23
/**
24
 * Wrapper implementation for the deployment interface.
25
 *
26
 * @author    Tim Wagner <[email protected]>
27
 * @copyright 2015 TechDivision GmbH <[email protected]>
28
 * @license   http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
29
 * @link      https://github.com/appserver-io-psr/deployment
30
 * @link      http://www.appserver.io
31
 */
32
class DeploymentWrapper implements DeploymentInterface
33
{
34
35
    /**
36
     * The deployment instance we want to wrap.
37
     *
38
     * @var \AppserverIo\Psr\Deployment\DeploymentInterface
39
     */
40
    protected $deployment;
41
42
    /**
43
     * Injects the deployment instance we want to wrap.
44
     *
45
     * @param \AppserverIo\Psr\Deployment\DeploymentInterface $deployment The deployment instance to be wrapped
46
     *
47
     * @return void
48
     */
49
    public function injectDeployment(DeploymentInterface $deployment)
50
    {
51
        $this->deployment = $deployment;
52
    }
53
54
    /**
55
     * Returns the wrapped deployment instance.
56
     *
57
     * @return \AppserverIo\Psr\Deployment\DeploymentInterface The wrapped deployment instance
58
     */
59
    public function getDeployment()
60
    {
61
        return $this->deployment;
62
    }
63
64
    /**
65
     * Initializes the available applications and adds them to the container.
66
     *
67
     * @return void
68
     */
69
    public function deploy()
70
    {
71
        $this->getDeployment()->deploy();
72
    }
73
}
74