Test Failed
Pull Request — 1.x (#58)
by Milwad
03:28
created

ValidArrayKeyExists   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A message() 0 3 1
A passes() 0 4 1
1
<?php
2
3
namespace Milwad\LaravelValidate\Rules;
4
5
use Illuminate\Contracts\Validation\Rule;
6
7
class ValidArrayKeyExists implements Rule
8
{
9
    /**
10
     * Check base64.
11
     *
12
     * @param  string  $attribute
13
     * @param  mixed  $value
14
     * @return bool
15
     */
16
    public function passes($attribute, $value)
17
    {
18
        \Illuminate\Validation\Rule::forEach(function (string $value, string $attribute) {
19
            dd($value, $attribute);
20
        });
21
    }
22
23
    /**
24
     * Get the validation error message.
25
     *
26
     * @return string
27
     */
28
    public function message()
29
    {
30
        return __('validate.array.key_exists');
31
    }
32
}
33