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

This commit is contained in:
Philipp 2021-11-14 20:46:25 +01:00
parent 018275919c
commit 714f0febc4
No known key found for this signature in database
GPG key ID: 24A7501396EB5432
249 changed files with 710 additions and 775 deletions

View file

@ -55,7 +55,7 @@ class Introductions extends BaseNotifications
];
}
public static function content(array $parameters = [])
public static function content()
{
Nav::setSelected('introductions');

View file

@ -42,13 +42,13 @@ class Notification extends BaseModule
* @throws \ImagickException
* @throws \Exception
*/
public static function post(array $parameters = [])
public static function post()
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
}
$request_id = $parameters['id'] ?? false;
$request_id = static::$parameters['id'] ?? false;
if ($request_id) {
$intro = DI::intro()->selectOneById($request_id, local_user());
@ -73,7 +73,7 @@ class Notification extends BaseModule
*
* @throws HTTPException\UnauthorizedException
*/
public static function rawContent(array $parameters = [])
public static function rawContent()
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(DI::l10n()->t('Permission denied.'));
@ -101,14 +101,14 @@ class Notification extends BaseModule
* @throws HTTPException\InternalServerErrorException
* @throws \Exception
*/
public static function content(array $parameters = []): string
public static function content(): string
{
if (!local_user()) {
notice(DI::l10n()->t('You must be logged in to show this page.'));
return Login::form();
}
$request_id = $parameters['id'] ?? false;
$request_id = static::$parameters['id'] ?? false;
if ($request_id) {
$Notify = DI::notify()->selectOneById($request_id);

View file

@ -82,7 +82,7 @@ class Notifications extends BaseNotifications
];
}
public static function content(array $parameters = [])
public static function content()
{
Nav::setSelected('notifications');