PhpDocType   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Test Coverage

Coverage 69.23%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 8
dl 0
loc 38
ccs 9
cts 13
cp 0.6923
rs 10
c 1
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 11
    public function renderPhpDocType()
22
    {
23 11
        return $this->type;
24
    }
25
26 6
    private function __construct($type)
27
    {
28 6
        $this->type = $type;
29 6
    }
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 5
    public static function thisType()
42
    {
43 5
        return new self('$this');
44
    }
45
46
}