ExistingAggregateRoot   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 32
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

3 Methods

Rating   Name   Duplication   Size   Complexity  
A validatedBy() 0 4 1
A __construct() 0 4 1
A getDefaultOption() 0 4 1
1
<?php
2
3
declare (strict_types = 1);
4
5
namespace HMLB\DDDBundle\Validator\Constraint;
6
7
use Symfony\Component\Validator\Constraint;
8
9
/**
10
 * ExistingAggregateRoot.
11
 *
12
 * @author Hugues Maignol <[email protected]>
13
 */
14
class ExistingAggregateRoot extends Constraint
15
{
16
    /**
17
     * @var string
18
     */
19
    public $class;
20
21
    public $message = 'Object not found.';
22
23
    public $nullMessage = 'This cannot be empty.';
24
25
    public function validatedBy()
26
    {
27
        return 'hmlb_ddd.existing_aggregate_root';
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function __construct($options = null)
34
    {
35
        parent::__construct($options);
36
    }
37
38
    /**
39
     * {@inheritdoc}
40
     */
41
    public function getDefaultOption()
42
    {
43
        return 'class';
44
    }
45
}
46