You are here

public function StreamCapturer::filter in Drupal 9

Same name and namespace in other branches
  1. 10 core/tests/Drupal/Tests/StreamCapturer.php \Drupal\Tests\StreamCapturer::filter()

File

core/tests/Drupal/Tests/StreamCapturer.php, line 12

Class

StreamCapturer
Captures output to a stream and stores it for retrieval.

Namespace

Drupal\Tests

Code

public function filter($in, $out, &$consumed, $closing) {
  while ($bucket = stream_bucket_make_writeable($in)) {
    self::$cache .= $bucket->data;

    // cSpell:disable-next-line
    $consumed += $bucket->datalen;
    stream_bucket_append($out, $bucket);
  }

  // cSpell:disable-next-line
  return PSFS_FEED_ME;
}