1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/** |
4
|
|
|
* \AppserverIo\Psr\Deployment\DescriptorWrapper |
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 descriptor 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 DescriptorWrapper implements DescriptorInterface |
33
|
|
|
{ |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* The descriptor instance we want to wrap. |
37
|
|
|
* |
38
|
|
|
* @var \AppserverIo\Psr\Deployment\DescriptorInterface |
39
|
|
|
*/ |
40
|
|
|
protected $descriptor; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* Injects the descriptor instance we want to wrap. |
44
|
|
|
* |
45
|
|
|
* @param \AppserverIo\Psr\Deployment\DescriptorInterface $descriptor The descriptor instance to be wrapped |
46
|
|
|
* |
47
|
|
|
* @return void |
48
|
|
|
*/ |
49
|
|
|
public function injectDescriptor(DescriptorInterface $descriptor) |
50
|
|
|
{ |
51
|
|
|
$this->descriptor = $descriptor; |
52
|
|
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Returns the wrapped descriptor instance. |
56
|
|
|
* |
57
|
|
|
* @return \AppserverIo\Psr\Deployment\DeploymentInterface The wrapped descriptor instance |
58
|
|
|
*/ |
59
|
|
|
public function getDescriptor() |
60
|
|
|
{ |
61
|
|
|
return $this->descriptor; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Returns the reference description. |
66
|
|
|
* |
67
|
|
|
* @return string The reference description |
68
|
|
|
*/ |
69
|
|
|
public function getDescription() |
70
|
|
|
{ |
71
|
|
|
return $this->getDescriptor()->getDescription(); |
72
|
|
|
} |
73
|
|
|
} |
74
|
|
|
|