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; }