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.
Test Failed
Push — master ( 4703c4...b7eadc )
by sunsky
02:50
created

Http   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 88
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 88
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0

9 Methods

Rating   Name   Duplication   Size   Complexity  
post() 0 1 ?
patch() 0 1 ?
put() 0 1 ?
get() 0 1 ?
head() 0 1 ?
delete() 0 1 ?
options() 0 1 ?
trace() 0 1 ?
A hasBody() 0 3 1
1
<?php
2
/**
3
 *
4
 * @author  [email protected] [email protected]
5
 * Date: 2017/6/16
6
 * Time: 10:20
7
 * @version $Id: $
8
 * @since 1.0
9
 * @copyright Sina Corp.
10
 */
11
12
namespace MultiHttp;
13
14
/**
15
 * Class Http
16
 * @package MultiHttp
17
 */
18
abstract class Http
19
{
20
    const HEAD = 'HEAD';
21
    const GET = 'GET';
22
    const POST = 'POST';
23
    const PUT = 'PUT';
24
    const DELETE = 'DELETE';
25
    const PATCH = 'PATCH';
26
    const OPTIONS = 'OPTIONS';
27
    const TRACE = 'TRACE';
28
    public static $methods = array(
29
        'HEAD' => self::HEAD,
30
        'GET' => self::GET,
31
        'POST' => self::POST,
32
        'PUT' => self::PUT,
33
        'DELETE' => self::DELETE,
34
        'PATCH' => self::PATCH,
35
        'OPTIONS' => self::OPTIONS,
36
        'TRACE' => self::TRACE,
37
    );
38
39
    /**
40
     * @param $uri
41
     * @param null $payload
42
     * @param array $options
43
     * @return mixed
44
     */
45
    abstract function post($uri, $payload = null, array $options = array());
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
46
47
    /**
48
     * @param $uri
49
     * @param null $payload
50
     * @param array $options
51
     * @return mixed
52
     */
53
    abstract function patch($uri, $payload = null, array $options = array());
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
54
55
    /**
56
     * @param $uri
57
     * @param null $payload
58
     * @param array $options
59
     * @return mixed
60
     */
61
    abstract function put($uri, $payload = null, array $options = array());
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
62
63
    /**
64
     * @param $uri
65
     * @param array $options
66
     * @return mixed
67
     */
68
    abstract function get($uri, array $options = array());
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
69
70
    /**
71
     * @param $uri
72
     * @param array $options
73
     * @return mixed
74
     */
75
    abstract function head($uri, array $options = array());
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
76
77
    /**
78
     * @param $uri
79
     * @param array $options
80
     * @return mixed
81
     */
82
    abstract function delete($uri, array $options = array());
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
83
84
    /**
85
     * @param $uri
86
     * @param array $options
87
     * @return mixed
88
     */
89
    abstract function options($uri, array $options = array());
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
90
91
    /**
92
     * @param $uri
93
     * @param array $options
94
     * @return mixed
95
     */
96
    abstract function trace($uri, array $options = array());
0 ignored issues
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
97
98
    /**
99
     * @param $method
100
     * @return bool
101
     */
102
    public static function hasBody($method){
103
        return in_array($method, array(self::POST, self::PUT, self::PATCH, self::OPTIONS));
104
    }
105
}