1 | <?php |
||
10 | trait Auditable |
||
11 | { |
||
12 | /** |
||
13 | * Register a creating model event with the dispatcher. |
||
14 | * |
||
15 | * @param \Closure|string $callback |
||
16 | * |
||
17 | * @return void |
||
18 | */ |
||
19 | abstract public static function creating($callback); |
||
20 | |||
21 | /** |
||
22 | * Register an updating model event with the dispatcher. |
||
23 | * |
||
24 | * @param \Closure|string $callback |
||
25 | * |
||
26 | * @return void |
||
27 | */ |
||
28 | abstract public static function updating($callback); |
||
29 | |||
30 | /** |
||
31 | * Define an inverse one-to-one or many relationship. |
||
32 | * |
||
33 | * @param string $related |
||
34 | * @param string $foreignKey |
||
|
|||
35 | * @param string $ownerKey |
||
36 | * @param string $relation |
||
37 | * |
||
38 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
39 | */ |
||
40 | abstract public function belongsTo($related, $foreignKey = null, $ownerKey = null, $relation = null); |
||
41 | |||
42 | /** |
||
43 | * Boot the Auditable trait for the model. |
||
44 | * |
||
45 | * @return void |
||
46 | */ |
||
47 | public static function bootAuditable() |
||
58 | |||
59 | /** |
||
60 | * Get user model who created the record. |
||
61 | * |
||
62 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
63 | */ |
||
64 | public function creator(): BelongsTo |
||
70 | |||
71 | /** |
||
72 | * Get user model who updated the record. |
||
73 | * |
||
74 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo |
||
75 | */ |
||
76 | public function updater(): BelongsTo |
||
82 | } |
||
83 |
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.