Amp\Artax\FormBody::generateMultipartIteratorFromFields PHP Method

generateMultipartIteratorFromFields() private method

private generateMultipartIteratorFromFields ( array $fields )
$fields array
    private function generateMultipartIteratorFromFields(array $fields)
    {
        foreach ($fields as $key => $field) {
            $fields[$key] = $field instanceof FileBody ? $field->getBody() : $field;
        }
        $promisor = new Deferred();
        \Amp\all($fields)->when(function ($error, $result) use($promisor) {
            if ($error) {
                $promisor->fail($error);
            } else {
                $this->cachedBody = $result;
                $promisor->succeed(new MultipartIterator($result));
            }
        });
        return $promisor->promise();
    }