Completed
Push — develop ( 3ba432...36e0ad )
by Abdelrahman
01:06
created

ValidatingTrait::validating()   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, UniqueInjector {
12
        UniqueInjector::prepareUniqueRule insteadof BaseValidatingTrait;
13
    }
14
15
    /**
16
     * Register a validating event with the dispatcher.
17
     *
18
     * @param \Closure|string $callback
19
     *
20
     * @return void
21
     */
22
    public static function validating($callback)
23
    {
24
        static::registerModelEvent('validating', $callback);
25
    }
26
27
    /**
28
     * Register a validated event with the dispatcher.
29
     *
30
     * @param \Closure|string $callback
31
     *
32
     * @return void
33
     */
34
    public static function validated($callback)
35
    {
36
        static::registerModelEvent('validated', $callback);
37
    }
38
}
39