ValidationOptions   A
last analyzed

Complexity

Total Complexity 6

Size/Duplication

Total Lines 45
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 6
lcom 1
cbo 0
dl 0
loc 45
ccs 16
cts 16
cp 1
rs 10
c 0
b 0
f 0

6 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A setValidationGroups() 0 5 1
A setViolationPathMap() 0 5 1
A getValidationGroups() 0 4 1
A isEnabled() 0 4 1
A getViolationPathMap() 0 4 1
1
<?php
2
declare(strict_types=1);
3
4
namespace Maba\Bundle\RestBundle\Entity;
5
6
use Symfony\Component\Validator\Constraint;
7
8
class ValidationOptions
9
{
10
    /**
11
     * @var array of string
12
     */
13
    private $validationGroups;
14
15
    /**
16
     * @var array of string, associative
17
     */
18
    private $violationPathMap;
19
20 89
    public function __construct()
21
    {
22 89
        $this->validationGroups = [Constraint::DEFAULT_GROUP];
23 89
        $this->violationPathMap = [];
24 89
    }
25
26 81
    public function setValidationGroups(array $validationGroups): self
27
    {
28 81
        $this->validationGroups = $validationGroups;
29 81
        return $this;
30
    }
31
32 81
    public function setViolationPathMap(array $violationPathMap): self
33
    {
34 81
        $this->violationPathMap = $violationPathMap;
35 81
        return $this;
36
    }
37
38 29
    public function getValidationGroups(): array
39
    {
40 29
        return $this->validationGroups;
41
    }
42
43 81
    public function isEnabled(): bool
44
    {
45 81
        return count($this->validationGroups) > 0;
46
    }
47
48 19
    public function getViolationPathMap(): array
49
    {
50 19
        return $this->violationPathMap;
51
    }
52
}
53