@@ -31,7 +31,7 @@ |
||
31 | 31 | $q = new Promise(); |
32 | 32 | $value = $this->value; |
33 | 33 | |
34 | - Context\ContextStack::create(new TaskQueue)->store(static function () use ($q, $value, $onFulfilled) { |
|
34 | + Context\ContextStack::create(new TaskQueue)->store(static function() use ($q, $value, $onFulfilled) { |
|
35 | 35 | if ($q->currentState() === self::STATE_PENDING) { |
36 | 36 | try { |
37 | 37 | $q->resolve($onFulfilled($value)); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | $index = $this->state === self::STATE_FULFILLED ? 1 : 2; |
86 | 86 | |
87 | 87 | Context\ContextStack::create(new TaskQueue)->store( |
88 | - static function () use ($index, $context, $value) { |
|
88 | + static function() use ($index, $context, $value) { |
|
89 | 89 | foreach ($context as $c) { |
90 | 90 | self::invokeContext($c, $index, $value); |
91 | 91 | } |
@@ -96,12 +96,12 @@ discard block |
||
96 | 96 | $value->context = array_merge($value->context, $context); |
97 | 97 | } else { |
98 | 98 | $value->then( |
99 | - static function ($value) use ($context) { |
|
99 | + static function($value) use ($context) { |
|
100 | 100 | foreach ($context as $c) { |
101 | 101 | self::invokeContext($c, 1, $value); |
102 | 102 | } |
103 | 103 | }, |
104 | - static function ($reason) use ($context) { |
|
104 | + static function($reason) use ($context) { |
|
105 | 105 | foreach ($context as $c) { |
106 | 106 | self::invokeContext($c, 2, $reason); |
107 | 107 | } |
@@ -31,7 +31,7 @@ |
||
31 | 31 | $q = new Promise(); |
32 | 32 | $reason = $this->reason; |
33 | 33 | |
34 | - Context\ContextStack::create(new TaskQueue)->store(static function () use ($q, $reason, $onRejected) { |
|
34 | + Context\ContextStack::create(new TaskQueue)->store(static function() use ($q, $reason, $onRejected) { |
|
35 | 35 | if ($q->currentState() === self::STATE_PENDING) { |
36 | 36 | try { |
37 | 37 | $q->resolve($onRejected($reason)); |
@@ -31,7 +31,7 @@ |
||
31 | 31 | /** |
32 | 32 | * Store a value into task queueing stack. |
33 | 33 | * |
34 | - * @param \Closure|array $handler |
|
34 | + * @param \Closure $handler |
|
35 | 35 | * @param mixed $value |
36 | 36 | */ |
37 | 37 | public function store($handler, $value = []) |
@@ -4,9 +4,9 @@ |
||
4 | 4 | |
5 | 5 | interface PromiseInterface |
6 | 6 | { |
7 | - /** |
|
8 | - * Indicates the state of current promise is pending. |
|
9 | - */ |
|
7 | + /** |
|
8 | + * Indicates the state of current promise is pending. |
|
9 | + */ |
|
10 | 10 | const STATE_PENDING = 1; |
11 | 11 | |
12 | 12 | /** |