Passed
Push — master ( 0756fe...706dc7 )
by Arthur
14:47
created

Types::validatedBy()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
4
namespace Larapie\DataTransferObject\Constraints;
5
6
use Larapie\DataTransferObject\Validator\TypesValidator;
7
use Symfony\Component\Validator\Constraint;
8
9
/**
10
 * @Annotation
11
 * @Target({"PROPERTY", "METHOD", "ANNOTATION"})
12
 */
13
class Types extends Constraint
14
{
15
    public $message = 'This value should be of type {{ type }}.';
16
    public $types;
17
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public function getDefaultOption()
22
    {
23
        return 'types';
24
    }
25
26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function getRequiredOptions()
30
    {
31
        return ['types'];
32
    }
33
34
    public function validatedBy()
35
    {
36
        return TypesValidator::class;
37
    }
38
}