mirror of
https://github.com/friendica/friendica
synced 2025-04-29 19:44:22 +02:00
Replace $parameters
argument per method with static::$parameters
This commit is contained in:
parent
018275919c
commit
714f0febc4
249 changed files with 710 additions and 775 deletions
|
@ -34,7 +34,7 @@ use Friendica\Module\BaseApi;
|
|||
*/
|
||||
class ScheduledStatuses extends BaseApi
|
||||
{
|
||||
public static function put(array $parameters = [])
|
||||
public static function put()
|
||||
{
|
||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||
$uid = self::getCurrentUserID();
|
||||
|
@ -42,35 +42,34 @@ class ScheduledStatuses extends BaseApi
|
|||
DI::apiResponse()->unsupported(Router::PUT);
|
||||
}
|
||||
|
||||
public static function delete(array $parameters = [])
|
||||
public static function delete()
|
||||
{
|
||||
self::checkAllowedScope(self::SCOPE_WRITE);
|
||||
$uid = self::getCurrentUserID();
|
||||
|
||||
if (empty($parameters['id'])) {
|
||||
if (empty(static::$parameters['id'])) {
|
||||
DI::mstdnError()->UnprocessableEntity();
|
||||
}
|
||||
|
||||
if (!DBA::exists('delayed-post', ['id' => $parameters['id'], 'uid' => $uid])) {
|
||||
if (!DBA::exists('delayed-post', ['id' => static::$parameters['id'], 'uid' => $uid])) {
|
||||
DI::mstdnError()->RecordNotFound();
|
||||
}
|
||||
|
||||
Post\Delayed::deleteById($parameters['id']);
|
||||
Post\Delayed::deleteById(static::$parameters['id']);
|
||||
|
||||
System::jsonExit([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $parameters
|
||||
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
|
||||
*/
|
||||
public static function rawContent(array $parameters = [])
|
||||
public static function rawContent()
|
||||
{
|
||||
self::checkAllowedScope(self::SCOPE_READ);
|
||||
$uid = self::getCurrentUserID();
|
||||
|
||||
if (isset($parameters['id'])) {
|
||||
System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId($parameters['id'], $uid)->toArray());
|
||||
if (isset(static::$parameters['id'])) {
|
||||
System::jsonExit(DI::mstdnScheduledStatus()->createFromDelayedPostId(static::$parameters['id'], $uid)->toArray());
|
||||
}
|
||||
|
||||
$request = self::getRequest([
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue