/** * {@inheritdoc} */ public function filter($in, $out, &$consumed, $closing) { while ($streamBucket = stream_bucket_make_writeable($in)) { $this->sourceCode .= $streamBucket->data; } if ($closing || feof($this->stream)) { $consumed = strlen($this->sourceCode); $processedCode = Engine::parse($this->sourceCode); $streamBucket = stream_bucket_new($this->stream, $processedCode); stream_bucket_append($out, $streamBucket); return PSFS_PASS_ON; } return PSFS_FEED_ME; }