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.

HttpResponseType::getStatus()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 3

Importance

Changes 0
Metric Value
cc 3
nc 4
nop 1
dl 0
loc 3
ccs 2
cts 2
cp 1
crap 3
rs 10
c 0
b 0
f 0
1
<?php
2
/**
3
 * @package presentation
4
 * @subpackage responses
5
 * @author marius orcsik <[email protected]>
6
 * @date 2011.11.20
7
 */
8
namespace vsc\presentation\responses;
9
10
class HttpResponseType {
11 22
	public static function getStatus($iStatus) {
0 ignored issues
show
Documentation introduced by
The return type could not be reliably inferred; please add a @return annotation.

Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a @return annotation as described here.

Loading history...
12 22
		return (is_int($iStatus) && array_key_exists($iStatus, static::$aStatusList)) ? static::$aStatusList[$iStatus] : static::$aStatusList[500];
13
	}
14
15 1
	public static function isValidStatus($iStatus) {
16 1
		return array_key_exists($iStatus, static::$aStatusList);
17
	}
18
19
	static protected $aStatusList = [
20
		200 => '200 OK',
21
		201 => '201 Created',
22
		202 => '202 Accepted',
23
		204 => '204 No Content',
24
		301 => '301 Moved Permanently',
25
		302 => '302 Found',
26
		303 => '303 See Other',
27
		304 => '304 Not Modified',
28
		400 => '400 Bad Request',
29
		401 => '401 Unauthorized',
30
		402 => '402 Payment Required',
31
		403 => '403 Forbidden',
32
		404 => '404 Not Found',
33
		405 => '405 Method Not Allowed',
34
		406 => '406 Not Acceptable',
35
		408 => '408 Request Timeout',
36
		409 => '409 Conflict',
37
		410 => '410 Gone',
38
		415 => '415 Unsupported Media Type',
39
		426 => '426 Update Required',
40
		500 => '500 Internal Server Error',
41
		501 => '501 Not Implemented',
42
	];
43
44 1
	public static function getList() {
45 1
		return self::$aStatusList;
46
	}
47
48
	const OK = 200;
49
	const CREATED = 201;
50
	const ACCEPTED = 202;
51
	const NO_CONTENT = 204;
52
	const FOUND = 302;
53
	const SEE_OTHER = 303;
54
	const NOT_MODIFIED = 304;
55
	const CLIENT_ERROR = 400;
56
	const NOT_AUTHORIZED = 401;
57
	const FORBIDDEN = 403;
58
	const NOT_FOUND = 404;
59
	const METHOD_NOT_ALLOWED = 405;
60
	const UNSUPPORTED_MEDIA_TYPE = 415;
61
	const INTERNAL_ERROR = 500;
62
}
63