Skip to content

Commit 88d35a6

Browse files
committed
Replaced constant references with fully qualified constant references
1 parent b048bd7 commit 88d35a6

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/ExtEventLoop.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function addReadStream($stream, $listener)
6969

7070
// ext-event does not increase refcount on stream resources for PHP 7+
7171
// manually keep track of stream resource to prevent premature garbage collection
72-
if (PHP_VERSION_ID >= 70000) {
72+
if (\PHP_VERSION_ID >= 70000) {
7373
$this->readRefs[$key] = $stream;
7474
}
7575
}
@@ -88,7 +88,7 @@ public function addWriteStream($stream, $listener)
8888

8989
// ext-event does not increase refcount on stream resources for PHP 7+
9090
// manually keep track of stream resource to prevent premature garbage collection
91-
if (PHP_VERSION_ID >= 70000) {
91+
if (\PHP_VERSION_ID >= 70000) {
9292
$this->writeRefs[$key] = $stream;
9393
}
9494
}

src/ExtLibeventLoop.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public function addReadStream($stream, $listener)
7474
}
7575

7676
$event = \event_new();
77-
\event_set($event, $stream, EV_PERSIST | EV_READ, $this->streamCallback);
77+
\event_set($event, $stream, \EV_PERSIST | \EV_READ, $this->streamCallback);
7878
\event_base_set($event, $this->eventBase);
7979
\event_add($event);
8080

@@ -90,7 +90,7 @@ public function addWriteStream($stream, $listener)
9090
}
9191

9292
$event = \event_new();
93-
\event_set($event, $stream, EV_PERSIST | EV_WRITE, $this->streamCallback);
93+
\event_set($event, $stream, \EV_PERSIST | \EV_WRITE, $this->streamCallback);
9494
\event_base_set($event, $this->eventBase);
9595
\event_add($event);
9696

@@ -170,7 +170,7 @@ public function addSignal($signal, $listener)
170170

171171
if (!isset($this->signalEvents[$signal])) {
172172
$this->signalEvents[$signal] = \event_new();
173-
\event_set($this->signalEvents[$signal], $signal, EV_PERSIST | EV_SIGNAL, array($this->signals, 'call'));
173+
\event_set($this->signalEvents[$signal], $signal, \EV_PERSIST | \EV_SIGNAL, array($this->signals, 'call'));
174174
\event_base_set($this->signalEvents[$signal], $this->eventBase);
175175
\event_add($this->signalEvents[$signal]);
176176
}
@@ -194,9 +194,9 @@ public function run()
194194
while ($this->running) {
195195
$this->futureTickQueue->tick();
196196

197-
$flags = EVLOOP_ONCE;
197+
$flags = \EVLOOP_ONCE;
198198
if (!$this->running || !$this->futureTickQueue->isEmpty()) {
199-
$flags |= EVLOOP_NONBLOCK;
199+
$flags |= \EVLOOP_NONBLOCK;
200200
} elseif (!$this->readEvents && !$this->writeEvents && !$this->timerEvents->count() && $this->signals->isEmpty()) {
201201
break;
202202
}
@@ -271,11 +271,11 @@ private function createStreamCallback()
271271
$this->streamCallback = function ($stream, $flags) use (&$read, &$write) {
272272
$key = (int) $stream;
273273

274-
if (EV_READ === (EV_READ & $flags) && isset($read[$key])) {
274+
if (\EV_READ === (\EV_READ & $flags) && isset($read[$key])) {
275275
\call_user_func($read[$key], $stream);
276276
}
277277

278-
if (EV_WRITE === (EV_WRITE & $flags) && isset($write[$key])) {
278+
if (\EV_WRITE === (\EV_WRITE & $flags) && isset($write[$key])) {
279279
\call_user_func($write[$key], $stream);
280280
}
281281
};

src/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public static function create()
3030
return new ExtEvLoop();
3131
} elseif (\class_exists('EventBase', false)) {
3232
return new ExtEventLoop();
33-
} elseif (\function_exists('event_base_new') && PHP_VERSION_ID < 70000) {
33+
} elseif (\function_exists('event_base_new') && \PHP_VERSION_ID < 70000) {
3434
// only use ext-libevent on PHP < 7 for now
3535
return new ExtLibeventLoop();
3636
}

src/StreamSelectLoop.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function removeSignal($signal, $listener)
163163
$this->signals->remove($signal, $listener);
164164

165165
if ($this->signals->count($signal) === 0) {
166-
\pcntl_signal($signal, SIG_DFL);
166+
\pcntl_signal($signal, \SIG_DFL);
167167
}
168168
}
169169

@@ -190,7 +190,7 @@ public function run()
190190
// Ensure we do not exceed maximum integer size, which may
191191
// cause the loop to tick once every ~35min on 32bit systems.
192192
$timeout *= self::MICROSECONDS_PER_SECOND;
193-
$timeout = $timeout > PHP_INT_MAX ? PHP_INT_MAX : (int)$timeout;
193+
$timeout = $timeout > \PHP_INT_MAX ? \PHP_INT_MAX : (int)$timeout;
194194
}
195195

196196
// The only possible event is stream or signal activity, so wait forever ...

0 commit comments

Comments
 (0)