Completed
Pull Request — master (#9)
by Viacheslav
13:47
created

Ref   A

Complexity

Total Complexity 6

Size/Duplication

Total Lines 61
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 61
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getImported() 0 4 1
A setImported() 0 5 1
A isImported() 0 4 1
A setData() 0 5 1
A getData() 0 4 1
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
}