]> git.mxchange.org Git - friendica.git/blobdiff - src/Module/OAuth/Token.php
Simplified null check
[friendica.git] / src / Module / OAuth / Token.php
index 44a86263044eb8017ed02c9024d334eabd670756..17f2e2b8200aa3f24843818f2f68b717a048c6e1 100644 (file)
@@ -28,15 +28,15 @@ use Friendica\DI;
 use Friendica\Module\BaseApi;
 
 /**
- * Dummy class for all currently unimplemented endpoints
+ * @see https://docs.joinmastodon.org/spec/oauth/
  */
 class Token extends BaseApi
 {
        public static function post(array $parameters = [])
        {
-               $client_secret = !isset($_REQUEST['client_secret']) ? '' : $_REQUEST['client_secret'];
-               $code          = !isset($_REQUEST['code']) ? '' : $_REQUEST['code'];
-               $grant_type    = !isset($_REQUEST['grant_type']) ? '' : $_REQUEST['grant_type'];
+               $client_secret = $_REQUEST['client_secret'] ?? '';
+               $code          = $_REQUEST['code'] ?? '';
+               $grant_type    = $_REQUEST['grant_type'] ?? '';
 
                if ($grant_type != 'authorization_code') {
                        Logger::warning('Unsupported or missing grant type', ['request' => $_REQUEST]);