Completed
Push — master ( fbdcb5...b8714e )
by Tomáš
36:22 queued 33:21
created

EnableFiltersSubscriber::enableFilters()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 3
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 4
ccs 3
cts 3
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of Zenify
7
 * Copyright (c) 2012 Tomas Votruba (http://tomasvotruba.cz)
8
 */
9
10
namespace Zenify\DoctrineFilters\EventSubscriber;
11
12
use Symfony\Component\Console\ConsoleEvents;
13
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
14
use Symnedi\EventDispatcher\NetteApplicationEvents;
15
use Zenify\DoctrineFilters\Contract\FilterManagerInterface;
16
17
18
final class EnableFiltersSubscriber implements EventSubscriberInterface
19
{
20
21
	/**
22
	 * @var FilterManagerInterface
23
	 */
24
	private $filterManager;
25
26
27 3
	public function setFilterManager(FilterManagerInterface $filterManager)
28
	{
29 3
		$this->filterManager = $filterManager;
30 3
	}
31
32
33 3
	public static function getSubscribedEvents() : array
34
	{
35
		return [
36 3
			ConsoleEvents::COMMAND => 'enableFilters',
37 3
			NetteApplicationEvents::ON_PRESENTER => 'enableFilters'
38
		];
39
	}
40
41
42 1
	public function enableFilters()
43
	{
44 1
		$this->filterManager->enableFilters();
45 1
	}
46
47
}
48