1 | <?php |
||
2 | defined('BASEPATH') OR exit('No direct script access allowed'); |
||
3 | |||
4 | class RESTAuth { |
||
5 | /** |
||
6 | * [BasicAuth description] |
||
7 | * @var string |
||
8 | */ |
||
9 | const BASIC = "Basic"; |
||
10 | |||
11 | /** |
||
12 | * [API_KEY description] |
||
13 | * @var string |
||
14 | */ |
||
15 | const API_KEY = "ApiKey"; |
||
16 | |||
17 | /** |
||
18 | * [BEARER description] |
||
19 | * @var string |
||
20 | */ |
||
21 | const BEARER = 'Bearer'; |
||
22 | |||
23 | /** |
||
24 | * [SECRET description] |
||
25 | * @var string |
||
26 | */ |
||
27 | const SECRET = 'Secret'; |
||
28 | |||
29 | /** |
||
30 | * [OAUTH2 description] |
||
31 | * @var string |
||
32 | */ |
||
33 | const OAUTH2 = "OAUTH2"; |
||
34 | |||
35 | /** |
||
36 | * [IP description] |
||
37 | * @var string |
||
38 | */ |
||
39 | const IP = "IP"; |
||
40 | /** |
||
41 | * [CUSTOM description] |
||
42 | * @param string $header [description] |
||
43 | * @return string [description] |
||
44 | */ |
||
45 | public static function CUSTOM(string $header):string { |
||
46 | return 'HTTP_'.str_replace('-', '_', $header); |
||
47 | } |
||
48 | } |
||
49 | ?> |
||
0 ignored issues
–
show
|
|||
50 |
Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.
A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.