src/Yoanm/BehatUtilsExtension/Subscriber/BehatStepLoggerSubscriber.php
protected function resolveNodeLine(GherkinNodeTested $event)
    {
        $node = $event->getNode();
        $line = $node->getLine();

        if ($node instanceof StepContainerInterface
            && $event instanceof AfterTested
            && !$event instanceof StepTested /* no need to process step event end line */
        ) {
            // in case of end event, try to find the last line of the node

            /** @var StepContainerInterface $node*/
            $stepList = $node->getSteps();
            $lastStep = array_pop($stepList);

            // Check if StepContainer was not empty
            if ($lastStep instanceof StepNode) {
                $line = $lastStep->getLine();
            }
        }

        return $line;
    }
protected function resolveNodeLine(GherkinNodeTested $event)
    {
        $node = $event->getNode();
        $line = $node->getLine();

        if ($node instanceof StepContainerInterface
            && $event instanceof AfterTested
            && !$event instanceof StepTested /* no need to process step event end line */
        ) {
            // in case of end event, try to find the last line of the node

            /** @var StepContainerInterface $node*/
            $stepList = $node->getSteps();
            $lastStep = array_pop($stepList);

            // Check if StepContainer was not empty
            if ($lastStep instanceof StepNode) {
                $line = $lastStep->getLine();
            }
        }

        return $line;
    }
@param GherkinNodeTested $event

@return int