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

ClearCache   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 5
c 1
b 0
f 0
dl 0
loc 24
rs 10
wmc 3

2 Methods

Rating   Name   Duplication   Size   Complexity  
A handle() 0 6 2
A __construct() 0 2 1
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
}