Completed
Push — master ( 010fb4...bcd1e3 )
by David
02:17
created

getSubscribedEvents()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 7
Ratio 100 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 7
loc 7
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Http\HttplugBundle\Discovery;
6
7
use Http\Discovery\HttpClientDiscovery;
8
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
9
10
/**
11
 * @author Wouter de Jong <[email protected]>
12
 */
13
class ConfiguredClientsStrategyListener implements EventSubscriberInterface
14
{
15
    /**
16
     * Make sure to use the custom strategy.
17
     */
18 14
    public function onEvent()
19
    {
20 14
        HttpClientDiscovery::prependStrategy(ConfiguredClientsStrategy::class);
21 14
    }
22
23
    /**
24
     * Whenever these events occur we make sure to add the custom strategy to the discovery.
25
     *
26
     * {@inheritdoc}
27
     */
28 5 View Code Duplication
    public static function getSubscribedEvents()
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
29
    {
30
        return [
31 5
            'kernel.request' => ['onEvent', 1024],
32
            'console.command' => ['onEvent', 1024],
33
        ];
34
    }
35
}
36