Completed
Push — master ( c141df...fb040e )
by Abdelrahman
01:14
created

ValidatingTrait   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A validating() 0 4 1
A validated() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Rinvex\Support\Traits;
6
7
use Watson\Validating\ValidatingTrait as BaseValidatingTrait;
8
9
trait ValidatingTrait
10
{
11
    use BaseValidatingTrait;
12
13
    /**
14
     * Register a validating event with the dispatcher.
15
     *
16
     * @param \Closure|string $callback
17
     *
18
     * @return void
19
     */
20
    public static function validating($callback)
21
    {
22
        static::registerModelEvent('validating', $callback);
23
    }
24
25
    /**
26
     * Register a validated event with the dispatcher.
27
     *
28
     * @param \Closure|string $callback
29
     *
30
     * @return void
31
     */
32
    public static function validated($callback)
33
    {
34
        static::registerModelEvent('validated', $callback);
35
    }
36
}
37