Number   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 22
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 22
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\Form\Validator\AbstractValidator;
6
7
/**
8
 * Class Number
9
 *
10
 * @package Faulancer\Form\Validator\Base
11
 * @author Florian Knapp <[email protected]>
12
 */
13
class Number extends AbstractValidator
14
{
15
16
    /**
17
     * The error message as key for translation
18
     * @var string
19
     */
20
    protected $errorMessage = 'validator_invalid_number';
21
22
    /**
23
     * Validate type number
24
     *
25
     * @param string $data
26
     *
27
     * @return bool
28
     */
29
    public function process($data)
30
    {
31
        return !!preg_match('/([0-9\/-_.]+)/', $data);
32
    }
33
34
}