POSTFile::setBody()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 3
Bugs 1 Features 0
Metric Value
c 3
b 1
f 0
dl 0
loc 5
ccs 0
cts 4
cp 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * ©[2016] SugarCRM Inc.  Licensed by SugarCRM under the Apache 2.0 license.
4
 */
5
6
namespace SugarAPI\SDK\Request;
7
8
class POSTFile extends POST {
9
10
    /**
11
     * @inheritdoc
12
     */
13
    protected static $_DEFAULT_HEADERS = array(
14
        "Content-Type: multipart/form-data"
15
    );
16
17
    /**
18
     * Overrides POST setBody, so that Body is not json encoded
19
     * @inheritdoc
20
     */
21
    public function setBody($body){
22
        $this->body = $body;
23
        $this->setOption(CURLOPT_POSTFIELDS, $this->body);
24
        return $this;
25
    }
26
27
}