mirror of
https://github.com/friendica/friendica
synced 2025-04-26 09:10:15 +00: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
|
@ -38,16 +38,16 @@ use Friendica\Util\Strings;
|
|||
*/
|
||||
class Advanced extends BaseModule
|
||||
{
|
||||
public static function init(array $parameters = [])
|
||||
public static function init()
|
||||
{
|
||||
if (!Session::isAuthenticated()) {
|
||||
throw new ForbiddenException(DI::l10n()->t('Permission denied.'));
|
||||
}
|
||||
}
|
||||
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
$cid = $parameters['id'];
|
||||
$cid = static::$parameters['id'];
|
||||
|
||||
$contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
|
||||
if (empty($contact)) {
|
||||
|
@ -96,9 +96,9 @@ class Advanced extends BaseModule
|
|||
return;
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
$cid = $parameters['id'];
|
||||
$cid = static::$parameters['id'];
|
||||
|
||||
$contact = Model\Contact::selectFirst([], ['id' => $cid, 'uid' => local_user()]);
|
||||
if (empty($contact)) {
|
||||
|
|
|
@ -14,7 +14,7 @@ use Friendica\Network\HTTPException;
|
|||
|
||||
class Contacts extends BaseModule
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
$app = DI::app();
|
||||
|
||||
|
@ -22,8 +22,8 @@ class Contacts extends BaseModule
|
|||
throw new HTTPException\ForbiddenException();
|
||||
}
|
||||
|
||||
$cid = $parameters['id'];
|
||||
$type = $parameters['type'] ?? 'all';
|
||||
$cid = static::$parameters['id'];
|
||||
$type = static::$parameters['type'] ?? 'all';
|
||||
$accounttype = $_GET['accounttype'] ?? '';
|
||||
$accounttypeid = User::getAccountTypeByString($accounttype);
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ use Friendica\Util\Strings;
|
|||
*/
|
||||
class Hovercard extends BaseModule
|
||||
{
|
||||
public static function rawContent(array $parameters = [])
|
||||
public static function rawContent()
|
||||
{
|
||||
$contact_url = $_REQUEST['url'] ?? '';
|
||||
|
||||
|
|
|
@ -34,9 +34,9 @@ use Friendica\Network\HTTPException\BadRequestException;
|
|||
*/
|
||||
class Media extends BaseModule
|
||||
{
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
$cid = $parameters['id'];
|
||||
$cid = static::$parameters['id'];
|
||||
|
||||
$contact = Model\Contact::selectFirst([], ['id' => $cid]);
|
||||
if (empty($contact)) {
|
||||
|
|
|
@ -18,9 +18,9 @@ use Friendica\Util\XML;
|
|||
|
||||
class Poke extends BaseModule
|
||||
{
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
if (!local_user() || empty($parameters['id'])) {
|
||||
if (!local_user() || empty(static::$parameters['id'])) {
|
||||
return self::postReturn(false);
|
||||
}
|
||||
|
||||
|
@ -39,14 +39,14 @@ class Poke extends BaseModule
|
|||
|
||||
$activity = Activity::POKE . '#' . urlencode($verbs[$verb][0]);
|
||||
|
||||
$contact_id = intval($parameters['id']);
|
||||
$contact_id = intval(static::$parameters['id']);
|
||||
if (!$contact_id) {
|
||||
return self::postReturn(false);
|
||||
}
|
||||
|
||||
Logger::info('verb ' . $verb . ' contact ' . $contact_id);
|
||||
|
||||
$contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => $parameters['id'], 'uid' => local_user()]);
|
||||
$contact = DBA::selectFirst('contact', ['id', 'name', 'url', 'photo'], ['id' => static::$parameters['id'], 'uid' => local_user()]);
|
||||
if (!DBA::isResult($contact)) {
|
||||
return self::postReturn(false);
|
||||
}
|
||||
|
@ -123,17 +123,17 @@ class Poke extends BaseModule
|
|||
return $success;
|
||||
}
|
||||
|
||||
public static function content(array $parameters = [])
|
||||
public static function content()
|
||||
{
|
||||
if (!local_user()) {
|
||||
throw new HTTPException\UnauthorizedException(DI::l10n()->t('You must be logged in to use this module.'));
|
||||
}
|
||||
|
||||
if (empty($parameters['id'])) {
|
||||
if (empty(static::$parameters['id'])) {
|
||||
throw new HTTPException\BadRequestException();
|
||||
}
|
||||
|
||||
$contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => $parameters['id'], 'uid' => local_user()]);
|
||||
$contact = DBA::selectFirst('contact', ['id', 'url', 'name'], ['id' => static::$parameters['id'], 'uid' => local_user()]);
|
||||
if (!DBA::isResult($contact)) {
|
||||
throw new HTTPException\NotFoundException();
|
||||
}
|
||||
|
|
|
@ -37,13 +37,13 @@ class Revoke extends BaseModule
|
|||
/** @var array */
|
||||
private static $contact;
|
||||
|
||||
public static function init(array $parameters = [])
|
||||
public static function init()
|
||||
{
|
||||
if (!local_user()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$data = Model\Contact::getPublicAndUserContactID($parameters['id'], local_user());
|
||||
$data = Model\Contact::getPublicAndUserContactID(static::$parameters['id'], local_user());
|
||||
if (!DBA::isResult($data)) {
|
||||
throw new HTTPException\NotFoundException(DI::l10n()->t('Unknown contact.'));
|
||||
}
|
||||
|
@ -63,13 +63,13 @@ class Revoke extends BaseModule
|
|||
}
|
||||
}
|
||||
|
||||
public static function post(array $parameters = [])
|
||||
public static function post()
|
||||
{
|
||||
if (!local_user()) {
|
||||
throw new HTTPException\UnauthorizedException();
|
||||
}
|
||||
|
||||
self::checkFormSecurityTokenRedirectOnError('contact/' . $parameters['id'], 'contact_revoke');
|
||||
self::checkFormSecurityTokenRedirectOnError('contact/' . static::$parameters['id'], 'contact_revoke');
|
||||
|
||||
$result = Model\Contact::revokeFollow(self::$contact);
|
||||
if ($result === true) {
|
||||
|
@ -80,10 +80,10 @@ class Revoke extends BaseModule
|
|||
notice(DI::l10n()->t('Unable to revoke follow, please try again later or contact the administrator.'));
|
||||
}
|
||||
|
||||
DI::baseUrl()->redirect('contact/' . $parameters['id']);
|
||||
DI::baseUrl()->redirect('contact/' . static::$parameters['id']);
|
||||
}
|
||||
|
||||
public static function content(array $parameters = []): string
|
||||
public static function content(): string
|
||||
{
|
||||
if (!local_user()) {
|
||||
return Login::form($_SERVER['REQUEST_URI']);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue