{
private $client;
private $run;
- private $fds = [
- "R" => [],
- "W" => []
- ];
- private $R = [];
- private $W = [];
+ private $fds = array(
+ "R" => array(),
+ "W" => array()
+ );
+ private $R = array();
+ private $W = array();
private $timeout = 1000;
function __construct(http\Client $client) {
$this->client = $client;
}
- function init(callable $run) {
+ function init($run) {
$this->run = $run;
}
- function timer($timeout_ms) {
+ function timer(int $timeout_ms) {
echo "T";
$this->timeout = $timeout_ms;
}
- function socket($socket, $action) {
+ function socket($socket, int $action) {
echo "S";
switch ($action) {
return count($this->client);
}
- function wait($timeout_ms = null) {
+ function wait(int $timeout_ms = null) {
echo "W";
if ($timeout_ms === null) {
server("proxy.inc", function($port) {
$client = new http\Client;
- $client->configure([
+ $client->configure(array(
"use_eventloop" => new UserHandler($client)
- ]);
+ ));
$client->enqueue(new http\Client\Request("GET", "http://localhost:$port/"), function($r) {
var_dump($r->getResponseCode());
});