From 20f5a96fe07f5433c0f579bbd741312a198d82c5 Mon Sep 17 00:00:00 2001 From: Art4 Date: Mon, 11 Nov 2024 00:30:58 +0000 Subject: [PATCH] refactor usage of Friendica\App namespace --- bin/worker.php | 3 +-- src/Console/Addon.php | 7 +++---- src/Console/ArchiveContact.php | 6 +++--- src/Console/AutomaticInstallation.php | 7 +++---- src/Console/Cache.php | 8 ++++---- src/Console/Config.php | 6 +++--- src/Console/Contact.php | 6 +++--- src/Console/GlobalCommunityBlock.php | 6 +++--- src/Console/Lock.php | 8 ++++---- src/Console/Maintenance.php | 6 +++--- src/Console/User.php | 6 +++--- src/Core/Hook.php | 1 - src/Core/Session/Factory/Session.php | 9 +++++---- src/Core/Session/Type/Native.php | 4 ++-- src/Core/Update.php | 2 -- src/Model/User/Cookie.php | 9 +++++---- src/Module/Apps.php | 5 +++-- src/Module/BaseNotifications.php | 5 ++--- src/Module/BaseProfile.php | 1 - src/Module/BaseSettings.php | 8 +++++--- src/Module/FriendSuggest.php | 21 +++++++++++---------- src/Module/Friendica.php | 4 +++- src/Module/NodeInfo110.php | 4 +++- src/Module/NodeInfo120.php | 4 +++- src/Module/NodeInfo121.php | 4 +++- src/Module/NodeInfo122.php | 4 +++- src/Module/NodeInfo210.php | 4 +++- src/Module/ParseUrl.php | 6 +++--- src/Module/Register.php | 11 ++++++----- 29 files changed, 93 insertions(+), 82 deletions(-) diff --git a/bin/worker.php b/bin/worker.php index 841ac3574a..29fd5a4fb7 100755 --- a/bin/worker.php +++ b/bin/worker.php @@ -15,7 +15,6 @@ if (php_sapi_name() !== 'cli') { } use Dice\Dice; -use Friendica\App; use Friendica\App\Mode; use Friendica\Core\Logger\Capability\LogChannel; use Friendica\Core\Update; @@ -57,7 +56,7 @@ DI::mode()->setExecutor(Mode::WORKER); Update::check(DI::basePath(), true); // Quit when in maintenance -if (!DI::mode()->has(App\Mode::MAINTENANCEDISABLED)) { +if (!DI::mode()->has(Mode::MAINTENANCEDISABLED)) { return; } diff --git a/src/Console/Addon.php b/src/Console/Addon.php index 43ce7a6be3..8066853246 100644 --- a/src/Console/Addon.php +++ b/src/Console/Addon.php @@ -8,8 +8,7 @@ namespace Friendica\Console; use Console_Table; -use Friendica\App; -use Friendica\Content\Pager; +use Friendica\App\Mode; use Friendica\Core\L10n; use Friendica\Core\Addon as AddonCore; use Friendica\Database\Database; @@ -24,7 +23,7 @@ class Addon extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; /** @@ -57,7 +56,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, L10n $l10n, Database $dba, array $argv = null) + public function __construct(Mode $appMode, L10n $l10n, Database $dba, array $argv = null) { parent::__construct($argv); diff --git a/src/Console/ArchiveContact.php b/src/Console/ArchiveContact.php index 33e1de8600..fef6065823 100644 --- a/src/Console/ArchiveContact.php +++ b/src/Console/ArchiveContact.php @@ -7,7 +7,7 @@ namespace Friendica\Console; -use Friendica\App; +use Friendica\App\Mode; use Friendica\Database\Database; use Friendica\DI; use Friendica\Model\Contact; @@ -28,7 +28,7 @@ class ArchiveContact extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; /** @@ -57,7 +57,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null) + public function __construct(Mode $appMode, Database $dba, \Friendica\Core\L10n $l10n, array $argv = null) { parent::__construct($argv); diff --git a/src/Console/AutomaticInstallation.php b/src/Console/AutomaticInstallation.php index cc932f51c4..198317f7b4 100644 --- a/src/Console/AutomaticInstallation.php +++ b/src/Console/AutomaticInstallation.php @@ -9,8 +9,7 @@ namespace Friendica\Console; use Asika\SimpleConsole\Console; use Exception; -use Friendica\App; -use Friendica\App\BaseURL; +use Friendica\App\Mode; use Friendica\Core\Config\Capability\IManageConfigValues; use Friendica\Core\Config\ValueObject\Cache; use Friendica\Core\Installer; @@ -21,7 +20,7 @@ use RuntimeException; class AutomaticInstallation extends Console { - /** @var App\Mode */ + /** @var Mode */ private $appMode; /** @var \Friendica\Core\Config\ValueObject\Cache */ private $configCache; @@ -87,7 +86,7 @@ Examples HELP; } - public function __construct(App\Mode $appMode, Cache $configCache, IManageConfigValues $config, Database $dba, array $argv = null) + public function __construct(Mode $appMode, Cache $configCache, IManageConfigValues $config, Database $dba, array $argv = null) { parent::__construct($argv); diff --git a/src/Console/Cache.php b/src/Console/Cache.php index 1eb400a7b5..c019c18429 100644 --- a/src/Console/Cache.php +++ b/src/Console/Cache.php @@ -8,7 +8,7 @@ namespace Friendica\Console; use Asika\SimpleConsole\CommandArgsException; -use Friendica\App; +use Friendica\App\Mode; use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Cache\Capability\ICanCache; use RuntimeException; @@ -25,7 +25,7 @@ class Cache extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; @@ -68,7 +68,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, ICanCache $cache, array $argv = null) + public function __construct(Mode $appMode, ICanCache $cache, array $argv = null) { parent::__construct($argv); @@ -85,7 +85,7 @@ HELP; $this->out('Options: ' . var_export($this->options, true)); } - if (!$this->appMode->has(App\Mode::DBAVAILABLE)) { + if (!$this->appMode->has(Mode::DBAVAILABLE)) { $this->out('Database isn\'t ready or populated yet, database cache won\'t be available'); } diff --git a/src/Console/Config.php b/src/Console/Config.php index 578efe964b..7b222a4481 100644 --- a/src/Console/Config.php +++ b/src/Console/Config.php @@ -8,7 +8,7 @@ namespace Friendica\Console; use Asika\SimpleConsole\CommandArgsException; -use Friendica\App; +use Friendica\App\Mode; use Friendica\Core\Config\Capability\IManageConfigValues; use RuntimeException; @@ -38,7 +38,7 @@ class Config extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; /** @@ -80,7 +80,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, IManageConfigValues $config, array $argv = null) + public function __construct(Mode $appMode, IManageConfigValues $config, array $argv = null) { parent::__construct($argv); diff --git a/src/Console/Contact.php b/src/Console/Contact.php index 46a26c4a9d..b33baa6efa 100644 --- a/src/Console/Contact.php +++ b/src/Console/Contact.php @@ -8,7 +8,7 @@ namespace Friendica\Console; use Console_Table; -use Friendica\App; +use Friendica\App\Mode; use Friendica\DI; use Friendica\Model\Contact as ContactModel; use Friendica\Model\User as UserModel; @@ -25,7 +25,7 @@ class Contact extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; /** @@ -55,7 +55,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, array $argv = null) + public function __construct(Mode $appMode, array $argv = null) { parent::__construct($argv); diff --git a/src/Console/GlobalCommunityBlock.php b/src/Console/GlobalCommunityBlock.php index 946b0dbd43..2e85491455 100644 --- a/src/Console/GlobalCommunityBlock.php +++ b/src/Console/GlobalCommunityBlock.php @@ -7,7 +7,7 @@ namespace Friendica\Console; -use Friendica\App; +use Friendica\App\Mode; use Friendica\Core\L10n; use Friendica\Model\Contact; @@ -22,7 +22,7 @@ class GlobalCommunityBlock extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; /** @@ -48,7 +48,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, L10n $l10n, $argv = null) + public function __construct(Mode $appMode, L10n $l10n, $argv = null) { parent::__construct($argv); diff --git a/src/Console/Lock.php b/src/Console/Lock.php index b5fca2e63f..f883adfc6e 100644 --- a/src/Console/Lock.php +++ b/src/Console/Lock.php @@ -8,7 +8,7 @@ namespace Friendica\Console; use Asika\SimpleConsole\CommandArgsException; -use Friendica\App; +use Friendica\App\Mode; use Friendica\Core\Lock\Capability\ICanLock; use RuntimeException; @@ -23,7 +23,7 @@ class Lock extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; @@ -62,7 +62,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, ICanLock $lock, array $argv = null) + public function __construct(Mode $appMode, ICanLock $lock, array $argv = null) { parent::__construct($argv); @@ -79,7 +79,7 @@ HELP; $this->out('Options: ' . var_export($this->options, true)); } - if (!$this->appMode->has(App\Mode::DBAVAILABLE)) { + if (!$this->appMode->has(Mode::DBAVAILABLE)) { $this->out('Database isn\'t ready or populated yet, database cache won\'t be available'); } diff --git a/src/Console/Maintenance.php b/src/Console/Maintenance.php index 27caa32190..168bccd164 100644 --- a/src/Console/Maintenance.php +++ b/src/Console/Maintenance.php @@ -7,7 +7,7 @@ namespace Friendica\Console; -use Friendica\App; +use Friendica\App\Mode; use Friendica\Core\Config\Capability\IManageConfigValues; /** @@ -18,7 +18,7 @@ class Maintenance extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; /** @@ -55,7 +55,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, IManageConfigValues $config, $argv = null) + public function __construct(Mode $appMode, IManageConfigValues $config, $argv = null) { parent::__construct($argv); diff --git a/src/Console/User.php b/src/Console/User.php index 42e85f007d..89c217694d 100644 --- a/src/Console/User.php +++ b/src/Console/User.php @@ -8,7 +8,7 @@ namespace Friendica\Console; use Console_Table; -use Friendica\App; +use Friendica\App\Mode; use Friendica\Content\Pager; use Friendica\Core\L10n; use Friendica\Core\PConfig\Capability\IManagePersonalConfigValues; @@ -26,7 +26,7 @@ class User extends \Asika\SimpleConsole\Console protected $helpOptions = ['h', 'help', '?']; /** - * @var App\Mode + * @var Mode */ private $appMode; /** @@ -74,7 +74,7 @@ HELP; return $help; } - public function __construct(App\Mode $appMode, L10n $l10n, IManagePersonalConfigValues $pConfig, array $argv = null) + public function __construct(Mode $appMode, L10n $l10n, IManagePersonalConfigValues $pConfig, array $argv = null) { parent::__construct($argv); diff --git a/src/Core/Hook.php b/src/Core/Hook.php index c3c994a314..bbf634401a 100644 --- a/src/Core/Hook.php +++ b/src/Core/Hook.php @@ -7,7 +7,6 @@ namespace Friendica\Core; -use Friendica\App; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Util\Strings; diff --git a/src/Core/Session/Factory/Session.php b/src/Core/Session/Factory/Session.php index 735300b1d6..7855cf35d6 100644 --- a/src/Core/Session/Factory/Session.php +++ b/src/Core/Session/Factory/Session.php @@ -7,7 +7,8 @@ namespace Friendica\Core\Session\Factory; -use Friendica\App; +use Friendica\App\BaseURL; +use Friendica\App\Mode; use Friendica\Core\Cache\Factory\Cache; use Friendica\Core\Cache\Type\DatabaseCache; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -33,8 +34,8 @@ class Session const HANDLER_DEFAULT = self::HANDLER_DATABASE; /** - * @param App\Mode $mode - * @param App\BaseURL $baseURL + * @param Mode $mode + * @param BaseURL $baseURL * @param IManageConfigValues $config * @param Database $dba * @param Cache $cacheFactory @@ -43,7 +44,7 @@ class Session * @param array $server * @return IHandleSessions */ - public function create(App\Mode $mode, App\BaseURL $baseURL, IManageConfigValues $config, Database $dba, Cache $cacheFactory, LoggerInterface $logger, Profiler $profiler, array $server = []): IHandleSessions + public function create(Mode $mode, BaseURL $baseURL, IManageConfigValues $config, Database $dba, Cache $cacheFactory, LoggerInterface $logger, Profiler $profiler, array $server = []): IHandleSessions { $profiler->startRecording('session'); $session_handler = $config->get('system', 'session_handler', self::HANDLER_DEFAULT); diff --git a/src/Core/Session/Type/Native.php b/src/Core/Session/Type/Native.php index fc6f41c466..ebde0d4954 100644 --- a/src/Core/Session/Type/Native.php +++ b/src/Core/Session/Type/Native.php @@ -7,7 +7,7 @@ namespace Friendica\Core\Session\Type; -use Friendica\App; +use Friendica\App\BaseURL; use Friendica\Core\Session\Capability\IHandleSessions; use Friendica\Model\User\Cookie; use SessionHandlerInterface; @@ -17,7 +17,7 @@ use SessionHandlerInterface; */ class Native extends AbstractSession implements IHandleSessions { - public function __construct(App\BaseURL $baseURL, SessionHandlerInterface $handler = null) + public function __construct(BaseURL $baseURL, SessionHandlerInterface $handler = null) { ini_set('session.gc_probability', 50); ini_set('session.use_only_cookies', 1); diff --git a/src/Core/Update.php b/src/Core/Update.php index 7c3f508037..f19dfb0867 100644 --- a/src/Core/Update.php +++ b/src/Core/Update.php @@ -7,7 +7,6 @@ namespace Friendica\Core; -use Friendica\App; use Friendica\App\Mode; use Friendica\Database\DBA; use Friendica\Database\DBStructure; @@ -29,7 +28,6 @@ class Update * * @param string $basePath The base path of this application * @param boolean $via_worker Is the check run via the worker? - * @param App\Mode $mode The current app mode * @return void * @throws \Friendica\Network\HTTPException\InternalServerErrorException */ diff --git a/src/Model/User/Cookie.php b/src/Model/User/Cookie.php index d28767524f..69270478f8 100644 --- a/src/Model/User/Cookie.php +++ b/src/Model/User/Cookie.php @@ -7,7 +7,8 @@ namespace Friendica\Model\User; -use Friendica\App; +use Friendica\App\BaseURL; +use Friendica\App\Request; use Friendica\Core\Config\Capability\IManageConfigValues; /** @@ -38,12 +39,12 @@ class Cookie private $data; /** - * @param App\Request $request The current http request + * @param Request $request The current http request * @param IManageConfigValues $config - * @param App\BaseURL $baseURL + * @param BaseURL $baseURL * @param array $COOKIE The $_COOKIE array */ - public function __construct(App\Request $request, IManageConfigValues $config, App\BaseURL $baseURL, array $COOKIE = []) + public function __construct(Request $request, IManageConfigValues $config, BaseURL $baseURL, array $COOKIE = []) { $this->sslEnabled = $baseURL->getScheme() === 'https'; $this->sitePrivateKey = $config->get('system', 'site_prvkey'); diff --git a/src/Module/Apps.php b/src/Module/Apps.php index fe910d9367..873eea237d 100644 --- a/src/Module/Apps.php +++ b/src/Module/Apps.php @@ -7,7 +7,8 @@ namespace Friendica\Module; -use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Content\Nav; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -28,7 +29,7 @@ class Apps extends BaseModule /** @var SystemMessages */ protected $systemMessages; - public function __construct(SystemMessages $systemMessages, Nav $nav, IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) + public function __construct(SystemMessages $systemMessages, Nav $nav, IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/BaseNotifications.php b/src/Module/BaseNotifications.php index 3b42b46c6d..f9f47d4a21 100644 --- a/src/Module/BaseNotifications.php +++ b/src/Module/BaseNotifications.php @@ -8,14 +8,13 @@ namespace Friendica\Module; use Exception; -use Friendica\App; use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Content\Pager; use Friendica\Core\L10n; use Friendica\Core\Renderer; use Friendica\Core\Session\Capability\IHandleUserSessions; -use Friendica\Core\System; use Friendica\Navigation\Notifications\ValueObject\FormattedNotify; use Friendica\Network\HTTPException\ForbiddenException; use Friendica\Util\Profiler; @@ -76,7 +75,7 @@ abstract class BaseNotifications extends BaseModule */ abstract public function getNotifications(); - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = []) + public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $session, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/BaseProfile.php b/src/Module/BaseProfile.php index a7b610e276..2fab793152 100644 --- a/src/Module/BaseProfile.php +++ b/src/Module/BaseProfile.php @@ -7,7 +7,6 @@ namespace Friendica\Module; -use Friendica\App; use Friendica\BaseModule; use Friendica\Content\Feature; use Friendica\Core\Hook; diff --git a/src/Module/BaseSettings.php b/src/Module/BaseSettings.php index 693554f493..143360c137 100644 --- a/src/Module/BaseSettings.php +++ b/src/Module/BaseSettings.php @@ -7,7 +7,9 @@ namespace Friendica\Module; -use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; +use Friendica\App\Page; use Friendica\BaseModule; use Friendica\Content\Feature; use Friendica\Content\Nav; @@ -20,12 +22,12 @@ use Psr\Log\LoggerInterface; class BaseSettings extends BaseModule { - /** @var App\Page */ + /** @var Page */ protected $page; /** @var IHandleUserSessions */ protected $session; - public function __construct(IHandleUserSessions $session, App\Page $page, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) + public function __construct(IHandleUserSessions $session, Page $page, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/FriendSuggest.php b/src/Module/FriendSuggest.php index 717e471460..4c9720a6d6 100644 --- a/src/Module/FriendSuggest.php +++ b/src/Module/FriendSuggest.php @@ -7,7 +7,8 @@ namespace Friendica\Module; -use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Core\L10n; use Friendica\Core\Protocol; @@ -35,7 +36,7 @@ class FriendSuggest extends BaseModule /** @var \Friendica\Contact\FriendSuggest\Factory\FriendSuggest */ protected $friendSuggestFac; - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, array $server, array $parameters = []) + public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, Database $dba, \Friendica\Contact\FriendSuggest\Repository\FriendSuggest $friendSuggestRepo, \Friendica\Contact\FriendSuggest\Factory\FriendSuggest $friendSuggestFac, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); @@ -97,14 +98,14 @@ class FriendSuggest extends BaseModule } $suggestableContacts = ContactModel::selectToArray(['id', 'name'], [ - '`uid` = ? - AND `id` != ? - AND `network` = ? - AND NOT `self` - AND NOT `blocked` - AND NOT `pending` - AND NOT `archive` - AND NOT `deleted` + '`uid` = ? + AND `id` != ? + AND `network` = ? + AND NOT `self` + AND NOT `blocked` + AND NOT `pending` + AND NOT `archive` + AND NOT `deleted` AND `notify` != ""', DI::userSession()->getLocalUserId(), $cid, diff --git a/src/Module/Friendica.php b/src/Module/Friendica.php index c7e4ca983f..cd1362b3af 100644 --- a/src/Module/Friendica.php +++ b/src/Module/Friendica.php @@ -8,6 +8,8 @@ namespace Friendica\Module; use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Core\Addon; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -36,7 +38,7 @@ class Friendica extends BaseModule /** @var IHandleUserSessions */ private $session; - public function __construct(IHandleUserSessions $session, IManageKeyValuePairs $keyValue, IManageConfigValues $config, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) + public function __construct(IHandleUserSessions $session, IManageKeyValuePairs $keyValue, IManageConfigValues $config, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/NodeInfo110.php b/src/Module/NodeInfo110.php index 2e58e6edd5..969d4dd7db 100644 --- a/src/Module/NodeInfo110.php +++ b/src/Module/NodeInfo110.php @@ -8,6 +8,8 @@ namespace Friendica\Module; use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -25,7 +27,7 @@ class NodeInfo110 extends BaseModule /** @var IManageConfigValues */ protected $config; - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) + public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/NodeInfo120.php b/src/Module/NodeInfo120.php index fc1e48171a..a9fcecd6b9 100644 --- a/src/Module/NodeInfo120.php +++ b/src/Module/NodeInfo120.php @@ -8,6 +8,8 @@ namespace Friendica\Module; use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -25,7 +27,7 @@ class NodeInfo120 extends BaseModule /** @var IManageConfigValues */ protected $config; - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) + public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/NodeInfo121.php b/src/Module/NodeInfo121.php index 6a343c1c9d..903af26557 100644 --- a/src/Module/NodeInfo121.php +++ b/src/Module/NodeInfo121.php @@ -8,6 +8,8 @@ namespace Friendica\Module; use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -25,7 +27,7 @@ class NodeInfo121 extends BaseModule /** @var IManageConfigValues */ protected $config; - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) + public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/NodeInfo122.php b/src/Module/NodeInfo122.php index 0ad5b71ff8..7c3a675469 100644 --- a/src/Module/NodeInfo122.php +++ b/src/Module/NodeInfo122.php @@ -8,6 +8,8 @@ namespace Friendica\Module; use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -25,7 +27,7 @@ class NodeInfo122 extends BaseModule /** @var IManageConfigValues */ protected $config; - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) + public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/NodeInfo210.php b/src/Module/NodeInfo210.php index 04a1635d86..bd1d1cdf39 100644 --- a/src/Module/NodeInfo210.php +++ b/src/Module/NodeInfo210.php @@ -8,6 +8,8 @@ namespace Friendica\Module; use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Capabilities\ICanCreateResponses; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -25,7 +27,7 @@ class NodeInfo210 extends BaseModule /** @var IManageConfigValues */ protected $config; - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) + public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/ParseUrl.php b/src/Module/ParseUrl.php index ae5d5a3aeb..8da72c742c 100644 --- a/src/Module/ParseUrl.php +++ b/src/Module/ParseUrl.php @@ -7,13 +7,13 @@ namespace Friendica\Module; -use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Content\Text\BBCode; use Friendica\Core\Hook; use Friendica\Core\L10n; use Friendica\Core\Session\Capability\IHandleUserSessions; -use Friendica\Core\System; use Friendica\Network\HTTPException\BadRequestException; use Friendica\Util; use Friendica\Util\Profiler; @@ -24,7 +24,7 @@ class ParseUrl extends BaseModule /** @var IHandleUserSessions */ protected $userSession; - public function __construct(L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, $server, array $parameters = []) + public function __construct(L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IHandleUserSessions $userSession, $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); diff --git a/src/Module/Register.php b/src/Module/Register.php index 2cba4b97c8..927264e2a5 100644 --- a/src/Module/Register.php +++ b/src/Module/Register.php @@ -7,7 +7,8 @@ namespace Friendica\Module; -use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; use Friendica\BaseModule; use Friendica\Content\Text\BBCode; use Friendica\Core\Config\Capability\IManageConfigValues; @@ -41,7 +42,7 @@ class Register extends BaseModule /** @var IHandleUserSessions */ private $session; - public function __construct(IHandleUserSessions $session, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) + public function __construct(IHandleUserSessions $session, L10n $l10n, BaseURL $baseUrl, Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, IManageConfigValues $config, array $server, array $parameters = []) { parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters); @@ -277,7 +278,7 @@ class Register extends BaseModule $regdata = ['email' => $arr['email'], 'nickname' => $arr['nickname'], 'username' => $arr['username']]; DI::baseUrl()->redirect('register?' . http_build_query($regdata)); } - + //Check if nickname contains only US-ASCII and do not start with a digit if (!preg_match('/^[a-zA-Z][a-zA-Z0-9]*$/', $arr['nickname'])) { if (is_numeric(substr($arr['nickname'], 0, 1))) { @@ -289,7 +290,7 @@ class Register extends BaseModule DI::baseUrl()->redirect('register?' . http_build_query($regdata)); return; } - + $arr['blocked'] = $blocked; $arr['verified'] = $verified; $arr['language'] = L10n::detectLanguage($_SERVER, $_GET, DI::config()->get('system', 'language')); @@ -433,6 +434,6 @@ class Register extends BaseModule return intval(DI::config()->get('config', 'register_policy')); } } - return self::CLOSED; + return self::CLOSED; } }