Completed
Push — master ( 238484...b2edf5 )
by Tyler
126:56 queued 61:56
created

NANP   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A passes() 0 4 1
A message() 0 4 1
1
<?php
2
namespace LVR\Phone;
3
4
use Illuminate\Contracts\Validation\Rule;
5
6
class NANP 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
    public function passes($attribute, $value)
17
    {
18
        return $this->isNANP($value);
19
    }
20
21
    /**
22
     * Get the validation error message.
23
     *
24
     * @return string
25
     */
26
    public function message()
27
    {
28
        return ':attribute must be in the NANP phone format';
29
    }
30
}