GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( 8846c9...67b391 )
by 12345
39s
created

ScenarioClearListener   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 34
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 1
dl 0
loc 34
ccs 0
cts 15
cp 0
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A onBeforeAfterScenario() 0 4 1
A getSubscribedEvents() 0 7 1
1
<?php
2
declare(strict_types = 1);
3
4
namespace espend\Behat\PlaceholderExtension\Subscriber;
5
6
use Behat\Behat\EventDispatcher\Event\ScenarioTested;
7
use espend\Behat\PlaceholderExtension\PlaceholderBagInterface;
8
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
9
10
/**
11
 * @author Daniel Espendiller <[email protected]>
12
 */
13
class ScenarioClearListener implements EventSubscriberInterface
14
{
15
    /**
16
     * @var PlaceholderBagInterface
17
     */
18
    private $parameterBag;
19
20
    /**
21
     * @param PlaceholderBagInterface $parameterBag
22
     */
23
    public function __construct(PlaceholderBagInterface $parameterBag)
24
    {
25
        $this->parameterBag = $parameterBag;
26
    }
27
28
    /**
29
     * Placeholder are only valid per scenario scope.
30
     */
31
    public function onBeforeAfterScenario()
32
    {
33
        $this->parameterBag->clear();
34
    }
35
36
    /**
37
     * {@inheritdoc}
38
     */
39
    public static function getSubscribedEvents()
40
    {
41
        return array(
42
            ScenarioTested::BEFORE => 'onBeforeAfterScenario',
43
            ScenarioTested::AFTER => 'onBeforeAfterScenario'
44
        );
45
    }
46
}