Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loop::setErrorHandler should return the last error handler #118

Merged
merged 1 commit into from
Dec 22, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Loop.php
Original file line number Diff line number Diff line change
Expand Up @@ -388,12 +388,12 @@ public static function getState($key)
* @param callable(\Throwable|\Exception $error)|null $callback The callback to execute. `null` will clear the
* current handler.
*
* @return void
* @return callable(\Throwable|\Exception $error)|null The previous handler, `null` if there was none.
*/
public static function setErrorHandler(callable $callback = null)
{
$driver = self::$driver ?: self::get();
$driver->setErrorHandler($callback);
return $driver->setErrorHandler($callback);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Loop/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ final public function getState($key)
* @param callable(\Throwable|\Exception $error)|null $callback The callback to execute. `null` will clear the
* current handler.
*
* @return void
* @return callable(\Throwable|\Exception $error)|null The previous handler, `null` if there was none.
*/
abstract public function setErrorHandler(callable $callback = null);

Expand Down