EidValidator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 15
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
wmc 1
lcom 1
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 4 1
1
<?php
2
/**
3
 * HiPanel core package
4
 *
5
 * @link      https://hipanel.com/
6
 * @package   hipanel-core
7
 * @license   BSD-3-Clause
8
 * @copyright Copyright (c) 2014-2019, HiQDev (http://hiqdev.com/)
9
 */
10
11
namespace hipanel\validators;
12
13
/**
14
 * Class EidValidator.
15
 */
16
class EidValidator extends \yii\validators\RegularExpressionValidator
17
{
18
    /**
19
     * {@inheritdoc}
20
     */
21
    public $pattern = '/^[0-9a-z_.:-]+$/i';
22
23
    /**
24
     * {@inheritdoc}
25
     */
26
    public function init()
27
    {
28
        $this->message = \Yii::t('hipanel', '{attribute} does not look like a valid extended id entry');
29
    }
30
}
31