Completed
Push — master ( a620b9...165629 )
by Paul
01:09
created

Confirmed::message()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
3
4
namespace Infinitypaul\Validator\Rules;
5
6
7
class Confirmed extends Rule
8
{
9
10
    public function passes($field, $value, $data): bool
11
    {
12
        if(!isset($data[$field.'_confirmation'])){
13
            return false;
14
        }
15
        if($data[$field.'_confirmation'] !== $value){
16
            return false;
17
        };
18
19
        return true;
20
    }
21
22
    public function message($field): string
23
    {
24
        return $field.' Doesnt Match';
25
    }
26
}
27