Kraken\Promise\Promise::resolve PHP Method

resolve() public method

public resolve ( $value = null )
    public function resolve($value = null)
    {
        if (null !== $this->result || $value === $this) {
            return $this->result;
        }
        return $this->settle(self::doResolve($value));
    }

Usage Example

 /**
  * @override
  * @inheritDoc
  */
 protected function command($params = [])
 {
     $runtime = $this->runtime;
     $promise = new Promise();
     $runtime->once('destroy', function () use($promise) {
         $promise->resolve('Runtime has been destroyed');
     });
     $runtime->destroy()->then(null, function ($ex) use($promise) {
         $promise->reject($ex);
     }, function ($ex) use($promise) {
         $promise->cancel($ex);
     });
     return $promise;
 }
All Usage Examples Of Kraken\Promise\Promise::resolve