src/Behat/Behat/Definition/Search/RepositorySearchEngine.php
private function match(Definition $definition, $stepText, array $multiline)
    {
        $regex = $this->patternTransformer->transformPatternToRegex($definition->getPattern());

        if (!preg_match($regex, $stepText, $match)) {
            return null;
        }

        $function = $definition->getReflection();
        $match = array_merge($match, array_values($multiline));
        $arguments = $this->argumentOrganiser->organiseArguments($function, $match);

        return new SearchResult($definition, $stepText, $arguments);
    }
private function match(Definition $definition, $stepText, array $multiline)
    {
        $regex = $this->patternTransformer->transformPatternToRegex($definition->getPattern());

        if (!preg_match($regex, $stepText, $match)) {
            return null;
        }

        $function = $definition->getReflection();
        $match = array_merge($match, array_values($multiline));
        $arguments = $this->argumentOrganiser->organiseArguments($function, $match);

        return new SearchResult($definition, $stepText, $arguments);
    }
private function match ( Definition $ definition , $ stepText , array $ multiline ) { $ regex = $ this -> patternTransformer -> transformPatternToRegex ( $ definition -> getPattern ( ) ) ; if ( ! preg_match ( $ regex , $ stepText , $ match ) ) { return null ; } $ function = $ definition -> getReflection ( ) ; $ match = array_merge ( $ match , array_values ( $ multiline ) ) ; $ arguments = $ this -> argumentOrganiser -> organiseArguments ( $ function , $ match ) ; return new SearchResult ( $ definition , $ stepText , $ arguments ) ; }
Attempts to match provided definition against a step text.

@param Definition          $definition
@param string              $stepText
@param ArgumentInterface[] $multiline

@return null|SearchResult
Attempts to match provided definition against a step text .