diff --git a/PlagScan/API.php b/PlagScan/API.php index a382205a6d936f82cbc9f6b62d6f566d4875dcca..5b9be2179990655ba35a45e1e1e00ed700ffc6e8 100644 --- a/PlagScan/API.php +++ b/PlagScan/API.php @@ -22,6 +22,8 @@ class API protected static $instance; /** + * @param $host + * @param string $version * @return API */ public static function getInstance($host, $version = 'v3') : API @@ -34,6 +36,8 @@ class API /** * PlagScanApi constructor. + * @param $host + * @param $version */ public function __construct($host, $version) { diff --git a/PlagScan/Helper/Base.php b/PlagScan/Helper/Base.php index d55f06c31908c4ff3f402cfa59f271e028e86d87..e23caf0053ba869f49a58a40aa4524b88790af97 100644 --- a/PlagScan/Helper/Base.php +++ b/PlagScan/Helper/Base.php @@ -20,6 +20,8 @@ class Base /** * Ping constructor. + * @param $host + * @param string $version */ public function __construct($host, $version = 'v3') { @@ -52,8 +54,12 @@ class Base public function createAccessToken(string $client_id = '', string $client_secret = '') { $settings = new \ilSetting('psx'); - $client_id = $settings->get('psx_clientid'); - $client_secret = $settings->get('psx_apikey'); + if($client_id === ''){ + $client_id = $settings->get('psx_clientid'); + } + if($client_secret === ''){ + $client_secret = $settings->get('psx_apikey'); + } $response = $this->handler->request('token', 'POST', '', [ 'client_id' => $client_id,