From f004d83cf16b39aeeb6dbd15382a41eb5b1cdafd Mon Sep 17 00:00:00 2001 From: Markus Staab Date: Mon, 27 Apr 2015 17:48:58 +0200 Subject: [PATCH] drop $forceNew param in getReactor() At runtime there are no use cases where one would like to re-create the reactor. only multi instance scenario is unit tests, but those don't need to be covered in the public api. --- CHANGELOG.md | 4 +++- lib/functions.php | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d9fd63..0b5296e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,8 @@ ### master -- n/a +> **BC BREAKS:** + +- Dropped `\Amp\getReactor` param `$forceNew` as it doesn't has a proper use case. v0.16.0 ------- diff --git a/lib/functions.php b/lib/functions.php index d324fa9..28ac69f 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -8,12 +8,10 @@ namespace Amp; * @param bool $forceNew If true return a new Reactor instance (but don't store it for future use) * @return Reactor */ -function getReactor($forceNew = false) { +function getReactor() { static $reactor; - if ($forceNew) { - return chooseReactor(); - } elseif ($reactor) { + if ($reactor) { return $reactor; } else { return $reactor = chooseReactor();