XsltParam   A
last analyzed

Complexity

Total Complexity 8

Size/Duplication

Total Lines 83
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
eloc 12
dl 0
loc 83
ccs 0
cts 16
cp 0
rs 10
c 0
b 0
f 0
wmc 8

7 Methods

Rating   Name   Duplication   Size   Complexity  
A getName() 0 3 1
A getExpression() 0 7 2
A setListeningExpression() 0 3 1
A setName() 0 3 1
A setValue() 0 3 1
A setExpression() 0 3 1
A getValue() 0 3 1
1
<?php
2
3
/**
4
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
5
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
6
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
7
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
8
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
9
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
10
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
11
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
12
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
13
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
14
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15
 *
16
 * This software consists of voluntary contributions made by many individuals
17
 * and is licensed under the LGPL. For more information please see
18
 * <http://phing.info>.
19
 */
20
21
namespace Phing\Filter;
22
23
use Phing\Util\RegisterSlot;
24
25
/**
26
 * Class that holds an XSLT parameter.
27
 */
28
class XsltParam
29
{
30
    private $name;
31
32
    /**
33
     * @var RegisterSlot|string
34
     */
35
    private $expr;
36
37
    /**
38
     * Sets param name.
39
     *
40
     * @param string $name
41
     */
42
    public function setName($name)
43
    {
44
        $this->name = $name;
45
    }
46
47
    /**
48
     * Get param name.
49
     *
50
     * @return string
51
     */
52
    public function getName()
53
    {
54
        return $this->name;
55
    }
56
57
    /**
58
     * Sets expression value (alias to the setExpression()) method.
59
     *
60
     * @param string $v
61
     *
62
     * @see   setExpression()
63
     */
64
    public function setValue($v)
65
    {
66
        $this->setExpression($v);
67
    }
68
69
    /**
70
     * Gets expression value (alias to the getExpression()) method.
71
     *
72
     * @return string
73
     *
74
     * @see    getExpression()
75
     */
76
    public function getValue()
77
    {
78
        return $this->getExpression();
79
    }
80
81
    /**
82
     * Sets expression value.
83
     *
84
     * @param string $expr
85
     */
86
    public function setExpression($expr)
87
    {
88
        $this->expr = $expr;
89
    }
90
91
    /**
92
     * Sets expression to dynamic register slot.
93
     */
94
    public function setListeningExpression(RegisterSlot $expr)
95
    {
96
        $this->expr = $expr;
97
    }
98
99
    /**
100
     * Returns expression value -- performs lookup if expr is registerslot.
101
     *
102
     * @return string
103
     */
104
    public function getExpression()
105
    {
106
        if ($this->expr instanceof RegisterSlot) {
107
            return $this->expr->getValue();
108
        }
109
110
        return $this->expr;
111
    }
112
}
113