1 | <?php |
||
11 | trait Auditable |
||
12 | { |
||
13 | /** |
||
14 | * Register a creating model event with the dispatcher. |
||
15 | * |
||
16 | * @param \Closure|string $callback |
||
17 | * |
||
18 | * @return void |
||
19 | */ |
||
20 | abstract public static function creating($callback); |
||
21 | |||
22 | /** |
||
23 | * Register an updating model event with the dispatcher. |
||
24 | * |
||
25 | * @param \Closure|string $callback |
||
26 | * |
||
27 | * @return void |
||
28 | */ |
||
29 | abstract public static function updating($callback); |
||
30 | |||
31 | /** |
||
32 | * Define a polymorphic, inverse one-to-one or many relationship. |
||
33 | * |
||
34 | * @param string $name |
||
|
|||
35 | * @param string $type |
||
36 | * @param string $id |
||
37 | * @param string $ownerKey |
||
38 | * |
||
39 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
40 | */ |
||
41 | abstract public function morphTo($name = null, $type = null, $id = null, $ownerKey = null); |
||
42 | |||
43 | /** |
||
44 | * Boot the Auditable trait for the model. |
||
45 | * |
||
46 | * @return void |
||
47 | */ |
||
48 | public static function bootAuditable() |
||
63 | |||
64 | /** |
||
65 | * Get the owning creator. |
||
66 | * |
||
67 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
68 | */ |
||
69 | public function creator(): MorphTo |
||
73 | |||
74 | /** |
||
75 | * Get the owning updater. |
||
76 | * |
||
77 | * @return \Illuminate\Database\Eloquent\Relations\MorphTo |
||
78 | */ |
||
79 | public function updater(): MorphTo |
||
83 | |||
84 | /** |
||
85 | * Get audits of the given creator. |
||
86 | * |
||
87 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
88 | * @param \Illuminate\Database\Eloquent\Model $user |
||
89 | * |
||
90 | * @return \Illuminate\Database\Eloquent\Builder |
||
91 | */ |
||
92 | public function scopeOfCreator(Builder $builder, Model $user): Builder |
||
96 | |||
97 | /** |
||
98 | * Get audits of the given updater. |
||
99 | * |
||
100 | * @param \Illuminate\Database\Eloquent\Builder $builder |
||
101 | * @param \Illuminate\Database\Eloquent\Model $user |
||
102 | * |
||
103 | * @return \Illuminate\Database\Eloquent\Builder |
||
104 | */ |
||
105 | public function scopeOfUpdater(Builder $builder, Model $user): Builder |
||
109 | } |
||
110 |
This check looks for
@param
annotations where the type inferred by our type inference engine differs from the declared type.It makes a suggestion as to what type it considers more descriptive.
Most often this is a case of a parameter that can be null in addition to its declared types.