You are here

public function Response::getVary in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-foundation/Response.php \Symfony\Component\HttpFoundation\Response::getVary()

Returns an array of header names given in the Vary header.

Return value

array An array of Vary names

File

vendor/symfony/http-foundation/Response.php, line 957

Class

Response
Response represents an HTTP response.

Namespace

Symfony\Component\HttpFoundation

Code

public function getVary() {
  if (!($vary = $this->headers
    ->get('Vary', null, false))) {
    return array();
  }
  $ret = array();
  foreach ($vary as $item) {
    $ret = array_merge($ret, preg_split('/[\\s,]+/', $item));
  }
  return $ret;
}