protected function addWildcards(array $words)
    {
        $token = $this->wildcard;

        return array_map(function ($word) use ($token) {
            return preg_replace('/\*+/', '*', "{$token}{$word}{$token}");
        }, $words);
    }
protected function addWildcards(array $words)
    {
        $token = $this->wildcard;

        return array_map(function ($word) use ($token) {
            return preg_replace('/\*+/', '*', "{$token}{$word}{$token}");
        }, $words);
    }
protected function addWildcards ( array $ words ) { $ token = $ this -> wildcard ; return array_map ( function ( $ word ) use ( $ token ) { return preg_replace ( '/\*+/' , '*' , "{$token}{$word}{$token}" ) ; } , $ words ) ; }
Add wildcard tokens to the words.

@param array $words
Add wildcard tokens to the words .