Test Failed
Pull Request — master (#19)
by Flo
03:56
created

Number   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 1
dl 0
loc 20
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A process() 0 4 2
1
<?php
2
/**
3
 * Class Number | Number.php
4
 * @package Faulancer\Form\Validator\Base
5
 * @author Florian Knapp <[email protected]>
6
 */
7
namespace Faulancer\Form\Validator\Base;
8
9
use Faulancer\Form\Validator\AbstractValidator;
10
11
/**
12
 * Class Number
13
 */
14
class Number extends AbstractValidator
15
{
16
17
    /**
18
     * The error message as key for translation
19
     * @var string
20
     */
21
    protected $errorMessage = 'validator_invalid_number';
22
23
    /**
24
     * Validate type number
25
     * @param string $data
26
     * @return boolean
27
     */
28
    public function process($data)
29
    {
30
        return is_int($data) || is_float($data);
31
    }
32
33
}