From c5fc66a78ee38d7ac9195a37bacaf940eb3f65ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A1chym=20Tou=C5=A1ek?= Date: Thu, 23 Sep 2021 20:43:08 +0200 Subject: [PATCH] Fix EventDriver (#360) --- lib/Loop/EventDriver.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/Loop/EventDriver.php b/lib/Loop/EventDriver.php index d3cb28b1..c4a9b9b5 100644 --- a/lib/Loop/EventDriver.php +++ b/lib/Loop/EventDriver.php @@ -39,8 +39,12 @@ class EventDriver extends Driver public function __construct() { - /** @psalm-suppress TooFewArguments https://github.com/JetBrains/phpstorm-stubs/pull/763 */ - $this->handle = new \EventBase; + $config = new \EventConfig(); + if (\DIRECTORY_SEPARATOR !== '\\') { + $config->requireFeatures(\EventConfig::FEATURE_FDS); + } + + $this->handle = new \EventBase($config); $this->nowOffset = getCurrentTime(); $this->now = \random_int(0, $this->nowOffset); $this->nowOffset -= $this->now;