Skip to content

Commit 1f526a5

Browse files
committed
Drop Loop::supports
Redefine UnsupportedFeatureException to be only thrown if the system doesn't support the feature. Drivers MUST support it if PCNTL or something similar is available.
1 parent a80e109 commit 1f526a5

File tree

3 files changed

+3
-29
lines changed

3 files changed

+3
-29
lines changed

src/Loop.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274,19 +274,6 @@ public static function setErrorHandler(callable $callback = null)
274274
self::get()->setErrorHandler($callback);
275275
}
276276

277-
/**
278-
* Check whether an optional feature is supported by the current event loop
279-
* driver.
280-
*
281-
* @param int $feature Loop::FEATURE_* constant
282-
*
283-
* @return bool
284-
*/
285-
public static function supports($feature)
286-
{
287-
return self::get()->supports($feature);
288-
}
289-
290277
/**
291278
* Disable construction as this is a static class.
292279
*/

src/LoopDriver.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -146,20 +146,6 @@ public function unreference($watcherId);
146146
*/
147147
public function setErrorHandler(callable $callback = null);
148148

149-
/**
150-
* Check whether an optional features is supported by this implementation
151-
* and system.
152-
*
153-
* Example: If the implementation can handle signals using PCNTL, but the
154-
* PCNTL extension is not available, the feature MUST NOT be marked as
155-
* supported.
156-
*
157-
* @param int $feature FEATURE constant
158-
*
159-
* @return bool
160-
*/
161-
public function supports($feature);
162-
163149
/**
164150
* Get the underlying loop handle.
165151
*

src/UnsupportedFeatureException.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
use Interop\Async;
44

55
/**
6-
* Must be thrown if an optional feature is not supported by the current driver
7-
* or system.
6+
* Must be thrown if a feature is not supported by the system.
7+
*
8+
* This might happen if PCNTL is missing and the loop driver doesn't support another way to dispatch signals.
89
*/
910
class UnsupportedFeatureException extends \RuntimeException
1011
{

0 commit comments

Comments
 (0)