1
0
mirror of https://github.com/danog/amp.git synced 2024-11-27 04:24:42 +01:00

Require Reactor when instantiating Promisor implementations

This commit is contained in:
Daniel Lowrey 2014-11-24 23:17:43 -05:00
parent 1cb293b776
commit 0e9c4a1818
3 changed files with 5 additions and 6 deletions

View File

@ -14,8 +14,8 @@ class Future implements Promisor, Promise {
/**
* @param \Amp\Reactor $reactor
*/
public function __construct(Reactor $reactor = null) {
$this->reactor = $reactor ?: reactor();
public function __construct(Reactor $reactor) {
$this->reactor = $reactor;
}
/**

View File

@ -16,8 +16,7 @@ class PrivateFuture implements Promisor {
/**
* @param \Amp\Reactor $reactor
*/
public function __construct(Reactor $reactor = null) {
$reactor = $reactor ?: ReactorFactory::select();
public function __construct(Reactor $reactor) {
$unresolved = new Unresolved($reactor);
$resolver = function(\Exception $error = null, $result = null) {
$this->resolve($error, $result); // bound to private Unresolved::resolve()

View File

@ -18,8 +18,8 @@ class Unresolved implements Promise {
/**
* @param \Amp\Reactor $reactor
*/
public function __construct(Reactor $reactor = null) {
$this->reactor = $reactor ?: ReactorFactory::select();
public function __construct(Reactor $reactor) {
$this->reactor = $reactor;
}
/**