CallableRule   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 16
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 4 1
1
<?php
2
/**
3
 * @link https://github.com/phpviet/laravel-validation
4
 *
5
 * @copyright (c) PHP Viet
6
 * @license [MIT](https://opensource.org/licenses/MIT)
7
 */
8
9
namespace PHPViet\Laravel\Validation\Rules;
10
11
use Illuminate\Contracts\Validation\Rule;
12
13
/**
14
 * @author Vuong Minh <[email protected]>
15
 * @since 1.0.0
16
 */
17
abstract class CallableRule implements Rule
18
{
19
    /**
20
     * Hổ trợ sử dụng rule dưới dạng extension.
21
     *
22
     * @param $attribute
23
     * @param $value
24
     * @param $parameters
25
     * @param $validator
26
     * @return bool
27
     */
28
    public function __invoke($attribute, $value, $parameters, $validator)
29
    {
30
        return $this->passes($attribute, $value);
31
    }
32
}
33