Behat\Gherkin\Lexer::getStepKeywordType PHP Method

getStepKeywordType() private method

Returns step type keyword (Given, When, Then, etc.).
private getStepKeywordType ( string $native ) : string
$native string Step keyword in provided language
return string
    private function getStepKeywordType($native)
    {
        // Consider "*" as a AND keyword so that it is normalized to the previous step type
        if ('*' === $native) {
            return 'And';
        }
        if (empty($this->stepKeywordTypesCache)) {
            $this->stepKeywordTypesCache = array('Given' => explode('|', $this->keywords->getGivenKeywords()), 'When' => explode('|', $this->keywords->getWhenKeywords()), 'Then' => explode('|', $this->keywords->getThenKeywords()), 'And' => explode('|', $this->keywords->getAndKeywords()), 'But' => explode('|', $this->keywords->getButKeywords()));
        }
        foreach ($this->stepKeywordTypesCache as $type => $keywords) {
            if (in_array($native, $keywords) || in_array($native . '<', $keywords)) {
                return $type;
            }
        }
        return 'Given';
    }