From eb583330dfe76f5076b5ec7ab6dae2604870e3b7 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 11 Oct 2023 09:33:53 -0400 Subject: [PATCH] Remove obsolete Factory\Api\Mastodon\Error->logError method and related dependencies --- src/Factory/Api/Mastodon/Error.php | 15 +-------------- static/dependencies.config.php | 5 ----- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/src/Factory/Api/Mastodon/Error.php b/src/Factory/Api/Mastodon/Error.php index 4f7159b7ec..4cf8159fd2 100644 --- a/src/Factory/Api/Mastodon/Error.php +++ b/src/Factory/Api/Mastodon/Error.php @@ -21,35 +21,22 @@ namespace Friendica\Factory\Api\Mastodon; -use Friendica\App\Arguments; use Friendica\BaseFactory; use Friendica\Core\L10n; -use Friendica\Core\System; use Psr\Log\LoggerInterface; /** @todo A Factory shouldn't return something to the frontpage, it's for creating content, not showing it */ class Error extends BaseFactory { - /** @var Arguments */ - private $args; - /** @var string[] The $_SERVER array */ - private $server; /** @var L10n */ private $l10n; - public function __construct(LoggerInterface $logger, Arguments $args, L10n $l10n, array $server) + public function __construct(LoggerInterface $logger, L10n $l10n) { parent::__construct($logger); - $this->args = $args; - $this->server = $server; $this->l10n = $l10n; } - private function logError(int $errorno, string $error) - { - $this->logger->info('API Error', ['no' => $errorno, 'error' => $error, 'method' => $this->args->getMethod(), 'command' => $this->args->getQueryString(), 'user-agent' => $this->server['HTTP_USER_AGENT'] ?? '']); - } - public function RecordNotFound(): \Friendica\Object\Api\Mastodon\Error { $error = $this->l10n->t('Record not found'); diff --git a/static/dependencies.config.php b/static/dependencies.config.php index 830b7fec38..20415e3fe7 100644 --- a/static/dependencies.config.php +++ b/static/dependencies.config.php @@ -302,11 +302,6 @@ return [ ['createClient', [], Dice::CHAIN_CALL], ], ], - Factory\Api\Mastodon\Error::class => [ - 'constructParams' => [ - $_SERVER - ], - ], ParsedLogIterator::class => [ 'constructParams' => [ [Dice::INSTANCE => Util\ReversedFileReader::class],