Browse Source

parameters now are having a default value and are optional

pull/7819/head
Michael 2 years ago
parent
commit
8c03bdada9
110 changed files with 1840 additions and 165 deletions
  1. +1
    -1
      mod/update_contact.php
  2. +1
    -1
      mod/update_profile.php
  3. +5
    -5
      src/BaseModule.php
  4. +5
    -5
      src/LegacyModule.php
  5. +1
    -1
      src/Module/AccountManagementControlDocument.php
  6. +1
    -1
      src/Module/Acctlink.php
  7. +2
    -2
      src/Module/Admin/Addons/Details.php
  8. +1
    -1
      src/Module/Admin/Addons/Index.php
  9. +2
    -2
      src/Module/Admin/Blocklist/Contact.php
  10. +2
    -2
      src/Module/Admin/Blocklist/Server.php
  11. +1
    -1
      src/Module/Admin/DBSync.php
  12. +2
    -2
      src/Module/Admin/Features.php
  13. +1
    -1
      src/Module/Admin/Federation.php
  14. +2
    -2
      src/Module/Admin/Item/Delete.php
  15. +1
    -1
      src/Module/Admin/Item/Source.php
  16. +2
    -2
      src/Module/Admin/Logs/Settings.php
  17. +1
    -1
      src/Module/Admin/Logs/View.php
  18. +1
    -1
      src/Module/Admin/PhpInfo.php
  19. +1
    -1
      src/Module/Admin/Queue.php
  20. +2
    -2
      src/Module/Admin/Site.php
  21. +1
    -1
      src/Module/Admin/Summary.php
  22. +2
    -2
      src/Module/Admin/Themes/Details.php
  23. +3
    -3
      src/Module/Admin/Themes/Embed.php
  24. +1
    -1
      src/Module/Admin/Themes/Index.php
  25. +2
    -2
      src/Module/Admin/Tos.php
  26. +2
    -2
      src/Module/Admin/Users.php
  27. +1
    -1
      src/Module/AllFriends.php
  28. +2
    -2
      src/Module/Apps.php
  29. +1
    -1
      src/Module/Attach.php
  30. +3
    -3
      src/Module/BaseAdminModule.php
  31. +1
    -1
      src/Module/BaseSettingsModule.php
  32. +1
    -1
      src/Module/Bookmarklet.php
  33. +2
    -2
      src/Module/Contact.php
  34. +1
    -1
      src/Module/Contact/Hovercard.php
  35. +1
    -1
      src/Module/Credits.php
  36. +1
    -1
      src/Module/Debug/Babel.php
  37. +2
    -2
      src/Module/Debug/Feed.php
  38. +1
    -1
      src/Module/Debug/ItemBody.php
  39. +2
    -2
      src/Module/Debug/Localtime.php
  40. +1
    -1
      src/Module/Debug/Probe.php
  41. +1
    -1
      src/Module/Debug/WebFinger.php
  42. +2
    -2
      src/Module/Delegation.php
  43. +1
    -1
      src/Module/Diaspora/Fetch.php
  44. +2
    -2
      src/Module/Diaspora/Receive.php
  45. +1
    -1
      src/Module/Directory.php
  46. +1
    -1
      src/Module/Feed.php
  47. +1
    -1
      src/Module/Filer/RemoveTag.php
  48. +2
    -2
      src/Module/Filer/SaveTag.php
  49. +1
    -1
      src/Module/FollowConfirm.php
  50. +1
    -1
      src/Module/Followers.php
  51. +1
    -1
      src/Module/Following.php
  52. +2
    -2
      src/Module/Friendica.php
  53. +2
    -2
      src/Module/Group.php
  54. +1
    -1
      src/Module/HTTPException/MethodNotAllowed.php
  55. +1
    -1
      src/Module/HTTPException/PageNotFound.php
  56. +1
    -1
      src/Module/Hashtag.php
  57. +1
    -1
      src/Module/Help.php
  58. +1
    -1
      src/Module/Home.php
  59. +1
    -1
      src/Module/Inbox.php
  60. +3
    -3
      src/Module/Install.php
  61. +2
    -2
      src/Module/Invite.php
  62. +2
    -2
      src/Module/Item/Compose.php
  63. +1
    -1
      src/Module/Item/Ignore.php
  64. +1
    -1
      src/Module/Like.php
  65. +2
    -2
      src/Module/Login.php
  66. +1
    -1
      src/Module/Logout.php
  67. +1
    -1
      src/Module/Magic.php
  68. +1
    -1
      src/Module/Maintenance.php
  69. +1
    -1
      src/Module/Manifest.php
  70. +2
    -2
      src/Module/NodeInfo.php
  71. +3
    -3
      src/Module/Notifications/Notify.php
  72. +1
    -1
      src/Module/Objects.php
  73. +1
    -1
      src/Module/Oembed.php
  74. +1
    -1
      src/Module/OpenSearch.php
  75. +1
    -1
      src/Module/Outbox.php
  76. +1
    -1
      src/Module/Owa.php
  77. +1
    -1
      src/Module/Photo.php
  78. +3
    -3
      src/Module/Profile.php
  79. +1
    -1
      src/Module/Profile/Contacts.php
  80. +1
    -1
      src/Module/Proxy.php
  81. +1
    -1
      src/Module/PublicRSAKey.php
  82. +1
    -1
      src/Module/RandomProfile.php
  83. +1
    -1
      src/Module/ReallySimpleDiscovery.php
  84. +2
    -2
      src/Module/Register.php
  85. +1
    -1
      src/Module/RobotsTxt.php
  86. +1
    -1
      src/Module/Search/Acl.php
  87. +1
    -1
      src/Module/Search/Directory.php
  88. +1
    -1
      src/Module/Search/Index.php
  89. +1
    -1
      src/Module/Search/Saved.php
  90. +2
    -2
      src/Module/Settings/Delegation.php
  91. +3
    -3
      src/Module/Settings/TwoFactor/AppSpecific.php
  92. +2
    -2
      src/Module/Settings/TwoFactor/Index.php
  93. +3
    -3
      src/Module/Settings/TwoFactor/Recovery.php
  94. +3
    -3
      src/Module/Settings/TwoFactor/Verify.php
  95. +2
    -2
      src/Module/Settings/UserExport.php
  96. +2
    -2
      src/Module/Smilies.php
  97. +1
    -1
      src/Module/Starred.php
  98. +2
    -2
      src/Module/Statistics.php
  99. +1
    -1
      src/Module/Theme.php
  100. +1
    -1
      src/Module/ThemeDetails.php

+ 1
- 1
mod/update_contact.php View File

@ -14,7 +14,7 @@ function update_contact_content(App $a)
echo "<section>";
if ($_GET["force"] == 1) {
$text = Contact::content(true);
$text = Contact::content([], true);
} else {
$text = '';
}


+ 1
- 1
mod/update_profile.php View File

@ -28,7 +28,7 @@ function update_profile_content(App $a) {
* on the client side and then swap the image back.
*/
$text = Profile::content($profile_uid);
$text = Profile::content([], $profile_uid);
if (PConfig::get(local_user(), "system", "bandwidth_saver")) {
$replace = "<br />".L10n::t("[Embedded content - reload page to view]")."<br />";


+ 5
- 5
src/BaseModule.php View File

@ -22,7 +22,7 @@ abstract class BaseModule extends BaseObject
* Extend this method if you need to do any shared processing before both
* content() or post()
*/
public static function init($parameters)
public static function init(array $parameters = [])
{
}
@ -32,7 +32,7 @@ abstract class BaseModule extends BaseObject
* Extend this method if the module is supposed to return communication data,
* e.g. from protocol implementations.
*/
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
}
@ -45,7 +45,7 @@ abstract class BaseModule extends BaseObject
*
* @return string
*/
public static function content($parameters)
public static function content(array $parameters = [])
{
$o = '';
@ -58,7 +58,7 @@ abstract class BaseModule extends BaseObject
* Extend this method if the module is supposed to process POST requests.
* Doesn't display any content
*/
public static function post($parameters)
public static function post(array $parameters = [])
{
}
@ -67,7 +67,7 @@ abstract class BaseModule extends BaseObject
*
* Unknown purpose
*/
public static function afterpost($parameters)
public static function afterpost(array $parameters = [])
{
}


+ 5
- 5
src/LegacyModule.php View File

@ -35,22 +35,22 @@ class LegacyModule extends BaseModule
require_once $file_path;
}
public static function init($parameters)
public static function init(array $parameters = [])
{
self::runModuleFunction('init', $parameters);
}
public static function content($parameters)
public static function content(array $parameters = [])
{
return self::runModuleFunction('content', $parameters);
}
public static function post($parameters)
public static function post(array $parameters = [])
{
self::runModuleFunction('post', $parameters);
}
public static function afterpost($parameters)
public static function afterpost(array $parameters = [])
{
self::runModuleFunction('afterpost', $parameters);
}
@ -62,7 +62,7 @@ class LegacyModule extends BaseModule
* @return string
* @throws \Exception
*/
private static function runModuleFunction($function_suffix, $parameters)
private static function runModuleFunction($function_suffix, array $parameters = [])
{
$function_name = static::$moduleName . '_' . $function_suffix;


+ 1
- 1
src/Module/AccountManagementControlDocument.php View File

@ -11,7 +11,7 @@ use Friendica\BaseModule;
*/
class AccountManagementControlDocument extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$output = [
'version' => 1,


+ 1
- 1
src/Module/Acctlink.php View File

@ -11,7 +11,7 @@ use Friendica\Core\System;
*/
class Acctlink extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$addr = trim($_GET['addr'] ?? '');


+ 2
- 2
src/Module/Admin/Addons/Details.php View File

@ -11,7 +11,7 @@ use Friendica\Util\Strings;
class Details extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -35,7 +35,7 @@ class Details extends BaseAdminModule
$a->internalRedirect('admin/addons');
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/Admin/Addons/Index.php View File

@ -9,7 +9,7 @@ use Friendica\Module\BaseAdminModule;
class Index extends BaseAdminModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Blocklist/Contact.php View File

@ -11,7 +11,7 @@ use Friendica\Model;
class Contact extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -41,7 +41,7 @@ class Contact extends BaseAdminModule
self::getApp()->internalRedirect('admin/blocklist/contact');
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Blocklist/Server.php View File

@ -10,7 +10,7 @@ use Friendica\Util\Strings;
class Server extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -50,7 +50,7 @@ class Server extends BaseAdminModule
self::getApp()->internalRedirect('admin/blocklist/server');
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/Admin/DBSync.php View File

@ -12,7 +12,7 @@ use Friendica\Module\BaseAdminModule;
class DBSync extends BaseAdminModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Features.php View File

@ -10,7 +10,7 @@ use Friendica\Module\BaseAdminModule;
class Features extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -42,7 +42,7 @@ class Features extends BaseAdminModule
self::getApp()->internalRedirect('admin/features');
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/Admin/Federation.php View File

@ -10,7 +10,7 @@ use Friendica\Module\BaseAdminModule;
class Federation extends BaseAdminModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Item/Delete.php View File

@ -10,7 +10,7 @@ use Friendica\Util\Strings;
class Delete extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -36,7 +36,7 @@ class Delete extends BaseAdminModule
self::getApp()->internalRedirect('admin/item/delete');
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/Admin/Item/Source.php View File

@ -13,7 +13,7 @@ use Friendica\Module\BaseAdminModule;
class Source extends BaseAdminModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Logs/Settings.php View File

@ -11,7 +11,7 @@ use Psr\Log\LogLevel;
class Settings extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -37,7 +37,7 @@ class Settings extends BaseAdminModule
self::getApp()->internalRedirect('admin/logs');
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/Admin/Logs/View.php View File

@ -10,7 +10,7 @@ use Friendica\Util\Strings;
class View extends BaseAdminModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/Admin/PhpInfo.php View File

@ -6,7 +6,7 @@ use Friendica\Module\BaseAdminModule;
class PhpInfo extends BaseAdminModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
parent::rawContent($parameters);


+ 1
- 1
src/Module/Admin/Queue.php View File

@ -19,7 +19,7 @@ use Friendica\Util\DateTimeFormat;
*/
class Queue extends BaseAdminModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Site.php View File

@ -21,7 +21,7 @@ require_once __DIR__ . '/../../../boot.php';
class Site extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -412,7 +412,7 @@ class Site extends BaseAdminModule
$a->internalRedirect('admin/site' . $active_panel);
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/Admin/Summary.php View File

@ -20,7 +20,7 @@ use Friendica\Util\Network;
class Summary extends BaseAdminModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Themes/Details.php View File

@ -11,7 +11,7 @@ use Friendica\Util\Strings;
class Details extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -39,7 +39,7 @@ class Details extends BaseAdminModule
}
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 3
- 3
src/Module/Admin/Themes/Embed.php View File

@ -9,7 +9,7 @@ use Friendica\Util\Strings;
class Embed extends BaseAdminModule
{
public static function init($parameters)
public static function init(array $parameters = [])
{
$a = self::getApp();
@ -23,7 +23,7 @@ class Embed extends BaseAdminModule
}
}
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -53,7 +53,7 @@ class Embed extends BaseAdminModule
}
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/Admin/Themes/Index.php View File

@ -11,7 +11,7 @@ use Friendica\Util\Strings;
class Index extends BaseAdminModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Tos.php View File

@ -9,7 +9,7 @@ use Friendica\Module\BaseAdminModule;
class Tos extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -32,7 +32,7 @@ class Tos extends BaseAdminModule
self::getApp()->internalRedirect('admin/tos');
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 2
- 2
src/Module/Admin/Users.php View File

@ -15,7 +15,7 @@ use Friendica\Util\Temporal;
class Users extends BaseAdminModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
parent::post($parameters);
@ -131,7 +131,7 @@ class Users extends BaseAdminModule
$a->internalRedirect('admin/users');
}
public static function content($parameters)
public static function content(array $parameters = [])
{
parent::content($parameters);


+ 1
- 1
src/Module/AllFriends.php View File

@ -16,7 +16,7 @@ use Friendica\Util\Proxy as ProxyUtils;
*/
class AllFriends extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$app = self::getApp();


+ 2
- 2
src/Module/Apps.php View File

@ -13,7 +13,7 @@ use Friendica\Core\Renderer;
*/
class Apps extends BaseModule
{
public static function init($parameters)
public static function init(array $parameters = [])
{
$privateaddons = Config::get('config', 'private_addons');
if ($privateaddons === "1" && !local_user()) {
@ -21,7 +21,7 @@ class Apps extends BaseModule
}
}
public static function content($parameters)
public static function content(array $parameters = [])
{
$apps = Nav::getAppMenu();


+ 1
- 1
src/Module/Attach.php View File

@ -20,7 +20,7 @@ class Attach extends BaseModule
/**
* @brief Return to user an attached file given the id
*/
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$a = self::getApp();
if ($a->argc != 2) {


+ 3
- 3
src/Module/BaseAdminModule.php View File

@ -23,7 +23,7 @@ require_once 'boot.php';
*/
abstract class BaseAdminModule extends BaseModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
if (!is_site_admin()) {
return;
@ -35,7 +35,7 @@ abstract class BaseAdminModule extends BaseModule
}
}
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
if (!is_site_admin()) {
return '';
@ -48,7 +48,7 @@ abstract class BaseAdminModule extends BaseModule
return '';
}
public static function content($parameters)
public static function content(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/BaseSettingsModule.php View File

@ -9,7 +9,7 @@ use Friendica\Core\Renderer;
class BaseSettingsModule extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/Bookmarklet.php View File

@ -14,7 +14,7 @@ use Friendica\Util\Strings;
*/
class Bookmarklet extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$_GET['mode'] = 'minimal';


+ 2
- 2
src/Module/Contact.php View File

@ -75,7 +75,7 @@ class Contact extends BaseModule
$a->internalRedirect('contact');
}
public static function post($parameters)
public static function post(array $parameters = [])
{
$a = self::getApp();
@ -240,7 +240,7 @@ class Contact extends BaseModule
Model\Contact::remove($orig_record['id']);
}
public static function content($update = 0)
public static function content(array $parameters = [], $update = 0)
{
if (!local_user()) {
return Login::form($_SERVER['REQUEST_URI']);


+ 1
- 1
src/Module/Contact/Hovercard.php View File

@ -18,7 +18,7 @@ use Friendica\Util\Proxy;
*/
class Hovercard extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$contact_url = $_REQUEST['url'] ?? '';


+ 1
- 1
src/Module/Credits.php View File

@ -13,7 +13,7 @@ use Friendica\Core\Renderer;
*/
class Credits extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
/* fill the page with credits */
$credits_string = file_get_contents('CREDITS.txt');


+ 1
- 1
src/Module/Debug/Babel.php View File

@ -14,7 +14,7 @@ use Friendica\Util\XML;
*/
class Babel extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
function visible_whitespace($s)
{


+ 2
- 2
src/Module/Debug/Feed.php View File

@ -14,7 +14,7 @@ use Friendica\Util\Network;
*/
class Feed extends BaseModule
{
public static function init($parameters)
public static function init(array $parameters = [])
{
if (!local_user()) {
info(L10n::t('You must be logged in to use this module'));
@ -22,7 +22,7 @@ class Feed extends BaseModule
}
}
public static function content($parameters)
public static function content(array $parameters = [])
{
$result = [];
if (!empty($_REQUEST['url'])) {


+ 1
- 1
src/Module/Debug/ItemBody.php View File

@ -12,7 +12,7 @@ use Friendica\Network\HTTPException;
*/
class ItemBody extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(L10n::t('Access denied.'));


+ 2
- 2
src/Module/Debug/Localtime.php View File

@ -10,7 +10,7 @@ use Friendica\Util\Temporal;
class Localtime extends BaseModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
$time = ($_REQUEST['time'] ?? '') ?: 'now';
@ -21,7 +21,7 @@ class Localtime extends BaseModule
}
}
public static function content($parameters)
public static function content(array $parameters = [])
{
$app = self::getApp();


+ 1
- 1
src/Module/Debug/Probe.php View File

@ -13,7 +13,7 @@ use Friendica\Network\Probe as NetworkProbe;
*/
class Probe extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
if (!local_user()) {
$e = new HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));


+ 1
- 1
src/Module/Debug/WebFinger.php View File

@ -12,7 +12,7 @@ use Friendica\Network\Probe;
*/
class WebFinger extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
if (!local_user()) {
$e = new \Friendica\Network\HTTPException\ForbiddenException(L10n::t('Only logged in users are permitted to perform a probing.'));


+ 2
- 2
src/Module/Delegation.php View File

@ -17,7 +17,7 @@ use Friendica\Network\HTTPException\ForbiddenException;
*/
class Delegation extends BaseModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
if (!local_user()) {
return;
@ -92,7 +92,7 @@ class Delegation extends BaseModule
// NOTREACHED
}
public static function content($parameters)
public static function content(array $parameters = [])
{
if (!local_user()) {
throw new ForbiddenException(L10n::t('Permission denied.'));


+ 1
- 1
src/Module/Diaspora/Fetch.php View File

@ -17,7 +17,7 @@ use Friendica\Util\Strings;
*/
class Fetch extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$app = self::getApp();


+ 2
- 2
src/Module/Diaspora/Receive.php View File

@ -21,13 +21,13 @@ class Receive extends BaseModule
/** @var LoggerInterface */
private static $logger;
public static function init($parameters)
public static function init(array $parameters = [])
{
/** @var LoggerInterface $logger */
self::$logger = self::getClass(LoggerInterface::class);
}
public static function post($parameters)
public static function post(array $parameters = [])
{
/** @var Configuration $config */
$config = self::getClass(Configuration::class);


+ 1
- 1
src/Module/Directory.php View File

@ -21,7 +21,7 @@ use Friendica\Util\Strings;
*/
class Directory extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$app = self::getApp();
$config = $app->getConfig();


+ 1
- 1
src/Module/Feed.php View File

@ -23,7 +23,7 @@ use Friendica\Protocol\OStatus;
*/
class Feed extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/Filer/RemoveTag.php View File

@ -12,7 +12,7 @@ use Friendica\Util\XML;
*/
class RemoveTag extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
if (!local_user()) {
throw new HTTPException\ForbiddenException();


+ 2
- 2
src/Module/Filer/SaveTag.php View File

@ -14,7 +14,7 @@ use Friendica\Util\XML;
*/
class SaveTag extends BaseModule
{
public static function init($parameters)
public static function init(array $parameters = [])
{
if (!local_user()) {
info(L10n::t('You must be logged in to use this module'));
@ -22,7 +22,7 @@ class SaveTag extends BaseModule
}
}
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$a = self::getApp();
$logger = $a->getLogger();


+ 1
- 1
src/Module/FollowConfirm.php View File

@ -18,7 +18,7 @@ use Friendica\Util\DateTimeFormat;
*/
class FollowConfirm extends BaseModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/Followers.php View File

@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub;
*/
class Followers extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/Following.php View File

@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub;
*/
class Following extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$a = self::getApp();


+ 2
- 2
src/Module/Friendica.php View File

@ -15,7 +15,7 @@ use Friendica\Model\User;
*/
class Friendica extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$app = self::getApp();
$config = $app->getConfig();
@ -88,7 +88,7 @@ class Friendica extends BaseModule
]);
}
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$app = self::getApp();


+ 2
- 2
src/Module/Group.php View File

@ -19,7 +19,7 @@ require_once 'boot.php';
class Group extends BaseModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
$a = self::getApp();
@ -132,7 +132,7 @@ class Group extends BaseModule
}
}
public static function content($parameters)
public static function content(array $parameters = [])
{
$change = false;


+ 1
- 1
src/Module/HTTPException/MethodNotAllowed.php View File

@ -8,7 +8,7 @@ use Friendica\Network\HTTPException;
class MethodNotAllowed extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
throw new HTTPException\MethodNotAllowedException(L10n::t('Method Not Allowed.'));
}


+ 1
- 1
src/Module/HTTPException/PageNotFound.php View File

@ -8,7 +8,7 @@ use Friendica\Network\HTTPException;
class PageNotFound extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
throw new HTTPException\NotFoundException(L10n::t('Page not found.'));
}


+ 1
- 1
src/Module/Hashtag.php View File

@ -15,7 +15,7 @@ use Friendica\Util\Strings;
class Hashtag extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$result = [];


+ 1
- 1
src/Module/Help.php View File

@ -14,7 +14,7 @@ use Friendica\Util\Strings;
*/
class Help extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
Nav::setSelected('help');


+ 1
- 1
src/Module/Home.php View File

@ -12,7 +12,7 @@ use Friendica\Core\Renderer;
*/
class Home extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$app = self::getApp();
$config = $app->getConfig();


+ 1
- 1
src/Module/Inbox.php View File

@ -19,7 +19,7 @@ use Friendica\Util\Network;
*/
class Inbox extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$a = self::getApp();


+ 3
- 3
src/Module/Install.php View File

@ -46,7 +46,7 @@ class Install extends BaseModule
*/
private static $installer;
public static function init($parameters)
public static function init(array $parameters = [])
{
$a = self::getApp();
@ -76,7 +76,7 @@ class Install extends BaseModule
self::$currentWizardStep = ($_POST['pass'] ?? '') ?: self::SYSTEM_CHECK;
}
public static function post($parameters)
public static function post(array $parameters = [])
{
$a = self::getApp();
$configCache = $a->getConfigCache();
@ -149,7 +149,7 @@ class Install extends BaseModule
}
}
public static function content($parameters)
public static function content(array $parameters = [])
{
$a = self::getApp();
$configCache = $a->getConfigCache();


+ 2
- 2
src/Module/Invite.php View File

@ -16,7 +16,7 @@ use Friendica\Util\Strings;
*/
class Invite extends BaseModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));
@ -104,7 +104,7 @@ class Invite extends BaseModule
notice(L10n::tt('%d message sent.', '%d messages sent.', $total) . EOL);
}
public static function content($parameters)
public static function content(array $parameters = [])
{
if (!local_user()) {
throw new HTTPException\ForbiddenException(L10n::t('Permission denied.'));


+ 2
- 2
src/Module/Item/Compose.php View File

@ -21,7 +21,7 @@ use Friendica\Util\Crypto;
class Compose extends BaseModule
{
public static function post($parameters)
public static function post(array $parameters = [])
{
if (!empty($_REQUEST['body'])) {
$_REQUEST['return'] = 'network';
@ -32,7 +32,7 @@ class Compose extends BaseModule
}
}
public static function content($parameters)
public static function content(array $parameters = [])
{
if (!local_user()) {
return Login::form('compose', false);


+ 1
- 1
src/Module/Item/Ignore.php View File

@ -16,7 +16,7 @@ use Friendica\Network\HTTPException;
*/
class Ignore extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
/** @var L10n $l10n */
$l10n = self::getClass(L10n::class);


+ 1
- 1
src/Module/Like.php View File

@ -13,7 +13,7 @@ use Friendica\Util\Strings;
*/
class Like extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
if (!Session::isAuthenticated()) {
throw new HTTPException\ForbiddenException();


+ 2
- 2
src/Module/Login.php View File

@ -30,7 +30,7 @@ use LightOpenID;
*/
class Login extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$a = self::getApp();
@ -41,7 +41,7 @@ class Login extends BaseModule
return self::form(Session::get('return_path'), intval(Config::get('config', 'register_policy')) !== \Friendica\Module\Register::CLOSED);
}
public static function post($parameters)
public static function post(array $parameters = [])
{
$openid_identity = Session::get('openid_identity');
$openid_server = Session::get('openid_server');


+ 1
- 1
src/Module/Logout.php View File

@ -23,7 +23,7 @@ class Logout extends BaseModule
/**
* @brief Process logout requests
*/
public static function init($parameters)
public static function init(array $parameters = [])
{
$visitor_home = null;
if (remote_user()) {


+ 1
- 1
src/Module/Magic.php View File

@ -20,7 +20,7 @@ use Friendica\Util\Strings;
*/
class Magic extends BaseModule
{
public static function init($parameters)
public static function init(array $parameters = [])
{
$a = self::getApp();
$ret = ['success' => false, 'url' => '', 'message' => ''];


+ 1
- 1
src/Module/Maintenance.php View File

@ -14,7 +14,7 @@ use Friendica\Util\Strings;
*/
class Maintenance extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$config = self::getApp()->getConfig();


+ 1
- 1
src/Module/Manifest.php View File

@ -7,7 +7,7 @@ use Friendica\Core\Renderer;
class Manifest extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$app = self::getApp();
$config = $app->getConfig();


+ 2
- 2
src/Module/NodeInfo.php View File

@ -13,7 +13,7 @@ use Friendica\Core\System;
*/
class NodeInfo extends BaseModule
{
public static function init($parameters)
public static function init(array $parameters = [])
{
$config = self::getApp()->getConfig();
@ -22,7 +22,7 @@ class NodeInfo extends BaseModule
}
}
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$app = self::getApp();


+ 3
- 3
src/Module/Notifications/Notify.php View File

@ -14,14 +14,14 @@ use Friendica\Network\HTTPException;
*/
class Notify extends BaseModule
{
public static function init($parameters)
public static function init(array $parameters = [])
{
if (!local_user()) {
throw new HTTPException\UnauthorizedException(L10n::t('Permission denied.'));
}
}
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$a = self::getApp();
@ -45,7 +45,7 @@ class Notify extends BaseModule
* @return string|void
* @throws HTTPException\InternalServerErrorException
*/
public static function content($parameters)
public static function content(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/Objects.php View File

@ -15,7 +15,7 @@ use Friendica\Protocol\ActivityPub;
*/
class Objects extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/Oembed.php View File

@ -17,7 +17,7 @@ use Friendica\Util\Strings;
*/
class Oembed extends BaseModule
{
public static function content($parameters)
public static function content(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/OpenSearch.php View File

@ -16,7 +16,7 @@ class OpenSearch extends BaseModule
/**
* @throws \Exception
*/
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
header('Content-type: application/opensearchdescription+xml');


+ 1
- 1
src/Module/Outbox.php View File

@ -14,7 +14,7 @@ use Friendica\Protocol\ActivityPub;
*/
class Outbox extends BaseModule
{
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
$a = self::getApp();


+ 1
- 1
src/Module/Owa.php View File

@ -27,7 +27,7 @@ use Friendica\Util\Strings;
*/
class Owa extends BaseModule
{
public static function init($parameters)
public static function init(array $parameters = [])
{
$ret = [ 'success' => false ];


+ 1
- 1
src/Module/Photo.php View File

@ -23,7 +23,7 @@ class Photo extends BaseModule
* Fetch a photo or an avatar, in optional size, check for permissions and
* return the image
*/
public static function init($parameters)
public static function init(array $parameters = [])
{
$a = self::getApp();
// @TODO: Replace with parameter from router


+ 3
- 3
src/Module/Profile.php View File

@ -33,7 +33,7 @@ class Profile extends BaseModule
public static $which = '';
public static $profile = 0;
public static function init($parameters)
public static function init(array $parameters = [])
{
$a = self::getApp();
@ -51,7 +51,7 @@ class Profile extends BaseModule
}
}
public static function rawContent($parameters)
public static function rawContent(array $parameters = [])
{
if (ActivityPub::isRequest()) {
$user = DBA::selectFirst('user', ['uid'], ['nickname' => self::$which]);
@ -75,7 +75,7 @@ class Profile extends BaseModule
}
}
public static function content($update = 0)
public static function content(array $parameters = [], $update = 0)
{
$a = self::getApp();