GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Push — master ( ce9742...4c1af4 )
by sunsky
11:33
created

Form::encode()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2
1
<?php
2
/**
3
 *
4
 * @author  [email protected] [email protected]
5
 * Date: 2017/6/16
6
 * Time: 10:02
7
 * @version $Id: $
8
 * @since 1.0
9
 * @copyright Sina Corp.
10
 */
11
12
namespace MultiHttp\Handler;
13
14
/**
15
 * Trait JsonTrait
16
 * @package MultiHttp
17
 */
18
class Form implements IHandler
19
{
20
    /**
21
     * @param $body
22
     * @return string
23
     */
24 6
    public function encode($body)
25
    {
26 6
        return is_array($body) ? http_build_query($body) : $body;
27
    }
28
29
    /**
30
     * @param $body
31
     * @return mixed
32
     */
33
    public function decode($body)
34
    {
35
        if(is_string($body)){
36
            parse_str($body, $body);
37
        }
38
        return $body;
39
    }
40
}
41
42