<?php

namespace React\Promise;


interface PromiseInterface
{
    
    public function then(?callable $onFulfilled = null, ?callable $onRejected = null): PromiseInterface;

    
    public function catch(callable $onRejected): PromiseInterface;

    
    public function finally(callable $onFulfilledOrRejected): PromiseInterface;

    
    public function cancel(): void;

    
    public function otherwise(callable $onRejected): PromiseInterface;

    
    public function always(callable $onFulfilledOrRejected): PromiseInterface;
}
