onCancel = $onCancel; } public function then(callable $onFulfilled = null, callable $onRejected = null): self { return new self(); } public function cancel(): void { $this->cancelCalled = true; if (is_callable($this->onCancel)) { ($this->onCancel)(); } } }