Replace all calls for App::getTimeZone() with AppHelper

This commit is contained in:
Art4 2024-11-08 23:08:40 +00:00
parent d9087b4f7c
commit be193a236e

View file

@ -7,7 +7,11 @@
namespace Friendica\Module\Profile; 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\Conversation;
use Friendica\Content\Nav; use Friendica\Content\Nav;
use Friendica\Content\Pager; use Friendica\Content\Pager;
@ -39,9 +43,9 @@ use Psr\Log\LoggerInterface;
class Conversations extends BaseProfile class Conversations extends BaseProfile
{ {
/** @var App */ /** @var AppHelper */
private $app; private $appHelper;
/** @var App\Page */ /** @var Page */
private $page; private $page;
/** @var DateTimeFormat */ /** @var DateTimeFormat */
private $dateTimeFormat; private $dateTimeFormat;
@ -53,14 +57,14 @@ class Conversations extends BaseProfile
private $conversation; private $conversation;
/** @var IManagePersonalConfigValues */ /** @var IManagePersonalConfigValues */
private $pConfig; private $pConfig;
/** @var App\Mode */ /** @var Mode */
private $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); parent::__construct($l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
$this->app = $app; $this->appHelper = $appHelper;
$this->page = $page; $this->page = $page;
$this->dateTimeFormat = $dateTimeFormat; $this->dateTimeFormat = $dateTimeFormat;
$this->config = $config; $this->config = $config;
@ -72,7 +76,7 @@ class Conversations extends BaseProfile
protected function content(array $request = []): string 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)) { if (empty($profile)) {
throw new HTTPException\NotFoundException($this->t('User not found.')); throw new HTTPException\NotFoundException($this->t('User not found.'));
} }
@ -166,11 +170,11 @@ class Conversations extends BaseProfile
} }
if (!empty($datequery)) { 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)) { 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? // Does the profile page belong to a group?