1 | <?php |
||
12 | class CacheableObserver |
||
13 | { |
||
14 | /** |
||
15 | * Event dispatcher object |
||
16 | * |
||
17 | * @var \Illuminate\Contracts\Events\Dispatcher |
||
18 | */ |
||
19 | protected $events; |
||
20 | |||
21 | /** |
||
22 | * Cacheable observer constructor |
||
23 | * |
||
24 | * @param \Illuminate\Contracts\Events\Dispatcher $events |
||
25 | */ |
||
26 | public function __construct(Dispatcher $events) |
||
30 | |||
31 | /** |
||
32 | * Fire cacheable events |
||
33 | * |
||
34 | * @param \Cacheable\Events\CacheableEvent $event |
||
|
|||
35 | * @return mixed |
||
36 | */ |
||
37 | public function fireEvent(CacheableEvent $event) |
||
45 | |||
46 | /** |
||
47 | * Tell the cacheable service to flush all cache |
||
48 | * that related to the given model. |
||
49 | * |
||
50 | * @param \Illuminate\Database\Eloquent\Model $model |
||
51 | * |
||
52 | * @return void |
||
53 | */ |
||
54 | protected function flushCache(CacheableModel $model) |
||
64 | |||
65 | /** |
||
66 | * Saved event handler. |
||
67 | * |
||
68 | * @param \Illuminate\Database\Eloquent\Model $model |
||
69 | * |
||
70 | * @return void |
||
71 | */ |
||
72 | public function saved(Model $model) |
||
76 | |||
77 | /** |
||
78 | * Deleted event handler. |
||
79 | * |
||
80 | * @param \Illuminate\Database\Eloquent\Model $model |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | public function deleted(Model $model) |
||
88 | |||
89 | /** |
||
90 | * Restored event handler. |
||
91 | * |
||
92 | * @param \Illuminate\Database\Eloquent\Model $model |
||
93 | * |
||
94 | * @return void |
||
95 | */ |
||
96 | public function restored(Model $model) |
||
100 | } |
||
101 |
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.