]> git.mxchange.org Git - friendica.git/commitdiff
Remove obsolete Factory\Api\Mastodon\Error->logError method and related dependencies
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 11 Oct 2023 13:33:53 +0000 (09:33 -0400)
committerHypolite Petovan <hypolite@mrpetovan.com>
Wed, 11 Oct 2023 13:44:03 +0000 (09:44 -0400)
src/Factory/Api/Mastodon/Error.php
static/dependencies.config.php

index 4f7159b7ec7c22c6885061a1e4033f70237fca13..4cf8159fd2fd3c13ccd95ba8fc52320d62030cd9 100644 (file)
 
 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');
index 830b7fec389121eeed1778ca919496c8275b4226..20415e3fe79d49afdd1cef1f4ef4e8753d7cfc20 100644 (file)
@@ -302,11 +302,6 @@ return [
                        ['createClient', [], Dice::CHAIN_CALL],
                ],
        ],
-       Factory\Api\Mastodon\Error::class => [
-               'constructParams' => [
-                       $_SERVER
-               ],
-       ],
        ParsedLogIterator::class => [
                'constructParams' => [
                        [Dice::INSTANCE => Util\ReversedFileReader::class],