CsrfConstraint   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 7
c 1
b 0
f 0
dl 0
loc 26
ccs 2
cts 2
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getDefaultOption() 0 3 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