Skip to content

Commit d5bf858

Browse files
authored
Merge pull request #131 from clue-labs/final
Mark all classes as final to discourage inheritance
2 parents 5da8da1 + 578ee5d commit d5bf858

5 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/ExtEventLoop.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*
2121
* @link https://pecl.php.net/package/event
2222
*/
23-
class ExtEventLoop implements LoopInterface
23+
final class ExtEventLoop implements LoopInterface
2424
{
2525
private $eventBase;
2626
private $futureTickQueue;

src/ExtLibevLoop.php

Lines changed: 1 addition & 1 deletion
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 ExtLibevLoop implements LoopInterface
27+
final class ExtLibevLoop implements LoopInterface
2828
{
2929
private $loop;
3030
private $futureTickQueue;

src/ExtLibeventLoop.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@
3333
*
3434
* @link https://pecl.php.net/package/libevent
3535
*/
36-
class ExtLibeventLoop implements LoopInterface
36+
final class ExtLibeventLoop implements LoopInterface
3737
{
38+
/** @internal */
3839
const MICROSECONDS_PER_SECOND = 1000000;
3940

4041
private $eventBase;

src/Factory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
/**
66
* The `Factory` class exists as a convenient way to pick the best available event loop implementation.
77
*/
8-
class Factory
8+
final class Factory
99
{
1010
/**
1111
* Creates a new event loop instance

src/StreamSelectLoop.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,9 @@
5050
*
5151
* @link http://php.net/manual/en/function.stream-select.php
5252
*/
53-
class StreamSelectLoop implements LoopInterface
53+
final class StreamSelectLoop implements LoopInterface
5454
{
55+
/** @internal */
5556
const MICROSECONDS_PER_SECOND = 1000000;
5657

5758
private $futureTickQueue;
@@ -268,7 +269,7 @@ private function waitForStreamActivity($timeout)
268269
* @return integer|false The total number of streams that are ready for read/write.
269270
* Can return false if stream_select() is interrupted by a signal.
270271
*/
271-
protected function streamSelect(array &$read, array &$write, $timeout)
272+
private function streamSelect(array &$read, array &$write, $timeout)
272273
{
273274
if ($read || $write) {
274275
$except = null;

0 commit comments

Comments
 (0)