Skip to content

Commit e317271

Browse files
committed
Consistent naming for event loop extensions
1 parent ffe26e9 commit e317271

7 files changed

+28
-28
lines changed

README.md

+13-13
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ For the code of the current stable 0.4.x release, checkout the
2222
* [create()](#create)
2323
* [Loop implementations](#loop-implementations)
2424
* [StreamSelectLoop](#streamselectloop)
25-
* [LibEventLoop](#libeventloop)
26-
* [LibEvLoop](#libevloop)
2725
* [ExtEventLoop](#exteventloop)
26+
* [ExtLibeventLoop](#extlibeventloop)
27+
* [ExtLibevLoop](#extlibevloop)
2828
* [LoopInterface](#loopinterface)
2929
* [addtimer()](#addtimer)
3030
* [addPeriodicTimer()](#addperiodictimer)
@@ -184,7 +184,16 @@ It is commonly installed as part of many PHP distributions.
184184
If this extension is missing (or you're running on Windows), signal handling is
185185
not supported and throws a `BadMethodCallException` instead.
186186

187-
#### LibEventLoop
187+
#### ExtEventLoop
188+
189+
An `ext-event` based event loop.
190+
191+
This uses the [`event` PECL extension](https://pecl.php.net/package/event).
192+
It supports the same backends as libevent.
193+
194+
This loop is known to work with PHP 5.4 through PHP 7+.
195+
196+
#### ExtLibeventLoop
188197

189198
An `ext-libevent` based event loop.
190199

@@ -198,7 +207,7 @@ To reiterate: Using this event loop on PHP 7 is not recommended.
198207
Accordingly, the [`Factory`](#factory) will not try to use this event loop on
199208
PHP 7.
200209

201-
#### LibEvLoop
210+
#### ExtLibevLoop
202211

203212
An `ext-libev` based event loop.
204213

@@ -209,15 +218,6 @@ This loop does only work with PHP 5.
209218
An update for PHP 7 is [unlikely](https://github.com/m4rw3r/php-libev/issues/8)
210219
to happen any time soon.
211220

212-
#### ExtEventLoop
213-
214-
An `ext-event` based event loop.
215-
216-
This uses the [`event` PECL extension](https://pecl.php.net/package/event).
217-
It supports the same backends as libevent.
218-
219-
This loop is known to work with PHP 5.4 through PHP 7+.
220-
221221
### LoopInterface
222222

223223
#### addTimer()

composer.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"phpunit/phpunit": "~4.8.35 || ^5.7 || ^6.4"
1111
},
1212
"suggest": {
13-
"ext-libevent": ">=0.1.0 for LibEventLoop and PHP5 only",
1413
"ext-event": "~1.0 for ExtEventLoop",
15-
"ext-libev": "for LibEvLoop",
16-
"ext-pcntl": "For signals support when using the stream_select loop"
14+
"ext-libevent": ">=0.1.0 for ExtLibeventLoop and PHP 5 only",
15+
"ext-libev": "for ExtLibevLoop and PHP 5 only",
16+
"ext-pcntl": "For signal handling support when using the StreamSelectLoop"
1717
},
1818
"autoload": {
1919
"psr-4": {

src/LibEvLoop.php src/ExtLibevLoop.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @see https://github.com/m4rw3r/php-libev
2525
* @see https://gist.github.com/1688204
2626
*/
27-
class LibEvLoop implements LoopInterface
27+
class ExtLibevLoop implements LoopInterface
2828
{
2929
private $loop;
3030
private $futureTickQueue;

src/LibEventLoop.php src/ExtLibeventLoop.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
*
2525
* @link https://pecl.php.net/package/libevent
2626
*/
27-
class LibEventLoop implements LoopInterface
27+
class ExtLibeventLoop implements LoopInterface
2828
{
2929
const MICROSECONDS_PER_SECOND = 1000000;
3030

src/Factory.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ public static function create()
2525
{
2626
// @codeCoverageIgnoreStart
2727
if (class_exists('libev\EventLoop', false)) {
28-
return new LibEvLoop;
28+
return new ExtLibevLoop();
2929
} elseif (class_exists('EventBase', false)) {
30-
return new ExtEventLoop;
30+
return new ExtEventLoop();
3131
} elseif (function_exists('event_base_new') && PHP_VERSION_ID < 70000) {
3232
// only use ext-libevent on PHP < 7 for now
33-
return new LibEventLoop();
33+
return new ExtLibeventLoop();
3434
}
3535

3636
return new StreamSelectLoop();

tests/LibEvLoopTest.php tests/ExtLibevLoopTest.php

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,21 @@
22

33
namespace React\Tests\EventLoop;
44

5-
use React\EventLoop\LibEvLoop;
5+
use React\EventLoop\ExtLibevLoop;
66

7-
class LibEvLoopTest extends AbstractLoopTest
7+
class ExtLibevLoopTest extends AbstractLoopTest
88
{
99
public function createLoop()
1010
{
1111
if (!class_exists('libev\EventLoop')) {
1212
$this->markTestSkipped('libev tests skipped because ext-libev is not installed.');
1313
}
1414

15-
return new LibEvLoop();
15+
return new ExtLibevLoop();
1616
}
1717

1818
public function testLibEvConstructor()
1919
{
20-
$loop = new LibEvLoop();
20+
$loop = new ExtLibevLoop();
2121
}
2222
}

tests/LibEventLoopTest.php tests/ExtLibeventLoopTest.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
namespace React\Tests\EventLoop;
44

5-
use React\EventLoop\LibEventLoop;
5+
use React\EventLoop\ExtLibeventLoop;
66

7-
class LibEventLoopTest extends AbstractLoopTest
7+
class ExtLibeventLoopTest extends AbstractLoopTest
88
{
99
private $fifoPath;
1010

@@ -18,7 +18,7 @@ public function createLoop()
1818
$this->markTestSkipped('libevent tests skipped because ext-libevent is not installed.');
1919
}
2020

21-
return new LibEventLoop();
21+
return new ExtLibeventLoop();
2222
}
2323

2424
public function tearDown()

0 commit comments

Comments
 (0)