Issues (28)

src/Posts/PostObserver.php (1 issue)

Severity
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
The parameter $post is not used and could be removed. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-unused  annotation

42
    protected function clearResponseCache(/** @scrutinizer ignore-unused */ Post $post)

This check looks for parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
43
    {
44
        ResponseCache::clear();
45
    }
46
}
47