namespace seekat\API;
use Exception;
-use http\Client;
-use http\Client\Request;
-use http\Client\Response;
+use http\ {
+ Client,
+ Client\Request,
+ Client\Response
+};
use React\Promise\Deferred;
use seekat\API;
use SplObserver;
{
/**
* The endpoint
- * @var \seekat\API
+ * @var API
*/
private $api;
/**
* Create a deferred promise for the response of $request
*
- * @var \seekat\API $api The endpoint of the request
- * @var Client $client The HTTP client to send the request
- * @var Request The request to execute
+ * @param API $api The endpoint of the request
+ * @param Client $client The HTTP client to send the request
+ * @param Request $request The request to execute
*/
function __construct(API $api, Client $client, Request $request) {
$this->api = $api;
parent::__construct(function($resolve, $reject) {
return $this->cancel($resolve, $reject);
});
-
+
$client->attach($this);
$client->enqueue($request);
/* start off */
*
* Import the response's data on success and resolve the promise.
*
- * @var SplSubject $client The observed HTTP client
- * @var Request The request which generated the update
- * @var object $progress The progress information
+ * @param SplSubject $client The observed HTTP client
+ * @param Request $request The request which generated the update
+ * @param object $progress The progress information
*/
function update(SplSubject $client, Request $request = null, $progress = null) {
if ($request !== $this->request) {