![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/webonyx/graphql-php/src/Executor/Promise/ |
<?php declare(strict_types=1); namespace GraphQL\Executor\Promise; use Amp\Promise as AmpPromise; use GraphQL\Error\InvariantViolation; use GraphQL\Executor\Promise\Adapter\SyncPromise; use React\Promise\PromiseInterface as ReactPromise; /** * Convenience wrapper for promises represented by Promise Adapter. */ class Promise { /** @var SyncPromise|ReactPromise<mixed>|AmpPromise<mixed> */ public $adoptedPromise; private PromiseAdapter $adapter; /** * @param mixed $adoptedPromise * * @throws InvariantViolation */ public function __construct($adoptedPromise, PromiseAdapter $adapter) { if ($adoptedPromise instanceof self) { throw new InvariantViolation('Expecting promise from adapted system, got ' . self::class); } $this->adoptedPromise = $adoptedPromise; $this->adapter = $adapter; } public function then(callable $onFulfilled = null, callable $onRejected = null): Promise { return $this->adapter->then($this, $onFulfilled, $onRejected); } }