1
0
Fork 0

Use router constants

This commit is contained in:
Michael 2021-07-30 06:19:02 +00:00
parent c9eca1edeb
commit 432206bc5b
5 changed files with 16 additions and 11 deletions

View file

@ -21,6 +21,7 @@
namespace Friendica\Module\Api\Mastodon\Accounts;
use Friendica\App\Router;
use Friendica\Core\Logger;
use Friendica\Module\BaseApi;
use Friendica\Util\HTTPInputData;
@ -39,6 +40,6 @@ class UpdateCredentials extends BaseApi
Logger::info('Patch data', ['data' => $data]);
self::unsupported('patch');
self::unsupported(Router::PATCH);
}
}

View file

@ -21,6 +21,7 @@
namespace Friendica\Module\Api\Mastodon;
use Friendica\App\Router;
use Friendica\Core\System;
use Friendica\Module\BaseApi;
@ -33,7 +34,7 @@ class Filters extends BaseApi
{
self::checkAllowedScope(self::SCOPE_WRITE);
self::unsupported('post');
self::unsupported(Router::POST);
}
/**

View file

@ -21,6 +21,7 @@
namespace Friendica\Module\Api\Mastodon\Lists;
use Friendica\App\Router;
use Friendica\Core\System;
use Friendica\Database\DBA;
use Friendica\DI;
@ -35,12 +36,12 @@ class Accounts extends BaseApi
{
public static function delete(array $parameters = [])
{
self::unsupported('delete');
self::unsupported(Router::DELETE);
}
public static function post(array $parameters = [])
{
self::unsupported('post');
self::unsupported(Router::POST);
}
/**
@ -74,7 +75,7 @@ class Accounts extends BaseApi
if ($request['limit'] != 0) {
$params['limit'] = min($request['limit'], 40);
}
$condition = ['gid' => $id];
if (!empty($request['max_id'])) {

View file

@ -21,6 +21,7 @@
namespace Friendica\Module\Api\Mastodon;
use Friendica\App\Router;
use Friendica\Core\System;
use Friendica\Module\BaseApi;
@ -33,7 +34,7 @@ class Markers extends BaseApi
{
self::checkAllowedScope(self::SCOPE_WRITE);
self::unsupported('post');
self::unsupported(Router::POST);
}
/**

View file

@ -21,6 +21,7 @@
namespace Friendica\Module\Api\Mastodon;
use Friendica\App\Router;
use Friendica\Module\BaseApi;
/**
@ -34,7 +35,7 @@ class Unimplemented extends BaseApi
*/
public static function delete(array $parameters = [])
{
self::unsupported('delete');
self::unsupported(Router::DELETE);
}
/**
@ -43,7 +44,7 @@ class Unimplemented extends BaseApi
*/
public static function patch(array $parameters = [])
{
self::unsupported('patch');
self::unsupported(Router::PATCH);
}
/**
@ -52,7 +53,7 @@ class Unimplemented extends BaseApi
*/
public static function post(array $parameters = [])
{
self::unsupported('post');
self::unsupported(Router::POST);
}
/**
@ -61,7 +62,7 @@ class Unimplemented extends BaseApi
*/
public static function put(array $parameters = [])
{
self::unsupported('put');
self::unsupported(Router::PUT);
}
/**
@ -70,6 +71,6 @@ class Unimplemented extends BaseApi
*/
public static function rawContent(array $parameters = [])
{
self::unsupported('get');
self::unsupported(Router::GET);
}
}