Replace typehint App with AppHelper in all classes

This commit is contained in:
Art4 2024-11-10 23:33:28 +00:00
parent 712b9e9610
commit 14ec1950b9
52 changed files with 344 additions and 231 deletions

View file

@ -7,7 +7,10 @@
namespace Friendica\Module\Profile;
use Friendica\App;
use Friendica\App\Arguments;
use Friendica\App\BaseURL;
use Friendica\App\Page;
use Friendica\AppHelper;
use Friendica\Content\Feature;
use Friendica\Content\GroupManager;
use Friendica\Content\Nav;
@ -43,23 +46,23 @@ class Profile extends BaseProfile
{
/** @var Database */
private $database;
/** @var App */
private $app;
/** @var AppHelper */
protected $appHelper;
/** @var IHandleUserSessions */
private $session;
/** @var IManageConfigValues */
private $config;
/** @var App\Page */
/** @var Page */
private $page;
/** @var ProfileField */
private $profileField;
public function __construct(ProfileField $profileField, App\Page $page, IManageConfigValues $config, IHandleUserSessions $session, App $app, Database $database, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, Response $response, array $server, array $parameters = [])
public function __construct(ProfileField $profileField, Page $page, IManageConfigValues $config, IHandleUserSessions $session, AppHelper $appHelper, Database $database, 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->database = $database;
$this->app = $app;
$this->appHelper = $appHelper;
$this->session = $session;
$this->config = $config;
$this->page = $page;
@ -95,7 +98,7 @@ class Profile 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 (!$profile) {
throw new HTTPException\NotFoundException($this->t('Profile not found.'));
}
@ -374,10 +377,10 @@ class Profile extends BaseProfile
/**
* Clean the provided input to prevent XSS problems
* @param int $uri_id
* @param string $input
* @return string
* @throws InternalServerErrorException
* @param int $uri_id
* @param string $input
* @return string
* @throws InternalServerErrorException
*/
private function cleanInput(int $uri_id, string $input): string
{