public function AcceptHeader::filter

Filters items on their value using given regex.

Parameters

string $pattern:

Return value

AcceptHeader

File

drupal/core/vendor/symfony/http-foundation/Symfony/Component/HttpFoundation/AcceptHeader.php, line 133

Class

AcceptHeader
Represents an Accept-* header.

Namespace

Symfony\Component\HttpFoundation

Code

public function filter($pattern) {
  return new self(array_filter($this->items, function (AcceptHeaderItem $item) use ($pattern) {
    return preg_match($pattern, $item
      ->getValue());
  }));
}