TqContextInitializer::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 6
ccs 0
cts 4
cp 0
rs 9.4285
cc 1
eloc 3
nc 1
nop 3
crap 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