@@ -111,9 +111,9 @@ discard block |
||
| 111 | 111 | * @param array|null $params Initialization parameters from the Slint system. |
| 112 | 112 | * There's no use for this arg yet. |
| 113 | 113 | */ |
| 114 | - function __construct(?array $params=null) |
|
| 114 | + function __construct(?array $params = null) |
|
| 115 | 115 | { |
| 116 | - $this->ci =& get_instance(); |
|
| 116 | + $this->ci = & get_instance(); |
|
| 117 | 117 | |
| 118 | 118 | if ($this->ci->input->is_cli_request()) return; |
| 119 | 119 | |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | // Load Model. |
| 133 | 133 | $this->ci->load->splint(self::PACKAGE, '*RESTModel', 'rest_model'); |
| 134 | - $this->rest_model =& $this->ci->rest_model; |
|
| 134 | + $this->rest_model = & $this->ci->rest_model; |
|
| 135 | 135 | |
| 136 | 136 | $config = [ |
| 137 | 137 | 'users_table' => $this->ci->config->item('rest')['basic_auth']['users_table'] ?? null, |
@@ -257,7 +257,7 @@ discard block |
||
| 257 | 257 | /** |
| 258 | 258 | * [bearer_auth description] |
| 259 | 259 | */ |
| 260 | - private function bearer_auth($auth=RESTAuth::BEARER):void { |
|
| 260 | + private function bearer_auth($auth = RESTAuth::BEARER):void { |
|
| 261 | 261 | $authorization = $this->get_authorization_header(); |
| 262 | 262 | if ($authorization == null || substr_count($authorization, " ") != 1) { |
| 263 | 263 | $this->handle_response(RESTResponse::BAD_REQUEST, $auth); // Exits. |
@@ -317,7 +317,7 @@ discard block |
||
| 317 | 317 | } |
| 318 | 318 | // Should we acyually Limit? |
| 319 | 319 | if ($this->per_hour > 0) { |
| 320 | - $client = hash('md5', $this->ci->input->ip_address() . "%" . $apiKey[$this->api_key_column]); |
|
| 320 | + $client = hash('md5', $this->ci->input->ip_address()."%".$apiKey[$this->api_key_column]); |
|
| 321 | 321 | $limitData = $this->rest_model->getLimitData($client, '_api_keyed_user'); |
| 322 | 322 | if ($limitData == null) { |
| 323 | 323 | $limitData = []; |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | * [get_authorization_header description] |
| 402 | 402 | * @return [type] [description] |
| 403 | 403 | */ |
| 404 | - private function get_authorization_header():?string |
|
| 404 | + private function get_authorization_header(): ?string |
|
| 405 | 405 | { |
| 406 | 406 | if (isset($_SERVER['Authorization'])) { |
| 407 | 407 | return trim($_SERVER["Authorization"]); |
@@ -424,7 +424,7 @@ discard block |
||
| 424 | 424 | * [handle_response description] |
| 425 | 425 | * @param int $code [description] |
| 426 | 426 | */ |
| 427 | - private function handle_response(int $code, $auth=null):void |
|
| 427 | + private function handle_response(int $code, $auth = null):void |
|
| 428 | 428 | { |
| 429 | 429 | http_response_code($code); |
| 430 | 430 | header("Content-Type: application/json"); |