Passed
Push — master ( 4959cd...65a92c )
by Marcel
17:47
created

CsrfToken   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 2
1
<?php
2
3
namespace App\Validator;
4
5
use Attribute;
6
use Symfony\Component\Validator\Constraint;
7
8
#[Attribute]
9
class CsrfToken extends Constraint {
10
    public string $id;
11
12
    public string $message = 'The CSRF token is invalid.';
13
14
    public function __construct(mixed $options = null, array $groups = null, mixed $payload = null, ?string $id = null) {
15
        parent::__construct($options, $groups, $payload);
16
17
        if($id !== null) {
18
            $this->id = $id;
19
        }
20
    }
21
}