Completed
Push — master ( ccd5f6...55e22e )
by Tyler
03:42 queued 02:32
created

Abbr   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 2
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 2
lcom 2
cbo 1
dl 0
loc 24
ccs 4
cts 4
cp 1
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
namespace LVR\State;
4
5
class Abbr extends Base
6
{
7
    /**
8
     * Determine if the validation rule passes.
9
     *
10
     * @param  string $attribute
11
     * @param  mixed  $value
12
     * @return bool
13
     */
14 9
    public function passes($attribute, $value)
15
    {
16 9
        return $this->isAbbr($value, $this->country);
17
    }
18
19
    /**
20
     * Get the validation error message.
21
     *
22
     * @return string
23
     */
24 6
    public function message()
25
    {
26 6
        return ":attribute must be an abbreviated {$this->subject}";
27
    }
28
}
29