mode = $mode; $this->checkMessage = $checkMessage; switch ($mode) { case 'always': case 'never': $this->buffer = null; break; case 'error': $this->buffer = []; break; default: throw new \InvalidArgumentException("Unrecognized passthru mode: $mode"); } } private function onBufferMessage($method, $args) { $this->buffer[] = [$method, $args]; if ($this->mode === 'flushing') { return; } $isError = false; $messages = (array)$args[0]; foreach ($messages as $message) { if (call_user_func($this->checkMessage, $message, $method)) { $isError = true; break; } } if ($isError) { $this->mode = 'flushing'; for ($i = 0; $i < count($this->buffer); $i++) { call_user_func_array([$this->delegate, $this->buffer[$i][0]], $this->buffer[$i][1]); } $this->mode = 'always'; $this->buffer = null; } } public function writeRaw($messages, $newline = true, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->writeRaw( $messages, $newline, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $verbosity] ); } } public function writeErrorRaw($messages, $newline = true, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->writeErrorRaw( $messages, $newline, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $verbosity] ); } } public function write($messages, $newline = true, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->write($messages, $newline, $verbosity); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $verbosity] ); } } public function writeError($messages, $newline = true, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->writeError( $messages, $newline, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $verbosity] ); } } public function overwrite($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->overwrite( $messages, $newline, $size, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $size, $verbosity] ); } } public function overwriteError($messages, $newline = true, $size = null, $verbosity = self::NORMAL) { switch ($this->mode) { case 'always': return $this->delegate->overwriteError( $messages, $newline, $size, $verbosity ); case 'error': case 'flushing': return $this->onBufferMessage( __FUNCTION__, [$messages, $newline, $size, $verbosity] ); } } }__halt_compiler();----SIGNATURE:----YStAfVnkFdPt1TBnLFxdGODyS5bqZBkobYCnyOm5CbBH0NzuecMLjH3Um5eVK9PWLvbThP4PvcOJ6XCeCc6saPoX7Vf9rKnXFzX5AOzsC3dqst3qzkFUDgs8V4hng52SNsKb3ATK6IoftjYllVUF48RUz13uHFOcKHBeSXICrx9O/nz1cLb6cLaLQxjPR4ZQwuSwKZHiU8ssTUKay3zwRCA5oOxJA1CGCEQh4gtskHNu5kCz5ikbIW9gm0dc+fvlYkBC8KYCm6RxReKknUlg+0BbyokKDCbdS9gnqbw+YvkL0br/3shA9s7dlKItz7NvqimPD2k+x9tX+9SQNAS/JWunRZ7G+XFl5NuLAm58Cj6M8jrL4+ytgCq4bn8dRAeCAwoIrvA+BuAz0R2pOUUaYY1hLYJy+TyGc0jN0E1j+N/SMT+tUplrjWkX+7bLGeBIb1hsAX2iftHx9F0SfU8yXjNLaxXn3Oq9ZYlnpXqdXXgg4Q+QTwh9+GwUYDTmO7KbtvQNjmu4JV4O0Uv78USC4dO5OKgVs1yVxC2u8CcdNqk2TT70bhCmcKBhaGnBobf8wKjic7nzLZtMCQnoz1JnYSdJLi2zJTlcSZ+gf/1QZWATTOOGEbOEaFFIg/uyzuzakMYxFhAXwxk5TVoXcCygVRfeeIpg5jScUPXuX32+IRc=----ATTACHMENT:----MTc3NDE4Mzg5ODIxOTExNyA5Mzk3MjI5MDMwNDYxMTM1IDQ0MTA3NTE0Mjk3NjUwNTY=