1 | <?php |
||
10 | trait ValidatingTrait |
||
11 | { |
||
12 | use UniqueWithInjector; |
||
13 | use BaseValidatingTrait; |
||
14 | |||
15 | /** |
||
16 | * Merge new validation rules with existing validation rules on the model. |
||
17 | * |
||
18 | * @param array $rules |
||
19 | * |
||
20 | * @return $this |
||
21 | */ |
||
22 | public function mergeRules(array $rules) |
||
28 | |||
29 | /** |
||
30 | * Register a validating event with the dispatcher. |
||
31 | * |
||
32 | * @param \Closure|string $callback |
||
33 | * |
||
34 | * @return void |
||
35 | */ |
||
36 | public static function validating($callback) |
||
40 | |||
41 | /** |
||
42 | * Register a validated event with the dispatcher. |
||
43 | * |
||
44 | * @param \Closure|string $callback |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public static function validated($callback) |
||
52 | } |
||
53 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: