1 | <?php |
||
2 | |||
3 | namespace Wingsline\Blog\Posts; |
||
4 | |||
5 | use Spatie\ResponseCache\Facades\ResponseCache; |
||
6 | |||
7 | class PostObserver |
||
8 | { |
||
9 | /** |
||
10 | * Handle the Post "created" event. |
||
11 | * |
||
12 | * @return void |
||
13 | */ |
||
14 | public function created(Post $post) |
||
15 | { |
||
16 | $this->clearResponseCache($post); |
||
17 | } |
||
18 | |||
19 | /** |
||
20 | * Handle the Post "deleted" event. |
||
21 | * |
||
22 | * @return void |
||
23 | */ |
||
24 | public function deleted(Post $post) |
||
25 | { |
||
26 | $this->clearResponseCache($post); |
||
27 | } |
||
28 | |||
29 | /** |
||
30 | * Handle the Post "updated" event. |
||
31 | * |
||
32 | * @return void |
||
33 | */ |
||
34 | public function updated(Post $post) |
||
35 | { |
||
36 | $this->clearResponseCache($post); |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Clears the respoonse cache. |
||
41 | */ |
||
42 | protected function clearResponseCache(Post $post) |
||
0 ignored issues
–
show
|
|||
43 | { |
||
44 | ResponseCache::clear(); |
||
45 | } |
||
46 | } |
||
47 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.