Permalink
Browse files

Use BufferedSink::createPromise() shortcut

  • Loading branch information...
1 parent a17b22d commit f44000f4449a9c3e17aff6a9f0908a2b9b6e3c42 @igorw igorw committed Oct 20, 2013
Showing with 1 addition and 10 deletions.
  1. +1 −10 src/React/Whois/Client.php
@@ -39,21 +39,12 @@ public function queryWhoisServer($domain, $ip)
$conn = call_user_func($this->connFactory, $ip);
$conn->write("$domain\r\n");
- return $this
- ->streamGetContents($conn)
+ return BufferedSink::createPromise($conn)
->then(array($this, 'normalizeLinefeeds'));
}
public function normalizeLinefeeds($data)
{
return str_replace("\r\n", "\n", $data);
}
-
- public function streamGetContents(ReadableStreamInterface $input)
- {
- $sink = new BufferedSink();
- $input->pipe($sink);
-
- return $sink->promise();
- }
}

0 comments on commit f44000f

Please sign in to comment.