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

HexColor::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 3
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 5
rs 9.4285
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