PostObserver::deleted()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
nc 1
nop 1
dl 0
loc 3
c 1
b 0
f 0
cc 1
rs 10
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
Unused Code introduced by
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