Conditions | 1 |
Paths | 1 |
Total Lines | 62 |
Code Lines | 60 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
6 | public static function getSupported() |
||
7 | { |
||
8 | return [ |
||
9 | 100 => 'Continue', |
||
10 | 101 => 'Switching Protocols', |
||
11 | 102 => 'Processing', |
||
12 | 200 => 'OK', |
||
13 | 201 => 'Created', |
||
14 | 202 => 'Accepted', |
||
15 | 203 => 'Non-Authoritative Information', |
||
16 | 204 => 'No Content', |
||
17 | 205 => 'Reset Content', |
||
18 | 206 => 'Partial Content', |
||
19 | 207 => 'Multi-Status', |
||
20 | 208 => 'Already Reported', |
||
21 | 226 => 'IM Used', |
||
22 | 300 => 'Multiple Choices', |
||
23 | 301 => 'Moved Permanently', |
||
24 | 302 => 'Moved Temporarily', |
||
25 | 303 => 'See Other', |
||
26 | 304 => 'Not Modified', |
||
27 | 305 => 'Use Proxy', |
||
28 | 307 => 'Temporary Redirect', |
||
29 | 308 => 'Permanent Redirect', |
||
30 | 400 => 'Bad Request', |
||
31 | 401 => 'Unauthorized', |
||
32 | 402 => 'Payment Required', |
||
33 | 403 => 'Forbidden', |
||
34 | 404 => 'Not Found', |
||
35 | 405 => 'Method Not Allowed', |
||
36 | 406 => 'Not Acceptable', |
||
37 | 407 => 'Proxy Authentication Required', |
||
38 | 408 => 'Request Time-out', |
||
39 | 409 => 'Conflict', |
||
40 | 410 => 'Gone', |
||
41 | 411 => 'Length Required', |
||
42 | 412 => 'Precondition Failed', |
||
43 | 413 => 'Request Entity Too Large', |
||
44 | 414 => 'Request-URI Too Large', |
||
45 | 415 => 'Unsupported Media Type', |
||
46 | 416 => 'Requested Range Not Satisfiable', |
||
47 | 417 => 'Expectation Failed', |
||
48 | 421 => 'Misdirected Request', |
||
49 | 422 => 'Unprocessable Entity', |
||
50 | 423 => 'Locked', |
||
51 | 424 => 'Failed Dependency', |
||
52 | 426 => 'Upgrade Required', |
||
53 | 428 => 'Precondition Required', |
||
54 | 429 => 'Too Many Requests', |
||
55 | 431 => 'Request Header Fields Too Large', |
||
56 | 451 => 'Unavailable For Legal Reasons', |
||
57 | 500 => 'Internal Server Error', |
||
58 | 501 => 'Not Implemented', |
||
59 | 502 => 'Bad Gateway', |
||
60 | 503 => 'Service Unavailable', |
||
61 | 504 => 'Gateway Time-out', |
||
62 | 505 => 'HTTP Version not supported', |
||
63 | 506 => 'Variant Also Negotiates', |
||
64 | 507 => 'Insufficient Storage', |
||
65 | 508 => 'Loop Detected', |
||
66 | 510 => 'Not Extended', |
||
67 | 511 => 'Network Authentication Required', |
||
68 | ]; |
||
71 |