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
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue