1
0
mirror of https://github.com/danog/amp.git synced 2025-01-22 13:21:16 +01:00

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.
This commit is contained in:
Markus Staab 2015-04-27 17:48:58 +02:00
parent 87ca482e14
commit f004d83cf1
2 changed files with 5 additions and 5 deletions

View File

@ -1,6 +1,8 @@
### master ### master
- n/a > **BC BREAKS:**
- Dropped `\Amp\getReactor` param `$forceNew` as it doesn't has a proper use case.
v0.16.0 v0.16.0
------- -------

View File

@ -8,12 +8,10 @@ namespace Amp;
* @param bool $forceNew If true return a new Reactor instance (but don't store it for future use) * @param bool $forceNew If true return a new Reactor instance (but don't store it for future use)
* @return Reactor * @return Reactor
*/ */
function getReactor($forceNew = false) { function getReactor() {
static $reactor; static $reactor;
if ($forceNew) { if ($reactor) {
return chooseReactor();
} elseif ($reactor) {
return $reactor; return $reactor;
} else { } else {
return $reactor = chooseReactor(); return $reactor = chooseReactor();