diff --git a/.State b/.State deleted file mode 100644 index a604de4..0000000 --- a/.State +++ /dev/null @@ -1 +0,0 @@ -finalized diff --git a/Exception.php b/Source/Exception.php similarity index 95% rename from Exception.php rename to Source/Exception.php index f50d893..d47f282 100644 --- a/Exception.php +++ b/Source/Exception.php @@ -1,5 +1,7 @@ _event) { $this->_response->writeAll('event: ' . $this->_event . "\n"); @@ -162,11 +154,8 @@ public function send($data, $id = null) /** * Set the reconnection time for the client. - * - * @param int $ms Time in milliseconds. - * @return void */ - public function setReconnectionTime($ms) + public function setReconnectionTime(int $ms) { $this->_response->writeAll('retry: ' . $ms . "\n\n"); $this->_response->flush(true); @@ -176,12 +165,8 @@ public function setReconnectionTime($ms) /** * Select an event where to send data. - * - * @param string $event Event. - * @return \Hoa\Eventsource\Server - * @throws \Hoa\Eventsource\Exception */ - public function __get($event) + public function __get(string $event): self { if (false === (bool) preg_match('##u', $event)) { throw new Exception( @@ -206,10 +191,8 @@ public function __get($event) /** * Get last ID. - * - * @return string */ - public function getLastId() + public function getLastId(): string { return Http\Runtime::getHeader('Last-Event-ID') ?: ''; } diff --git a/composer.json b/composer.json index 4ab4031..14a2dc3 100644 --- a/composer.json +++ b/composer.json @@ -24,16 +24,17 @@ "source": "https://central.hoa-project.net/Resource/Library/Eventsource" }, "require": { - "hoa/consistency": "~1.0", - "hoa/exception" : "~1.0", - "hoa/http" : "~1.0" + "php" : ">=7.1", + "hoa/consistency": "dev-master", + "hoa/exception" : "dev-master", + "hoa/http" : "dev-master" }, "require-dev": { - "hoa/test": "~2.0" + "hoa/test": "dev-master" }, "autoload": { "psr-4": { - "Hoa\\Eventsource\\": "." + "Hoa\\Eventsource\\": "Source" } }, "extra": {