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

CsrfToken::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 3
c 0
b 0
f 0
nc 2
nop 4
dl 0
loc 5
rs 10
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
}