1 | <?php |
||
11 | trait GivesTestimonials |
||
12 | { |
||
13 | /** |
||
14 | * Register a deleted model event with the dispatcher. |
||
15 | * |
||
16 | * @param \Closure|string $callback |
||
17 | * |
||
18 | * @return void |
||
19 | */ |
||
20 | abstract public static function deleted($callback); |
||
21 | |||
22 | /** |
||
23 | * Define a polymorphic one-to-many relationship. |
||
24 | * |
||
25 | * @param string $related |
||
26 | * @param string $name |
||
27 | * @param string $type |
||
|
|||
28 | * @param string $id |
||
29 | * @param string $localKey |
||
30 | * |
||
31 | * @return \Illuminate\Database\Eloquent\Relations\MorphMany |
||
32 | */ |
||
33 | abstract public function morphMany($related, $name, $type = null, $id = null, $localKey = null); |
||
34 | |||
35 | /** |
||
36 | * Boot the GivesTestimonials trait for the model. |
||
37 | * |
||
38 | * @return void |
||
39 | */ |
||
40 | public static function bootGivesTestimonials() |
||
46 | |||
47 | /** |
||
48 | * Get all attached testimonials to the model. |
||
49 | * |
||
50 | * @return \Illuminate\Database\Eloquent\Relations\MorphMany |
||
51 | */ |
||
52 | public function recommendations(): MorphMany |
||
56 | |||
57 | /** |
||
58 | * Get recommendations for the given subject. |
||
59 | * |
||
60 | * @param \Illuminate\Database\Eloquent\Model $subject |
||
61 | * |
||
62 | * @return \Illuminate\Database\Eloquent\Relations\MorphMany |
||
63 | */ |
||
64 | public function recommendationsOf(Model $subject): MorphMany |
||
68 | |||
69 | /** |
||
70 | * Add new testimonial for the given subject. |
||
71 | * |
||
72 | * @param \Illuminate\Database\Eloquent\Model $subject |
||
73 | * @param string $body |
||
74 | * |
||
75 | * @return \Rinvex\Testimonials\Models\Testimonial |
||
76 | */ |
||
77 | public function newTestimonial(Model $subject, string $body): Testimonial |
||
87 | } |
||
88 |
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.