src/Behat/Gherkin/Lexer.php
protected function getKeywords($type)
    {
        if (!isset($this->keywordsCache[$type])) {
            $getter = 'get' . $type . 'Keywords';
            $keywords = $this->keywords->$getter();

            if ('Step' === $type) {
                $padded = array();
                foreach (explode('|', $keywords) as $keyword) {
                    $padded[] = false !== mb_strpos($keyword, '<', 0, 'utf8')
                        ? preg_quote(mb_substr($keyword, 0, -1, 'utf8'), '/') . '\s*'
                        : preg_quote($keyword, '/') . '\s+';
                }

                $keywords = implode('|', $padded);
            }

            $this->keywordsCache[$type] = $keywords;
        }

        return $this->keywordsCache[$type];
    }
protected function getKeywords($type)
    {
        if (!isset($this->keywordsCache[$type])) {
            $getter = 'get' . $type . 'Keywords';
            $keywords = $this->keywords->$getter();

            if ('Step' === $type) {
                $padded = array();
                foreach (explode('|', $keywords) as $keyword) {
                    $padded[] = false !== mb_strpos($keyword, '<', 0, 'utf8')
                        ? preg_quote(mb_substr($keyword, 0, -1, 'utf8'), '/') . '\s*'
                        : preg_quote($keyword, '/') . '\s+';
                }

                $keywords = implode('|', $padded);
            }

            $this->keywordsCache[$type] = $keywords;
        }

        return $this->keywordsCache[$type];
    }
protected function getKeywords ( $ type ) { if ( ! isset ( $ this -> keywordsCache [ $ type ] ) ) { $ getter = 'get' . $ type . 'Keywords' ; $ keywords = $ this -> keywords -> $ getter ( ) ; if ( 'Step' === $ type ) { $ padded = array ( ) ; foreach ( explode ( '|' , $ keywords ) as $ keyword ) { $ padded [ ] = false !== mb_strpos ( $ keyword , '<' , 0 , 'utf8' ) ? preg_quote ( mb_substr ( $ keyword , 0 , - 1 , 'utf8' ) , '/' ) . '\s*' : preg_quote ( $ keyword , '/' ) . '\s+' ; } $ keywords = implode ( '|' , $ padded ) ; } $ this -> keywordsCache [ $ type ] = $ keywords ; } return $ this -> keywordsCache [ $ type ] ; }
Returns keywords for provided type.

@param string $type Keyword type

@return string
Returns keywords for provided type .