IdVN   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 18
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 2
lcom 0
cbo 2
dl 0
loc 18
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A passes() 0 4 1
A message() 0 4 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/laravel-validation
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace PHPViet\Laravel\Validation\Rules;
10
11
use PHPViet\Validation\Validator;
12
13
/**
14
 * @author Vuong Minh <[email protected]>
15
 * @since 1.0.0
16
 */
17
class IdVN extends CallableRule
18
{
19
    /**
20
     * {@inheritdoc}
21
     */
22
    public function passes($attribute, $value): bool
23
    {
24
        return Validator::idVN()->validate($value);
25
    }
26
27
    /**
28
     * {@inheritdoc}
29
     */
30
    public function message(): string
31
    {
32
        return __('phpVietValidation::validation.id');
33
    }
34
}
35