Completed
Push — master ( 575d8d...afd64c )
by Steevan
04:50
created

UniqueObject   A

Complexity

Total Complexity 7

Size/Duplication

Total Lines 75
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 1
Metric Value
wmc 7
c 1
b 0
f 1
lcom 0
cbo 1
dl 0
loc 75
rs 10

7 Methods

Rating   Name   Duplication   Size   Complexity  
A validatedBy() 0 4 1
A getRequiredOptions() 0 4 1
A getMessage() 0 4 1
A getProperties() 0 4 1
A getGetters() 0 4 1
A getStrict() 0 4 1
A getUniqid() 0 4 1
1
<?php
2
3
namespace steevanb\SymfonyValidatorConstraints\Constraints;
4
5
use Symfony\Component\Validator\Constraint;
6
7
class UniqueObject extends Constraint
8
{
9
    const TYPE_OUT_RANGE = 'OUT_RANGE';
10
11
    /** @var string */
12
    protected $message = 'Non-unique object found.';
13
14
    /** @var array */
15
    protected $properties = [];
16
17
    /** @var array */
18
    protected $getters = [];
19
20
    /** @var bool */
21
    protected $strict = true;
22
23
    /** @var string */
24
    protected $uniqid;
25
26
    /**
27
     * @return string
28
     */
29
    public function validatedBy()
30
    {
31
        return 'steevanb\\SymfonyValidatorConstraints\\Constraints\\UniqueObjectValidator';
32
    }
33
34
    /**
35
     * @return array
36
     */
37
    public function getRequiredOptions()
38
    {
39
        return ['uniqid'];
40
    }
41
42
    /**
43
     * @return string
44
     */
45
    public function getMessage()
46
    {
47
        return $this->message;
48
    }
49
50
    /**
51
     * @return array
52
     */
53
    public function getProperties()
54
    {
55
        return $this->properties;
56
    }
57
58
    /**
59
     * @return array
60
     */
61
    public function getGetters()
62
    {
63
        return $this->getters;
64
    }
65
66
    /**
67
     * @return bool
68
     */
69
    public function getStrict()
70
    {
71
        return $this->strict;
72
    }
73
74
    /**
75
     * @return string
76
     */
77
    public function getUniqid()
78
    {
79
        return $this->uniqid;
80
    }
81
}
82