Passed
Push — master ( e9a477...8986c1 )
by Richard
03:58 queued 12s
created

ClearCache::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 0

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 0
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace Riclep\Storyblok\Listeners;
4
5
use Illuminate\Support\Facades\Cache;
6
use Riclep\Storyblok\Events\PublishingEvent;
7
8
class ClearCache
9
{
10
	/**
11
	 * Create the event listener.
12
	 *
13
	 * @return void
14
	 */
15
	public function __construct()
16
	{
17
		//
18
	}
19
20
	/**
21
	 * Handle the event.
22
	 *
23
	 * @param PublishingEvent $event
24
	 * @return void
25
	 */
26
	public function handle(PublishingEvent $event)
0 ignored issues
show
Unused Code introduced by
The parameter $event 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

26
	public function handle(/** @scrutinizer ignore-unused */ PublishingEvent $event)

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...
27
	{
28
		if (Cache::getStore() instanceof \Illuminate\Cache\TaggableStore) {
29
			Cache::tags('storyblok')->flush();
30
		} else {
31
			Cache::flush();
32
		}
33
	}
34
}