/** * {@inheritdoc} * * @return \Psr\Http\Message\ResponseInterface|DockerRawStream */ public function attach($id, $parameters = [], $fetch = self::FETCH_STREAM) { $response = parent::attach($id, $parameters, $fetch); if ($response->getStatusCode() == 200 && DockerRawStream::HEADER == $response->getHeaderLine('Content-Type')) { if ($fetch == self::FETCH_STREAM) { return new DockerRawStream($response->getBody()); } } return $response; }