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

Breadcrumb

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

function InputStream::getIterator

File

vendor/symfony/process/InputStream.php, line 70

Class

InputStream
Provides a way to continuously write to the input of a Process until the InputStream is closed.

Namespace

Symfony\Component\Process

Code

public function getIterator() : \Traversable {
    $this->open = true;
    while ($this->open || $this->input) {
        if (!$this->input) {
            (yield '');
            continue;
        }
        $current = array_shift($this->input);
        if ($current instanceof \Iterator) {
            yield from $current;
        }
        else {
            (yield $current);
        }
        if (!$this->input && $this->open && null !== ($onEmpty = $this->onEmpty)) {
            $this->write($onEmpty($this));
        }
    }
}

API Navigation

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