Csrf   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 3
dl 0
loc 23
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 4 1
1
<?php
2
3
namespace Faulancer\Form\Validator\Base;
4
5
use Faulancer\Exception\ServiceNotFoundException;
6
use Faulancer\Form\Validator\AbstractValidator;
7
8
/**
9
 * Class Csrf
10
 *
11
 * @package Faulancer\Form\Validator\Base
12
 * @author Florian Knapp <[email protected]>
13
 */
14
class Csrf extends AbstractValidator
15
{
16
17
    /**
18
     * The error message as key for translation
19
     * @var string
20
     */
21
    protected $errorMessage = 'validator_invalid_token';
22
23
    /**
24
     * Validate email with filter_var
25
     *
26
     * @param string $data
27
     * @return bool
28
     *
29
     * @throws ServiceNotFoundException
30
     */
31
    public function process($data)
32
    {
33
        return \Faulancer\Security\Csrf::isValid($data, $this->getField()->getFormIdentifier());
34
    }
35
36
}