TqContextInitializer   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 31
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 0%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 6 1
A initializeContext() 0 6 2
1
<?php
2
/**
3
 * @author Sergii Bondarenko, <[email protected]>
4
 */
5
namespace Drupal\TqExtension\Context;
6
7
use Behat\Behat\Context as Behat;
8
9
class TqContextInitializer implements Behat\Initializer\ContextInitializer
10
{
11
    /**
12
     * Parameters of TqExtension.
13
     *
14
     * @var array
15
     */
16
    private $parameters = [];
17
18
    /**
19
     * @param array $parameters
20
     * @param string $namespace
21
     * @param string $path
22
     */
23
    public function __construct(array $parameters, $namespace, $path)
0 ignored issues
show
Unused Code introduced by
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
24
    {
25
        $parameters['namespace'] = $namespace;
26
27
        $this->parameters = $parameters;
28
    }
29
30
    /**
31
     * {@inheritdoc}
32
     */
33
    public function initializeContext(Behat\Context $context)
34
    {
35
        if ($context instanceof TqContextInterface) {
36
            $context->setTqParameters($this->parameters);
37
        }
38
    }
39
}
40