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

HexColor   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A isValid() 0 4 2
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