ApiController visibility fix

This commit is contained in:
xinatorus 2020-04-24 21:57:04 +02:00
parent 5519d46ca2
commit fe787163d0

View File

@ -1,7 +1,7 @@
<?php <?php
class ApiController { class ApiController {
private $input; protected $input;
private $authenticated; protected $authenticated;
function __construct() { function __construct() {
$this->authenticated = false; $this->authenticated = false;
@ -17,7 +17,7 @@ class ApiController {
} }
} }
private function requireAuth(){ protected function requireAuth(){
if (isset($this->headers['HTTP_AUTHORIZATION'])) { if (isset($this->headers['HTTP_AUTHORIZATION'])) {
// TODO: call appropriate class/method // TODO: call appropriate class/method
$authManager = new AuthManager(); $authManager = new AuthManager();
@ -30,7 +30,7 @@ class ApiController {
} }
} }
private function response($data = [], $httpCode = '200'){ protected function response($data = [], $httpCode = '200'){
http_response_code($httpCode); http_response_code($httpCode);
echo json_encode($data); echo json_encode($data);
} }