mirror of
https://github.com/friendica/friendica
synced 2025-04-19 07:10:11 +00:00
Add Factory\Api\Mastodon\Error dependency to BaseApi
- Copy Factory\Api\Mastodon\Error->logError functionality to BaseApi
This commit is contained in:
parent
48be5a534d
commit
f70a64891c
21 changed files with 61 additions and 47 deletions
|
@ -43,9 +43,9 @@ class Instance extends BaseApi
|
|||
/** @var IManageConfigValues */
|
||||
private $config;
|
||||
|
||||
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, Database $database, IManageConfigValues $config, array $server, array $parameters = [])
|
||||
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, Database $database, IManageConfigValues $config, array $server, array $parameters = [])
|
||||
{
|
||||
parent::__construct($app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->database = $database;
|
||||
$this->config = $config;
|
||||
|
|
|
@ -54,6 +54,7 @@ class InstanceV2 extends BaseApi
|
|||
private $contactHeader;
|
||||
|
||||
public function __construct(
|
||||
\Friendica\Factory\Api\Mastodon\Error $errorFactory,
|
||||
App $app,
|
||||
L10n $l10n,
|
||||
App\BaseURL $baseUrl,
|
||||
|
@ -66,7 +67,7 @@ class InstanceV2 extends BaseApi
|
|||
array $server,
|
||||
array $parameters = []
|
||||
) {
|
||||
parent::__construct($app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->database = $database;
|
||||
$this->config = $config;
|
||||
|
|
|
@ -39,15 +39,12 @@ class PushSubscription extends BaseApi
|
|||
{
|
||||
/** @var SubscriptionFactory */
|
||||
protected $subscriptionFac;
|
||||
/** @var Error */
|
||||
protected $errorFac;
|
||||
|
||||
public function __construct(App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, SubscriptionFactory $subscriptionFac, Error $errorFac, array $server, array $parameters = [])
|
||||
public function __construct(\Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, SubscriptionFactory $subscriptionFac, array $server, array $parameters = [])
|
||||
{
|
||||
parent::__construct($app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->subscriptionFac = $subscriptionFac;
|
||||
$this->errorFac = $errorFac;
|
||||
}
|
||||
|
||||
protected function post(array $request = []): void
|
||||
|
@ -97,7 +94,7 @@ class PushSubscription extends BaseApi
|
|||
$subscription = Subscription::select($application['id'], $uid, ['id']);
|
||||
if (empty($subscription)) {
|
||||
$this->logger->info('Subscription not found', ['application-id' => $application['id'], 'uid' => $uid]);
|
||||
$this->errorFac->RecordNotFound();
|
||||
$this->errorFactory->RecordNotFound();
|
||||
}
|
||||
|
||||
$fields = [
|
||||
|
@ -148,7 +145,7 @@ class PushSubscription extends BaseApi
|
|||
|
||||
if (!Subscription::exists($application['id'], $uid)) {
|
||||
$this->logger->info('Subscription not found', ['application-id' => $application['id'], 'uid' => $uid]);
|
||||
$this->errorFac->RecordNotFound();
|
||||
$this->errorFactory->RecordNotFound();
|
||||
}
|
||||
|
||||
$this->logger->info('Fetch subscription', ['application-id' => $application['id'], 'uid' => $uid]);
|
||||
|
|
|
@ -41,9 +41,9 @@ class Reports extends BaseApi
|
|||
/** @var \Friendica\Moderation\Repository\Report */
|
||||
private $reportRepo;
|
||||
|
||||
public function __construct(\Friendica\Moderation\Repository\Report $reportRepo, \Friendica\Moderation\Factory\Report $reportFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||
public function __construct(\Friendica\Moderation\Repository\Report $reportRepo, \Friendica\Moderation\Factory\Report $reportFactory, \Friendica\Factory\Api\Mastodon\Error $errorFactory, App $app, L10n $l10n, App\BaseURL $baseUrl, App\Arguments $args, LoggerInterface $logger, Profiler $profiler, ApiResponse $response, array $server, array $parameters = [])
|
||||
{
|
||||
parent::__construct($app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
parent::__construct($errorFactory, $app, $l10n, $baseUrl, $args, $logger, $profiler, $response, $server, $parameters);
|
||||
|
||||
$this->reportFactory = $reportFactory;
|
||||
$this->reportRepo = $reportRepo;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue