protected function getSearchQuery(array $args)
    {
        return implode(' ', array_map(function ($term) {
            return strpos($term, ' ') ? '"' . $term . '"' : $term;
        }, $args));
    }
protected function getSearchQuery(array $args)
    {
        return implode(' ', array_map(function ($term) {
            return strpos($term, ' ') ? '"' . $term . '"' : $term;
        }, $args));
    }
protected function getSearchQuery ( array $ args ) { return implode ( ' ' , array_map ( function ( $ term ) { return strpos ( $ term , ' ' ) ? '"' . $ term . '"' : $ term ; } , $ args ) ) ; }
Turn a list of command arguments into a search query.

Arguments containing a space would have been quoted on the command line,
so quotes are added again here.

@param string[] $args

@return string
Turn a list of command arguments into a search query .