Completed
Push — master ( 31d799...217d09 )
by Yo
02:17
created

RebootKernelSubscriber   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 1
dl 0
loc 29
ccs 10
cts 10
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A getSubscribedEvents() 0 7 1
A rebootKernel() 0 4 1
1
<?php
2
namespace Yoanm\Behat3SymfonyExtension\Subscriber;
3
4
use Behat\Behat\EventDispatcher\Event\ExampleTested;
5
use Behat\Behat\EventDispatcher\Event\ScenarioTested;
6
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
7
use Yoanm\Behat3SymfonyExtension\Handler\KernelHandler;
8
9
/**
10
 * Class RebootKernelSubscriber
11
 */
12
class RebootKernelSubscriber implements EventSubscriberInterface
13
{
14
    /** @var KernelHandler */
15
    private $kernelHandler;
16
17
    /**
18
     * @param KernelHandler $kernelHandler
19
     */
20 2
    public function __construct(KernelHandler $kernelHandler)
21
    {
22 2
        $this->kernelHandler = $kernelHandler;
23 2
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28 1
    public static function getSubscribedEvents()
29
    {
30
        return [
31 1
            ScenarioTested::AFTER => 'rebootKernel',
32 1
            ExampleTested::AFTER => 'rebootKernel',
33 1
        ];
34
    }
35
36 1
    public function rebootKernel()
37
    {
38 1
        $this->kernelHandler->rebootSfKernel();
39 1
    }
40
}
41