MethodRowParameter   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A __toString() 0 8 2
1
<?php
2
3
namespace Saxulum\PhpDocGenerator;
4
5
class MethodRowParameter
6
{
7
    /**
8
     * @var string
9
     */
10
    protected $var;
11
12
    /**
13
     * @var string|null
14
     */
15
    protected $type;
16
17
    /**
18
     * @param string      $var
19
     * @param string|null $type
20
     */
21
    public function __construct($var, $type = null)
22
    {
23
        $this->var = $var;
24
        $this->type = $type;
25
    }
26
27
    /**
28
     * @return string
29
     */
30
    public function __toString()
31
    {
32
        if (null !== $this->type) {
33
            return $this->type.' $'.$this->var;
34
        }
35
36
        return '$'.$this->var;
37
    }
38
}
39