PluginProbe
StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more / 2.5.7
StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more v2.5.7
3.7.2 3.7.1 3.7.0 3.6.0 3.6.1 3.5.2 trunk 2.0 2.1 2.2 2.3 2.4 2.4.1 2.4.2 2.4.3 2.5.0 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.6.0 2.6.1 All 73 releases
stockpack / vendor / guzzlehttp / promises / tests / NotPromiseInstance.php

NotPromiseInstance.php in StockPack – Stock photos and AI images from Unsplash, Adobe Stock, Freepik and more 2.5.7, at vendor/guzzlehttp/promises/tests/NotPromiseInstance.php

51 lines 961 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 namespace GuzzleHttp\Promise\Tests;
3
4 use GuzzleHttp\Promise\Promise;
5 use GuzzleHttp\Promise\PromiseInterface;
6
7 class NotPromiseInstance extends Thennable implements PromiseInterface
8 {
9 private $nextPromise = null;
10
11 public function __construct()
12 {
13 $this->nextPromise = new Promise();
14 }
15
16 public function then(callable $res = null, callable $rej = null)
17 {
18 return $this->nextPromise->then($res, $rej);
19 }
20
21 public function otherwise(callable $onRejected)
22 {
23 return $this->then($onRejected);
24 }
25
26 public function resolve($value)
27 {
28 $this->nextPromise->resolve($value);
29 }
30
31 public function reject($reason)
32 {
33 $this->nextPromise->reject($reason);
34 }
35
36 public function wait($unwrap = true, $defaultResolution = null)
37 {
38
39 }
40
41 public function cancel()
42 {
43
44 }
45
46 public function getState()
47 {
48 return $this->nextPromise->getState();
49 }
50 }
51