$paths * @return \Generator */ public function getMany(array $paths): \Generator { foreach ($paths as $path) { $fh = $this->get($path); try { $data = stream_get_contents($fh); } finally { fclose($fh); } if ($data === false) { throw new BackendException('Read failed for ' . $path); } yield $path => $data; } } }