Conditions | 6 |
Paths | 4 |
Total Lines | 24 |
Code Lines | 14 |
Lines | 0 |
Ratio | 0 % |
Tests | 14 |
CRAP Score | 6.1979 |
Changes | 0 |
1 | <?php |
||
51 | 1 | private function buildPostContent() |
|
52 | { |
||
53 | 1 | if ($this->itemId === null || $this->itemId === '') { |
|
54 | return false; |
||
55 | } |
||
56 | |||
57 | 1 | $map = []; |
|
58 | 1 | $map['item_id'] = $this->itemId; |
|
59 | |||
60 | 1 | $picListStr = ''; |
|
61 | 1 | foreach ($this->picList as $key => $value) { |
|
62 | 1 | if ($picListStr !== null && $picListStr !== '') { |
|
63 | $picListStr .= ','; |
||
64 | } |
||
65 | 1 | $picListStr .= base64_encode($value); |
|
66 | 1 | } |
|
67 | 1 | $map['pic_list'] = $picListStr; |
|
68 | |||
69 | 1 | $content = $this->buildContent($map); |
|
70 | |||
71 | 1 | $this->body($content); |
|
|
|||
72 | 1 | $this->format('JSON'); |
|
73 | |||
74 | 1 | return true; |
|
75 | } |
||
100 |