IdValidator   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 11
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 0 6 1
1
<?php
2
3
namespace hiapi\validators;
4
5
use yii\validators\RegularExpressionValidator;
6
7
/**
8
 * Class IdValidator validates an integer ID
9
 *
10
 * @author Dmytro Naumenko <[email protected]>
11
 */
12
class IdValidator extends RegularExpressionValidator
13
{
14
    public $pattern = '/^\d+$/';
15
16
    public function init()
17
    {
18
        parent::init();
19
20
        $this->message = 'Value is not a valid numeric integer';
21
    }
22
}
23