Completed
Push — master ( ab5801...882b8d )
by Dmitry
19:57 queued 04:58
created

IdValidator::init()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 6
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
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