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

ValidatingTrait::validated()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 2
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 4
rs 10
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