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

Number::process()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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