Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. EachPromise.php

function EachPromise::promise

@psalm-suppress InvalidNullableReturnType

Overrides PromisorInterface::promise

File

vendor/guzzlehttp/promises/src/EachPromise.php, line 76

Class

EachPromise
Represents a promise that iterates over many promises and invokes side-effect functions in the process.

Namespace

GuzzleHttp\Promise

Code

public function promise() : PromiseInterface {
    if ($this->aggregate) {
        return $this->aggregate;
    }
    try {
        $this->createPromise();
        
        /** @psalm-assert Promise $this->aggregate */
        $this->iterable
            ->rewind();
        $this->refillPending();
    } catch (\Throwable $e) {
        $this->aggregate
            ->reject($e);
    }
    
    /**
     * @psalm-suppress NullableReturnStatement
     */
    return $this->aggregate;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal