Ref::setImported()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 1
crap 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
}