public static function createFromStream($stream) { $socket = new self('localhost', 0); $socket->setStream($stream); return $socket; }
/** * setUp * * @access public * @return void */ public function setUp() { if (is_null($this->stream)) { $this->stream = \Kafka\Socket::createFromStream(fopen('php://temp', 'w+b')); } $this->stream->rewind(); }