Conditions | 3 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Tests | 13 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
21 | 2 | protected function prepareQuery(): parent |
|
22 | { |
||
23 | 2 | $content = []; |
|
24 | 2 | foreach ($this->content as $key => $item) { |
|
25 | 2 | if ($item instanceof Protocols\Http\Query\File) { |
|
26 | 1 | $content[$key] = [ |
|
27 | 1 | 'type' => 'file', |
|
28 | 1 | 'filename' => $item->getFilename(), |
|
29 | 1 | 'mimetype' => $item->getMimeType(), |
|
30 | 1 | 'content64' => base64_encode($item->getContent()), |
|
31 | 1 | ]; |
|
32 | } else { |
||
33 | 2 | $content[$key] = $item->getContent(); |
|
34 | } |
||
35 | } |
||
36 | 2 | $this->contentLength += intval(fwrite($this->contentStream, strval(json_encode($content)))); |
|
37 | 2 | return $this; |
|
|
|||
38 | } |
||
40 |