public function __construct($reason = null) { if ($reason instanceof PromiseInterface) { throw new InvalidArgumentException('You cannot create PromiseCancelled with a promise. Use Promise::doCancel($promiseOrValue) instead.'); } $this->reason = $reason; }