Use veradic argument for HTTP::combineVary

This commit is contained in:
Daniel Hensby 2018-06-12 12:52:34 +01:00 committed by Damian Mooyman
parent bf90af4845
commit 37343cf0e2

View File

@ -603,18 +603,18 @@ class HTTP
/**
* Combine vary strings
*
* @param string $vary,... Each vary as a separate arg
* @param string[] $varies Each vary as a separate arg
* @return string
*/
protected static function combineVary($vary)
protected static function combineVary(...$varies)
{
$varies = [];
foreach (func_get_args() as $arg) {
$argVaries = array_filter(preg_split("/\s*,\s*/", trim($arg)));
$cleanVaries = [];
foreach ($varies as $vary) {
$argVaries = array_filter(preg_split("/\s*,\s*/", trim($vary)));
if ($argVaries) {
$varies = array_merge($varies, $argVaries);
$cleanVaries = array_merge($cleanVaries, $argVaries);
}
}
return implode(', ', array_unique($varies));
return implode(', ', array_unique($cleanVaries));
}
}