Completed
Push — master ( 63afd1...deb91d )
by Alexander
02:56
created

ReflectionType   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 55
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 4
c 1
b 0
f 1
lcom 0
cbo 0
dl 0
loc 55
ccs 11
cts 11
cp 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A allowsNull() 0 4 1
A isBuiltin() 0 4 1
A __toString() 0 4 1
1
<?php
2
/**
3
 * Parser Reflection API
4
 *
5
 * @copyright Copyright 2015, Lisachenko Alexander <[email protected]>
6
 *
7
 * This source file is subject to the license that is bundled
8
 * with this source code in the file LICENSE.
9
 */
10
11
namespace Go\ParserReflection;
12
13
use ReflectionType as BaseReflectionType;
14
15
/**
16
 * ReflectionType implementation
17
 */
18
class ReflectionType extends BaseReflectionType
19
{
20
    /**
21
     * If type allows null or not
22
     *
23
     * @var boolean
24
     */
25
    private $allowsNull;
26
27
    /**
28
     * Is type built-in or not
29
     *
30
     * @var
31
     */
32
    private $isBuiltin;
33
34
    /**
35
     * @var string Type name
36
     */
37
    private $type;
38
39
    /**
40
     * Initializes reflection data
41
     */
42 2
    public function __construct($type, $allowsNull, $isBuiltin)
43
    {
44 2
        $this->type       = $type;
45 2
        $this->allowsNull = $allowsNull;
46 2
        $this->isBuiltin  = $isBuiltin;
47 2
    }
48
49
    /**
50
     * @inheritDoc
51
     */
52 2
    public function allowsNull()
53
    {
54 2
        return $this->allowsNull;
55
    }
56
57
    /**
58
     * @inheritDoc
59
     */
60 2
    public function isBuiltin()
61
    {
62 2
        return $this->isBuiltin;
63
    }
64
65
    /**
66
     * @inheritDoc
67
     */
68 2
    public function __toString()
69
    {
70 2
        return $this->type;
71
    }
72
}
73