ExistingAggregateRoot::getDefaultOption()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
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