Completed
Push — master ( d75c1f...eed677 )
by Viacheslav
12s
created

PhpDocType   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 69.23%

Importance

Changes 0
Metric Value
dl 0
loc 38
ccs 9
cts 13
cp 0.6923
rs 10
c 0
b 0
f 0
wmc 6

6 Methods

Rating   Name   Duplication   Size   Complexity  
A staticType() 0 3 1
A __construct() 0 3 1
A selfType() 0 3 1
A renderArgumentType() 0 3 1
A thisType() 0 3 1
A renderPhpDocType() 0 3 1
1
<?php
2
3
namespace Swaggest\PhpCodeBuilder;
4
5
6
class PhpDocType implements PhpAnyType
7
{
8
    private $type;
9
10
    /**
11
     * @return string
12
     */
13
    public function renderArgumentType()
14
    {
15
        return '';
16
    }
17
18
    /**
19
     * @return string
20
     */
21 4
    public function renderPhpDocType()
22
    {
23 4
        return $this->type;
24
    }
25
26 4
    private function __construct($type)
27
    {
28 4
        $this->type = $type;
29 4
    }
30
31 1
    public static function staticType()
32
    {
33 1
        return new self('static');
34
    }
35
36
    public static function selfType()
37
    {
38
        return new self('self');
39
    }
40
41 4
    public static function thisType()
42
    {
43 4
        return new self('$this');
44
    }
45
46
}