Passed
Pull Request — master (#149)
by Pierre
03:06
created

Dictionary::getRequiredOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 1
rs 10
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Knp\DictionaryBundle\Validator\Constraints;
6
7
use Symfony\Component\Validator\Constraint;
8
9
/**
10
 * @Annotation
11
 * @Target({"PROPERTY", "METHOD"})
12
 */
13
final class Dictionary extends Constraint
14
{
15
    /**
16
     * @var string
17
     */
18
    public $name;
19
20
    /**
21
     * @var string
22
     */
23
    public $message = "The key {{ key }} doesn't exist in the given dictionary. {{ keys }} available.";
24
25 1
    public function validatedBy()
26
    {
27 1
        return DictionaryValidator::class;
28
    }
29
30
    /**
31
     * @return string[]
32
     */
33 5
    public function getRequiredOptions()
34
    {
35 5
        return ['name'];
36
    }
37
}
38