Test Failed
Pull Request — master (#19)
by Flo
04:39
created

Text   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
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 3
1
<?php
2
/**
3
 * Class Text | Text.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 Text
13
 */
14
class Text extends AbstractValidator
15
{
16
17
    /**
18
     * The error message as key for translation
19
     * @var string
20
     */
21
    protected $errorMessage = 'validator_invalid_text';
22
23
    /**
24
     * Validate type string
25
     * @param $data
26
     * @return boolean
27
     */
28
    public function process($data)
29
    {
30
        return !empty($data) && is_string($data) && !is_numeric($data);
31
    }
32
33
}