CsrfConstraint::getDefaultOption()   A
last analyzed

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
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Bdf\Form\Csrf;
4
5
use Symfony\Component\Security\Csrf\CsrfTokenManagerInterface;
6
use Symfony\Component\Validator\Constraint;
7
8
/**
9
 * @internal
10
 */
11
class CsrfConstraint extends Constraint
12
{
13
    const INVALID_TOKEN_ERROR = 'cd108896-d12a-4455-a6cc-ba13708c8e7f';
14
15
    protected static $errorNames = [
16
        self::INVALID_TOKEN_ERROR => 'INVALID_TOKEN_ERROR',
17
    ];
18
19
    /**
20
     * The constraint message
21
     *
22
     * @var string
23
     */
24
    public $message = 'The CSRF token is invalid.';
25
26
    /**
27
     * @var CsrfTokenManagerInterface
28
     */
29
    public $manager;
30
31
    /**
32
     * {@inheritdoc}
33
     */
34 12
    public function getDefaultOption()
35
    {
36 12
        return 'manager';
37
    }
38
}
39