1
0
Fork 0

Replace $parameters argument per method with static::$parameters

This commit is contained in:
Philipp Holzer 2021-11-14 20:46:25 +01:00
commit 714f0febc4
Signed by: nupplaPhil
GPG key ID: 24A7501396EB5432
249 changed files with 710 additions and 775 deletions

View file

@ -40,7 +40,7 @@ use Friendica\Module\BaseApi;
*/
class Activity extends BaseApi
{
public static function rawContent(array $parameters = [])
public static function rawContent()
{
self::checkAllowedScope(self::SCOPE_WRITE);
$uid = self::getCurrentUserID();
@ -49,17 +49,17 @@ class Activity extends BaseApi
'id' => 0, // Id of the post
]);
$res = Item::performActivity($request['id'], $parameters['verb'], $uid);
$res = Item::performActivity($request['id'], static::$parameters['verb'], $uid);
if ($res) {
if (!empty($parameters['extension']) && ($parameters['extension'] == 'xml')) {
if (!empty(static::$parameters['extension']) && (static::$parameters['extension'] == 'xml')) {
$ok = 'true';
} else {
$ok = 'ok';
}
DI::apiResponse()->exit('ok', ['ok' => $ok], $parameters['extension'] ?? null);
DI::apiResponse()->exit('ok', ['ok' => $ok], static::$parameters['extension'] ?? null);
} else {
DI::apiResponse()->error(500, 'Error adding activity', '', $parameters['extension'] ?? null);
DI::apiResponse()->error(500, 'Error adding activity', '', static::$parameters['extension'] ?? null);
}
}
}