RESTAuth   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Importance

Changes 3
Bugs 0 Features 0
Metric Value
eloc 8
c 3
b 0
f 0
dl 0
loc 43
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A CUSTOM() 0 2 1
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
Best Practice introduced by
It is not recommended to use PHP's closing tag ?> in files other than templates.

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.

Loading history...
50