Digits::passes()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
crap 1
1
<?php
2
namespace LVR\Phone;
3
4
use Illuminate\Contracts\Validation\Rule;
5
6
class Digits extends Phone
7
{
8
    /**
9
     * Determine if the validation rule passes.
10
     *
11
     * @param  string $attribute
12
     * @param  mixed  $value
13
     *s
14
     * @return bool
15
     */
16 6
    public function passes($attribute, $value)
17
    {
18 6
        return $this->isDigits($value);
19
    }
20
21
    /**
22
     * Get the validation error message.
23
     *
24
     * @return string
25
     */
26 6
    public function message()
27
    {
28 6
        return ':attribute must be in digits only phone format';
29
    }
30
}
31