Completed
Branch master (d39ff3)
by Pierre-Henry
32:32
created

HexColor::isValid()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
eloc 2
c 0
b 0
f 0
nc 2
nop 1
dl 0
loc 4
rs 10
1
<?php
2
/**
3
 * Created by Pierre-Henry Soria
4
 */
5
6
namespace PFBC\Validation;
7
8
class HexColor extends \PFBC\Validation
9
{
10
    public function __construct()
11
    {
12
        parent::__construct();
13
        $this->message = t('Error: The HEX color value is invalid. Has to be "#XXXXXX" format.');
14
    }
15
16
    public function isValid($sValue)
17
    {
18
        return $this->isNotApplicable($sValue) || $this->oValidate->hex($sValue);
19
    }
20
}
21