You are here

public function AcceptHeader::filter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/http-foundation/AcceptHeader.php \Symfony\Component\HttpFoundation\AcceptHeader::filter()

Filters items on their value using given regex.

Parameters

string $pattern:

Return value

AcceptHeader

File

vendor/symfony/http-foundation/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());
  }));
}