Skip to content

Commit 5db28c5

Browse files
committed
Throw in LibUvLoop when uv ext is missing
1 parent 5bd583a commit 5db28c5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/LibUvLoop.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ final class LibUvLoop implements LoopInterface
2424

2525
public function __construct()
2626
{
27+
if (!function_exists('uv_loop_new')) {
28+
throw new BadMethodCallException('Cannot create LibUvLoop, ext-uv extension missing');
29+
}
30+
2731
$this->uv = \uv_loop_new();
2832
$this->futureTickQueue = new FutureTickQueue();
2933
$this->timerEvents = new SplObjectStorage();

0 commit comments

Comments
 (0)