Completed
Push — master ( 030796...0c67b5 )
by Asmir
30:13
created

ParamTag   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A setDefault() 0 4 1
B generate() 0 10 5
A generateForMethod() 0 6 4
1
<?php
2
/**
3
 * Zend Framework (http://framework.zend.com/)
4
 *
5
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
6
 * @copyright Copyright (c) 2005-2016 Zend Technologies USA Inc. (http://www.zend.com)
7
 * @license   http://framework.zend.com/license/new-bsd New BSD License
8
 */
9
10
namespace GoetasWebservices\SoapServices\SoapClient\StubGeneration\Tag;
11
12
use Zend\Code\Generator\DocBlock\Tag\ParamTag as ParamTagTag;
13
14
class ParamTag extends ParamTagTag
15
{
16
    protected $default;
17
18
    public function setDefault($default)
19
    {
20
        $this->default = $default;
21
    }
22
23
    /**
24
     * @return string
25
     */
26
    public function generate()
27
    {
28
        $output = '@param'
29
            . ((!empty($this->types)) ? ' ' . $this->getTypesAsString() : '')
30
            . ((!empty($this->variableName)) ? ' $' . $this->variableName : '')
31
            . ((!empty($this->default)) ? ' = ' . $this->default : '')
32
            . ((!empty($this->description)) ? ' ' . $this->description : '');
33
34
        return $output;
35
    }
36
37
    public function generateForMethod()
38
    {
39
        return ((!empty($this->types)) ? $this->getTypesAsString() : '')
40
        . ((!empty($this->variableName)) ? ' $' . $this->variableName : '')
41
        . ((!empty($this->default)) ? ' = ' . $this->default : '');
42
    }
43
}
44