Completed
Branch feature/pre-split (ca29cf)
by Anton
03:23
created

RelationDefinition::getOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 4
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * components
4
 *
5
 * @author    Wolfy-J
6
 */
7
namespace Spiral\ORM\Schemas\Definitions;
8
9
/**
10
 * Defines relation in schema.
11
 */
12
final class RelationDefinition
13
{
14
    /**
15
     * @var string
16
     */
17
    private $type;
18
19
    /**
20
     * @var string
21
     */
22
    private $target;
23
24
    /**
25
     * @var array
26
     */
27
    private $options = [];
28
29
    /**
30
     * @var bool
31
     */
32
    private $inverse = false;
33
34
    /**
35
     * @param string $type
36
     * @param string $target
37
     * @param array  $options
38
     * @param bool   $inverse
39
     */
40
    public function __construct(string $type, string $target, array $options, bool $inverse = false)
0 ignored issues
show
Unused Code introduced by
The parameter $inverse is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
41
    {
42
        $this->type = $type;
43
        $this->target = $target;
44
        $this->options = $options;
45
    }
46
47
    /**
48
     * @return string
49
     */
50
    public function getType(): string
51
    {
52
        return $this->type;
53
    }
54
55
    /**
56
     * @return string
57
     */
58
    public function getTarget(): string
59
    {
60
        return $this->target;
61
    }
62
63
    /**
64
     * @return array
65
     */
66
    public function getOptions(): array
67
    {
68
        return $this->options;
69
    }
70
71
    /**
72
     * @return bool
73
     */
74
    public function needInverse(): bool
75
    {
76
        return $this->inverse;
77
    }
78
}