Completed
Push — master ( d2f081...a05bf8 )
by Andrii
03:19
created

BaseContext::getBuilder()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace hiqdev\php\billing\tests\behat\bootstrap;
4
5
use Behat\Behat\Context\Context;
6
use Behat\Behat\Hook\Scope\BeforeScenarioScope;
7
8
abstract class BaseContext implements Context
9
{
10
    protected $builder;
11
12
    /**
13
     * @BeforeScenario
14
     */
15
    public function getBuilder(BeforeScenarioScope $scope)
16
    {
17
        $this->builder = $scope->getEnvironment()->getContext(BuilderContext::class)->getBuilder();
0 ignored issues
show
Bug introduced by
The method getContext() does not exist on Behat\Testwork\Environment\Environment. It seems like you code against a sub-type of Behat\Testwork\Environment\Environment such as Behat\Behat\Context\Envi...lizedContextEnvironment or Behat\Behat\Context\Envi...lizedContextEnvironment. ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

17
        $this->builder = $scope->getEnvironment()->/** @scrutinizer ignore-call */ getContext(BuilderContext::class)->getBuilder();
Loading history...
18
    }
19
}
20