Ref   A
last analyzed

Complexity

Total Complexity 7

Size/Duplication

Total Lines 65
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 7
eloc 16
dl 0
loc 65
c 0
b 0
f 0
ccs 21
cts 21
cp 1
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A unsetImported() 0 4 1
A __construct() 0 4 1
A setData() 0 4 1
A getData() 0 3 1
A getImported() 0 3 1
A isImported() 0 3 1
A setImported() 0 4 1
1
<?php
2
3
namespace Swaggest\JsonSchema\Constraint;
4
5
class Ref implements Constraint
6
{
7
    /** @var string */
8
    public $ref;
9 414
    public function __construct($ref, $data = null)
10
    {
11 414
        $this->ref = $ref;
12 414
        $this->data = $data;
13 414
    }
14
15
    /** @var mixed */
16
    private $data;
17
18
    /** @var mixed */
19
    private $imported;
20
    /** @var boolean */
21
    private $isImported = false;
22
23
    /**
24
     * @return mixed
25
     */
26 187
    public function getImported()
27
    {
28 187
        return $this->imported;
29
    }
30
31
    /**
32
     * @param mixed $imported
33
     */
34 412
    public function setImported($imported)
35
    {
36 412
        $this->isImported = true;
37 412
        $this->imported = $imported;
38 412
    }
39
40
    /**
41
     * @return boolean
42
     */
43 412
    public function isImported()
44
    {
45 412
        return $this->isImported;
46
    }
47
48 1
    public function unsetImported()
49
    {
50 1
        $this->isImported = false;
51 1
        $this->imported = null;
52 1
    }
53
54
    /**
55
     * @param mixed $data
56
     * @return Ref
57
     */
58 320
    public function setData($data)
59
    {
60 320
        $this->data = $data;
61 320
        return $this;
62
    }
63
64
    /**
65
     * @return mixed
66
     */
67 414
    public function getData()
68
    {
69 414
        return $this->data;
70
    }
71
}