Verzeichnisstruktur phpBB-3.2.0
- Veröffentlicht
- 06.01.2017
So funktioniert es
|
Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück |
Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
Deferred.php
01 <?php
02
03 namespace React\Promise;
04
05 class Deferred implements PromisorInterface
06 {
07 private $promise;
08 private $resolveCallback;
09 private $rejectCallback;
10 private $notifyCallback;
11 private $canceller;
12
13 public function __construct(callable $canceller = null)
14 {
15 $this->canceller = $canceller;
16 }
17
18 public function promise()
19 {
20 if (null === $this->promise) {
21 $this->promise = new Promise(function ($resolve, $reject, $notify) {
22 $this->resolveCallback = $resolve;
23 $this->rejectCallback = $reject;
24 $this->notifyCallback = $notify;
25 }, $this->canceller);
26 }
27
28 return $this->promise;
29 }
30
31 public function resolve($value = null)
32 {
33 $this->promise();
34
35 call_user_func($this->resolveCallback, $value);
36 }
37
38 public function reject($reason = null)
39 {
40 $this->promise();
41
42 call_user_func($this->rejectCallback, $reason);
43 }
44
45 public function notify($update = null)
46 {
47 $this->promise();
48
49 call_user_func($this->notifyCallback, $update);
50 }
51
52 /**
53 * @deprecated 2.2.0
54 * @see Deferred::notify()
55 */
56 public function progress($update = null)
57 {
58 $this->notify($update);
59 }
60 }
61