1 | <?php |
||
11 | trait Ticketable |
||
12 | { |
||
13 | /** |
||
14 | * Register a saved model event with the dispatcher. |
||
15 | * |
||
16 | * @param \Closure|string $callback |
||
17 | * |
||
18 | * @return void |
||
19 | */ |
||
20 | abstract public static function saved($callback); |
||
21 | |||
22 | /** |
||
23 | * Register a deleted model event with the dispatcher. |
||
24 | * |
||
25 | * @param \Closure|string $callback |
||
26 | * |
||
27 | * @return void |
||
28 | */ |
||
29 | abstract public static function deleted($callback); |
||
30 | |||
31 | /** |
||
32 | * Define a polymorphic one-to-many relationship. |
||
33 | * |
||
34 | * @param string $related |
||
35 | * @param string $name |
||
36 | * @param string $type |
||
|
|||
37 | * @param string $id |
||
38 | * @param string $localKey |
||
39 | * |
||
40 | * @return \Illuminate\Database\Eloquent\Relations\MorphMany |
||
41 | */ |
||
42 | abstract public function morphMany($related, $name, $type = null, $id = null, $localKey = null); |
||
43 | |||
44 | /** |
||
45 | * Get the booking model name. |
||
46 | * |
||
47 | * @return string |
||
48 | */ |
||
49 | abstract public function getBookingModel(): string; |
||
50 | |||
51 | /** |
||
52 | * Get the ticket model name. |
||
53 | * |
||
54 | * @return string |
||
55 | */ |
||
56 | abstract public function getTicketModel(): string; |
||
57 | |||
58 | /** |
||
59 | * Boot the Ticketable trait for the model. |
||
60 | * |
||
61 | * @return void |
||
62 | */ |
||
63 | public static function bootTicketable() |
||
69 | |||
70 | /** |
||
71 | * Attach the given bookings to the model. |
||
72 | * |
||
73 | * @param \Illuminate\Database\Eloquent\Collection|\Illuminate\Support\Collection|array $ids |
||
74 | * @param mixed $bookings |
||
75 | * |
||
76 | * @return void |
||
77 | */ |
||
78 | public function setBookingsAttribute($bookings): void |
||
84 | |||
85 | /** |
||
86 | * The resource may have many tickets. |
||
87 | * |
||
88 | * @return \Illuminate\Database\Eloquent\Relations\MorphMany |
||
89 | */ |
||
90 | public function tickets(): MorphMany |
||
94 | |||
95 | /** |
||
96 | * The resource may have many bookings. |
||
97 | * |
||
98 | * @return \Illuminate\Database\Eloquent\Relations\MorphMany |
||
99 | */ |
||
100 | public function bookings(): MorphMany |
||
104 | |||
105 | /** |
||
106 | * Get bookings by the given customer. |
||
107 | * |
||
108 | * @param \Illuminate\Database\Eloquent\Model $customer |
||
109 | * |
||
110 | * @return \Illuminate\Database\Eloquent\Relations\MorphMany |
||
111 | */ |
||
112 | public function bookingsBy(Model $customer): MorphMany |
||
116 | |||
117 | /** |
||
118 | * Book the model for the given customer at the given dates with the given price. |
||
119 | * |
||
120 | * @param \Illuminate\Database\Eloquent\Model $customer |
||
121 | * @param float $paid |
||
122 | * @param string $currency |
||
123 | * |
||
124 | * @return \Rinvex\Bookings\Models\TicketableBooking |
||
125 | */ |
||
126 | public function newBooking(Model $customer, float $paid, string $currency): TicketableBooking |
||
137 | } |
||
138 |
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.