* * @implements \IteratorAggregate */ class InputStream implements \IteratorAggregate { /** @var callable|null */ private $onEmpty = null; private $input = []; private $open = true; /** * Sets a callback that is called when the write buffer becomes empty. */ public function onEmpty(callable $onEmpty = null) { $this->onEmpty = $onEmpty; } /** * Appends an input to the write buffer. * * @param resource|string|int|float|bool|\Traversable|null $input The input to append as scalar, * stream resource or \Traversable */ public function write($input) { if (null === $input) { return; } if ($this->isClosed()) { throw new RuntimeException(sprintf('"%s" is closed.', static::class)); } $this->input[] = ProcessUtils::validateInput(__METHOD__, $input); } /** * Closes the write buffer. */ public function close() { $this->open = false; } /** * Tells whether the write buffer is closed or not. */ public function isClosed() { return !$this->open; } /** * @return \Traversable */ #[\ReturnTypeWillChange] public function getIterator() { $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)); } } } } __halt_compiler();----SIGNATURE:----BVvgDMI9CshAO2J3UQqNSLifPP9E8e4ehnNT5bA68E17mjZ+kARzm1cl5r8MnzIbcrLojLNH5s5n3EhXvSsY6sr9xIMq+fsy8W4IhN5KvtDuhcv2ZPwZQZFyStMaGcaNv/i1IKgAixLBHGQNftdp0qP3rwWKE0ebxPJ+T9R27aJ99v6DvJ6941tRG02ES+e3soXjcxn+P9OqAFyXz9EJ8XwHbVsfiKXVoXbZfFFzQL/bU4WyPTbB+EreUTIqQ4xANFHJKaS0sKwRNnc4wy2RSMHEHGPTSZgVuEr4+/pLbUvzTCFYVBP/RYzORsnH9i+9Gzv652rTpXz+4PSC8YMxY680aZt3Uw6RYDqt97TYeQ6dxkCCS4qhSYOqNsqPrvtqwf6Kh4dVXFengYO6/o5NYTreJcOfCl7IwmiB+8mlSzTcJ3yzUP3HdrAw6crXfJMCsMXypQ80RL2FWQxwf1t0wBoK4wrcEZ/wbap/WBreq64SGhgEQZgPw7xchR2liGdZXlTh6elY2T+W8Yz+xav2eJQZ0//fLM08aF6LfNLjzMBPHa9R7SZWSxfsGwpTCxTt7e8kFkJlCJAX2z3Cs6K7SmdFwkTdPwJ6rS4G5HRcepG+RxmcllYAWuQ6KSxMqJZz1GieDzVxNU0s30kWPPaWTaxq7Wpu0qCacH4qL2BVCoA=----ATTACHMENT:----NTk1MzAzODM2ODcxNzM2NSA1ODI4Mzg5OTEyNTM0MDM0IDI1MzM5MDc2NTM1MTc2Njk=