Completed
Push — master ( dd5309...9fb870 )
by Siad
20:07
created

Description   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 16
ccs 5
cts 5
cp 1
rs 10
c 0
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A addText() 0 7 2
1
<?php
2
/**
3
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
4
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
5
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
6
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
7
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
8
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
9
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
10
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
11
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
12
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
13
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
14
 *
15
 * This software consists of voluntary contributions made by many individuals
16
 * and is licensed under the LGPL. For more information please see
17
 * <http://phing.info>.
18
 */
19
20
/**
21
 * Description is used to provide a project-wide description element
22
 * (that is, a description that applies to a buildfile as a whole).
23
 * If present, the &lt;description&gt; element is printed out before the
24
 * target descriptions.
25
 *
26
 * Description has no attributes, only text.  There can only be one
27
 * project description per project.  A second description element will
28
 * overwrite the first.
29
 *
30
 * @author  Hans Lellelid <[email protected]> (Phing)
31
 * @author  Craeg Strong <[email protected]> (Ant)
32
 * @package phing.types
33
 */
34
class Description extends DataType
35
{
36
37
    /**
38
     * Adds descriptive text to the project.
39
     *
40
     * @param  $text
41
     * @return void
42
     */
43 2
    public function addText($text)
44
    {
45 2
        $currentDescription = $this->project->getDescription();
46 2
        if ($currentDescription === null) {
47 1
            $this->project->setDescription($text);
48
        } else {
49 1
            $this->project->setDescription($currentDescription . $text);
50
        }
51 2
    }
52
}
53