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   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 23
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 28.57%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 23
ccs 2
cts 7
cp 0.2857
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A encode() 0 4 2
A decode() 0 7 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