Sanpi\Behatch\Context\DebugContext::getBackground PHP Method

getBackground() private method

private getBackground ( Behat\Behat\Hook\Scope\AfterStepScope $scope ) : Behat\Gherkin\Node\BackgroundNode
$scope Behat\Behat\Hook\Scope\AfterStepScope
return Behat\Gherkin\Node\BackgroundNode
    private function getBackground(AfterStepScope $scope)
    {
        $background = $scope->getFeature()->getBackground();
        if (!$background) {
            return false;
        }
        $stepLinesInBackground = array_map(function (StepNode $step) {
            return $step->getLine();
        }, $background->getSteps());
        if (in_array($scope->getStep()->getLine(), $stepLinesInBackground)) {
            return $background;
        }
        return false;
    }