Completed
Pull Request — master (#9)
by Viacheslav
39:48
created

Ref::getSchema()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
c 0
b 0
f 0
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace Swaggest\JsonSchema\Constraint;
4
5
class Ref implements Constraint
6
{
7
    public $ref;
8
    public function __construct($ref, $data = null)
9
    {
10
        $this->ref = $ref;
11
        $this->data = $data;
12
    }
13
14
    /** @var mixed */
15
    private $data;
16
17
    /** @var mixed */
18
    private $imported;
19
    /** @var boolean */
20
    private $isImported = false;
21
22
    /**
23
     * @return mixed
24
     */
25
    public function getImported()
26
    {
27
        return $this->imported;
28
    }
29
30
    /**
31
     * @param mixed $imported
32
     */
33
    public function setImported($imported)
34
    {
35
        $this->isImported = true;
36
        $this->imported = $imported;
37
    }
38
39
    /**
40
     * @return boolean
41
     */
42
    public function isImported()
43
    {
44
        return $this->isImported;
45
    }
46
47
    /**
48
     * @param mixed $data
49
     * @return Ref
50
     */
51
    public function setData($data)
52
    {
53
        $this->data = $data;
54
        return $this;
55
    }
56
57
    /**
58
     * @return mixed
59
     * @throws \Exception
60
     */
61
    public function getData()
62
    {
63
        return $this->data;
64
    }
65
}