From be193a236e60f4047ab39d9d54a99626d0a7d7e4 Mon Sep 17 00:00:00 2001 From: Art4 Date: Fri, 8 Nov 2024 23:08:40 +0000 Subject: [PATCH] Replace all calls for App::getTimeZone() with AppHelper --- src/Module/Profile/Conversations.php | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/src/Module/Profile/Conversations.php b/src/Module/Profile/Conversations.php index 20ff5040e5..cfe2e51f9a 100644 --- a/src/Module/Profile/Conversations.php +++ b/src/Module/Profile/Conversations.php @@ -7,7 +7,11 @@ namespace Friendica\Module\Profile; -use Friendica\App; +use Friendica\App\Arguments; +use Friendica\App\BaseURL; +use Friendica\App\Mode; +use Friendica\App\Page; +use Friendica\AppHelper; use Friendica\Content\Conversation; use Friendica\Content\Nav; use Friendica\Content\Pager; @@ -39,9 +43,9 @@ use Psr\Log\LoggerInterface; class Conversations extends BaseProfile { - /** @var App */ - private $app; - /** @var App\Page */ + /** @var AppHelper */ + private $appHelper; + /** @var Page */ private $page; /** @var DateTimeFormat */ private $dateTimeFormat; @@ -53,14 +57,14 @@ class Conversations extends BaseProfile private $conversation; /** @var IManagePersonalConfigValues */ private $pConfig; - /** @var App\Mode */ + /** @var Mode */ private $mode; - public function __construct(App\Mode $mode, IManagePersonalConfigValues $pConfig, Conversation $conversation, IHandleUserSessions $session, IManageConfigValues $config, DateTimeFormat $dateTimeFormat, App\Page $page, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = []) + public function __construct(Mode $mode, IManagePersonalConfigValues $pConfig, Conversation $conversation, IHandleUserSessions $session, IManageConfigValues $config, DateTimeFormat $dateTimeFormat, Page $page, AppHelper $appHelper, 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); - $this->app = $app; + $this->appHelper = $appHelper; $this->page = $page; $this->dateTimeFormat = $dateTimeFormat; $this->config = $config; @@ -72,7 +76,7 @@ class Conversations extends BaseProfile protected function content(array $request = []): string { - $profile = ProfileModel::load($this->app, $this->parameters['nickname'] ?? ''); + $profile = ProfileModel::load($this->appHelper, $this->parameters['nickname'] ?? ''); if (empty($profile)) { throw new HTTPException\NotFoundException($this->t('User not found.')); } @@ -166,11 +170,11 @@ class Conversations extends BaseProfile } if (!empty($datequery)) { - $condition = DBA::mergeConditions($condition, ["`received` <= ?", DateTimeFormat::convert($datequery, 'UTC', $this->app->getTimeZone())]); + $condition = DBA::mergeConditions($condition, ["`received` <= ?", DateTimeFormat::convert($datequery, 'UTC', $this->appHelper->getTimeZone())]); } if (!empty($datequery2)) { - $condition = DBA::mergeConditions($condition, ["`received` >= ?", DateTimeFormat::convert($datequery2, 'UTC', $this->app->getTimeZone())]); + $condition = DBA::mergeConditions($condition, ["`received` >= ?", DateTimeFormat::convert($datequery2, 'UTC', $this->appHelper->getTimeZone())]); } // Does the profile page belong to a group?