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 ( 002ab3...f4053f )
by sunsky
03:32
created

Http   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 44
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 44
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
abstract class Http {
15
	const HEAD             = 'HEAD';
16
	const GET              = 'GET';
17
	const POST             = 'POST';
18
	const PUT              = 'PUT';
19
	const DELETE           = 'DELETE';
20
	const PATCH            = 'PATCH';
21
	const OPTIONS          = 'OPTIONS';
22
	const TRACE            = 'TRACE';
23
	public static $methods = array(
24
		'HEAD'    => self::HEAD,
25
		'GET'     => self::GET,
26
		'POST'    => self::POST,
27
		'PUT'     => self::PUT,
28
		'DELETE'  => self::DELETE,
29
		'PATCH'   => self::PATCH,
30
		'OPTIONS' => self::OPTIONS,
31
		'TRACE'   => self::TRACE,
32
	);
33
34
	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...
35
36
	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...
37
38
	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...
39
40
	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...
41
42
	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...
43
44
	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...
45
46
	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...
47
48
	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...
49
50
    /**
51
     * @param $method
52
     * @return bool
53
     */
54
    public static function hasBody($method){
55
        return in_array($method, array(self::POST, self::PUT, self::PATCH, self::OPTIONS));
56
    }
57
}