remove unused LoggerInterface dependencies

Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
This commit is contained in:
Christian Hartmann 2024-09-11 22:27:41 +02:00
Родитель cb5fe778e1
Коммит 83a14ff136
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 01CF79F7199D2C63
12 изменённых файлов: 2 добавлений и 51 удалений

Просмотреть файл

@ -31,8 +31,6 @@ use OCP\IGroupManager;
use OCP\IUser; use OCP\IUser;
use OCP\Share\IShare; use OCP\Share\IShare;
use Psr\Log\LoggerInterface;
class ActivityManager { class ActivityManager {
public function __construct( public function __construct(
@ -40,7 +38,6 @@ class ActivityManager {
private ?string $userId, private ?string $userId,
private IManager $manager, private IManager $manager,
private IGroupManager $groupManager, private IGroupManager $groupManager,
private LoggerInterface $logger,
private CirclesService $circlesService, private CirclesService $circlesService,
) { ) {
} }

Просмотреть файл

@ -16,14 +16,12 @@ use OCA\Forms\Db\FormMapper;
use OCA\Forms\Service\FormsService; use OCA\Forms\Service\FormsService;
use OCA\Forms\Service\SubmissionService; use OCA\Forms\Service\SubmissionService;
use OCP\IL10N; use OCP\IL10N;
use Psr\Log\LoggerInterface;
class AnalyticsDatasource implements IDatasource { class AnalyticsDatasource implements IDatasource {
public function __construct( public function __construct(
protected ?string $userId, protected ?string $userId,
private IL10N $l10n, private IL10N $l10n,
private LoggerInterface $logger,
private FormMapper $formMapper, private FormMapper $formMapper,
private FormsService $formsService, private FormsService $formsService,
private SubmissionService $submissionService, private SubmissionService $submissionService,

Просмотреть файл

@ -50,8 +50,6 @@ use OCP\IUserManager;
use OCP\IUserSession; use OCP\IUserSession;
use OCP\Util; use OCP\Util;
use Psr\Log\LoggerInterface;
class PageController extends Controller { class PageController extends Controller {
private const TEMPLATE_MAIN = 'main'; private const TEMPLATE_MAIN = 'main';
@ -65,7 +63,6 @@ class PageController extends Controller {
private IAccountManager $accountManager, private IAccountManager $accountManager,
private IInitialState $initialState, private IInitialState $initialState,
private IL10N $l10n, private IL10N $l10n,
private LoggerInterface $logger,
private IUrlGenerator $urlGenerator, private IUrlGenerator $urlGenerator,
private IUserManager $userManager, private IUserManager $userManager,
private IUserSession $userSession, private IUserSession $userSession,

Просмотреть файл

@ -31,7 +31,6 @@ use OCP\AppFramework\Db\QBMapper;
use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection; use OCP\IDBConnection;
use OCP\Share\IShare; use OCP\Share\IShare;
use Psr\Log\LoggerInterface;
/** /**
* @extends QBMapper<Form> * @extends QBMapper<Form>
@ -46,7 +45,6 @@ class FormMapper extends QBMapper {
private QuestionMapper $questionMapper, private QuestionMapper $questionMapper,
private ShareMapper $shareMapper, private ShareMapper $shareMapper,
private SubmissionMapper $submissionMapper, private SubmissionMapper $submissionMapper,
private LoggerInterface $logger,
IDBConnection $db, IDBConnection $db,
) { ) {
parent::__construct($db, 'forms_v2_forms', Form::class); parent::__construct($db, 'forms_v2_forms', Form::class);

Просмотреть файл

@ -29,15 +29,12 @@ use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener; use OCP\EventDispatcher\IEventListener;
use OCP\User\Events\UserDeletedEvent; use OCP\User\Events\UserDeletedEvent;
use Psr\Log\LoggerInterface;
/** /**
* @implements IEventListener<UserDeletedEvent> * @implements IEventListener<UserDeletedEvent>
*/ */
class UserDeletedListener implements IEventListener { class UserDeletedListener implements IEventListener {
public function __construct( public function __construct(
private IJobList $jobList, private IJobList $jobList
private LoggerInterface $logger
) { ) {
} }

Просмотреть файл

@ -33,8 +33,6 @@ use OCP\IGroupManager;
use OCP\IUser; use OCP\IUser;
use OCP\IUserSession; use OCP\IUserSession;
use Psr\Log\LoggerInterface;
class ConfigService { class ConfigService {
private ?IUser $currentUser; private ?IUser $currentUser;
@ -42,7 +40,6 @@ class ConfigService {
protected string $appName, protected string $appName,
private IConfig $config, private IConfig $config,
private IGroupManager $groupManager, private IGroupManager $groupManager,
private LoggerInterface $logger,
IUserSession $userSession IUserSession $userSession
) { ) {
$this->currentUser = $userSession->getUser(); $this->currentUser = $userSession->getUser();

Просмотреть файл

@ -50,7 +50,6 @@ use OCP\IUserManager;
use OCP\IUserSession; use OCP\IUserSession;
use OCP\Security\ISecureRandom; use OCP\Security\ISecureRandom;
use OCP\Share\IShare; use OCP\Share\IShare;
use Psr\Log\LoggerInterface;
/** /**
* Trait for getting forms information in a service * Trait for getting forms information in a service
@ -68,7 +67,6 @@ class FormsService {
private SubmissionMapper $submissionMapper, private SubmissionMapper $submissionMapper,
private ConfigService $configService, private ConfigService $configService,
private IGroupManager $groupManager, private IGroupManager $groupManager,
private LoggerInterface $logger,
private IUserManager $userManager, private IUserManager $userManager,
private ISecureRandom $secureRandom, private ISecureRandom $secureRandom,
private CirclesService $circlesService, private CirclesService $circlesService,

Просмотреть файл

@ -34,7 +34,6 @@ use OCP\IGroupManager;
use OCP\IUser; use OCP\IUser;
use OCP\Share\IShare; use OCP\Share\IShare;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase; use Test\TestCase;
class ActivityManagerTest extends TestCase { class ActivityManagerTest extends TestCase {
@ -48,9 +47,6 @@ class ActivityManagerTest extends TestCase {
/** @var IGroupManager|MockObject */ /** @var IGroupManager|MockObject */
private $groupManager; private $groupManager;
/** @var LoggerInterface|MockObject */
private $logger;
/** @var CirclesService|MockObject */ /** @var CirclesService|MockObject */
private $circlesService; private $circlesService;
@ -58,10 +54,9 @@ class ActivityManagerTest extends TestCase {
parent::setUp(); parent::setUp();
$this->manager = $this->createMock(IManager::class); $this->manager = $this->createMock(IManager::class);
$this->groupManager = $this->createMock(IGroupManager::class); $this->groupManager = $this->createMock(IGroupManager::class);
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$this->circlesService = $this->createMock(CirclesService::class); $this->circlesService = $this->createMock(CirclesService::class);
$this->activityManager = new ActivityManager('forms', 'currentUser', $this->manager, $this->groupManager, $this->logger, $this->circlesService); $this->activityManager = new ActivityManager('forms', 'currentUser', $this->manager, $this->groupManager, $this->circlesService);
} }
public function testPublishNewShare() { public function testPublishNewShare() {

Просмотреть файл

@ -31,13 +31,11 @@ use OCA\Forms\Service\FormsService;
use OCA\Forms\Service\SubmissionService; use OCA\Forms\Service\SubmissionService;
use OCP\IL10N; use OCP\IL10N;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase; use Test\TestCase;
class AnalyticsDatasourceTest extends TestCase { class AnalyticsDatasourceTest extends TestCase {
private IL10N|MockObject $l10n; private IL10N|MockObject $l10n;
private LoggerInterface|MockObject $logger;
private FormMapper|MockObject $formMapper; private FormMapper|MockObject $formMapper;
private FormsService|MockObject $formsService; private FormsService|MockObject $formsService;
private SubmissionService|MockObject $submissionService; private SubmissionService|MockObject $submissionService;
@ -52,7 +50,6 @@ class AnalyticsDatasourceTest extends TestCase {
} }
$this->l10n = $this->createMock(IL10N::class); $this->l10n = $this->createMock(IL10N::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->formMapper = $this->createMock(FormMapper::class); $this->formMapper = $this->createMock(FormMapper::class);
$this->formsService = $this->createMock(FormsService::class); $this->formsService = $this->createMock(FormsService::class);
$this->submissionService = $this->createMock(SubmissionService::class); $this->submissionService = $this->createMock(SubmissionService::class);
@ -60,7 +57,6 @@ class AnalyticsDatasourceTest extends TestCase {
$this->analyticsDatasource = new AnalyticsDatasource( $this->analyticsDatasource = new AnalyticsDatasource(
null, null,
$this->l10n, $this->l10n,
$this->logger,
$this->formMapper, $this->formMapper,
$this->formsService, $this->formsService,
$this->submissionService, $this->submissionService,

Просмотреть файл

@ -39,7 +39,6 @@ use OCP\IURLGenerator;
use OCP\IUserManager; use OCP\IUserManager;
use OCP\IUserSession; use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase; use Test\TestCase;
@ -48,9 +47,6 @@ class PageControllerTest extends TestCase {
/** @var PageController */ /** @var PageController */
private $pageController; private $pageController;
/** @var LoggerInterface|MockObject */
private $logger;
/** @var IRequest|MockObject */ /** @var IRequest|MockObject */
private $request; private $request;
@ -95,7 +91,6 @@ class PageControllerTest extends TestCase {
$this->accountManager = $this->createMock(IAccountManager::class); $this->accountManager = $this->createMock(IAccountManager::class);
$this->initialState = $this->createMock(IInitialState::class); $this->initialState = $this->createMock(IInitialState::class);
$this->l10n = $this->createMock(IL10N::class); $this->l10n = $this->createMock(IL10N::class);
$this->logger = $this->createMock(LoggerInterface::class);
$this->urlGenerator = $this->createMock(IURLGenerator::class); $this->urlGenerator = $this->createMock(IURLGenerator::class);
$this->userManager = $this->createMock(IUserManager::class); $this->userManager = $this->createMock(IUserManager::class);
$this->userSession = $this->createMock(IUserSession::class); $this->userSession = $this->createMock(IUserSession::class);
@ -110,7 +105,6 @@ class PageControllerTest extends TestCase {
$this->accountManager, $this->accountManager,
$this->initialState, $this->initialState,
$this->l10n, $this->l10n,
$this->logger,
$this->urlGenerator, $this->urlGenerator,
$this->userManager, $this->userManager,
$this->userSession $this->userSession

Просмотреть файл

@ -33,7 +33,6 @@ use OCP\IUser;
use OCP\IUserSession; use OCP\IUserSession;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase; use Test\TestCase;
@ -48,9 +47,6 @@ class ConfigServiceTest extends TestCase {
/** @var IGroupManager|MockObject */ /** @var IGroupManager|MockObject */
private $groupManager; private $groupManager;
/** @var LoggerInterface|MockObject */
private $logger;
/** @var IUser|MockObject */ /** @var IUser|MockObject */
private $currentUser; private $currentUser;
@ -59,7 +55,6 @@ class ConfigServiceTest extends TestCase {
$this->config = $this->createMock(IConfig::class); $this->config = $this->createMock(IConfig::class);
$this->groupManager = $this->createMock(IGroupManager::class); $this->groupManager = $this->createMock(IGroupManager::class);
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$userSession = $this->createMock(IUserSession::class); $userSession = $this->createMock(IUserSession::class);
$this->currentUser = $this->createMock(IUser::class); $this->currentUser = $this->createMock(IUser::class);
@ -74,7 +69,6 @@ class ConfigServiceTest extends TestCase {
'forms', 'forms',
$this->config, $this->config,
$this->groupManager, $this->groupManager,
$this->logger,
$userSession $userSession
); );
} }

Просмотреть файл

@ -78,7 +78,6 @@ use OCP\Security\ISecureRandom;
use OCP\Share\IShare; use OCP\Share\IShare;
use PHPUnit\Framework\MockObject\MockObject; use PHPUnit\Framework\MockObject\MockObject;
use Psr\Log\LoggerInterface;
use Test\TestCase; use Test\TestCase;
class FormsServiceTest extends TestCase { class FormsServiceTest extends TestCase {
@ -110,9 +109,6 @@ class FormsServiceTest extends TestCase {
/** @var IGroupManager|MockObject */ /** @var IGroupManager|MockObject */
private $groupManager; private $groupManager;
/** @var LoggerInterface|MockObject */
private $logger;
/** @var IUserManager|MockObject */ /** @var IUserManager|MockObject */
private $userManager; private $userManager;
@ -142,7 +138,6 @@ class FormsServiceTest extends TestCase {
$this->configService = $this->createMock(ConfigService::class); $this->configService = $this->createMock(ConfigService::class);
$this->groupManager = $this->createMock(IGroupManager::class); $this->groupManager = $this->createMock(IGroupManager::class);
$this->logger = $this->getMockBuilder('Psr\Log\LoggerInterface')->getMock();
$this->userManager = $this->createMock(IUserManager::class); $this->userManager = $this->createMock(IUserManager::class);
$this->secureRandom = $this->createMock(ISecureRandom::class); $this->secureRandom = $this->createMock(ISecureRandom::class);
$this->circlesService = $this->createMock(CirclesService::class); $this->circlesService = $this->createMock(CirclesService::class);
@ -177,7 +172,6 @@ class FormsServiceTest extends TestCase {
$this->submissionMapper, $this->submissionMapper,
$this->configService, $this->configService,
$this->groupManager, $this->groupManager,
$this->logger,
$this->userManager, $this->userManager,
$this->secureRandom, $this->secureRandom,
$this->circlesService, $this->circlesService,
@ -652,7 +646,6 @@ class FormsServiceTest extends TestCase {
$this->submissionMapper, $this->submissionMapper,
$this->configService, $this->configService,
$this->groupManager, $this->groupManager,
$this->logger,
$this->userManager, $this->userManager,
$this->secureRandom, $this->secureRandom,
$this->circlesService, $this->circlesService,
@ -893,7 +886,6 @@ class FormsServiceTest extends TestCase {
$this->submissionMapper, $this->submissionMapper,
$this->configService, $this->configService,
$this->groupManager, $this->groupManager,
$this->logger,
$this->userManager, $this->userManager,
$this->secureRandom, $this->secureRandom,
$this->circlesService, $this->circlesService,
@ -1006,7 +998,6 @@ class FormsServiceTest extends TestCase {
$this->submissionMapper, $this->submissionMapper,
$this->configService, $this->configService,
$this->groupManager, $this->groupManager,
$this->logger,
$this->userManager, $this->userManager,
$this->secureRandom, $this->secureRandom,
$this->circlesService, $this->circlesService,
@ -1239,7 +1230,6 @@ class FormsServiceTest extends TestCase {
$this->submissionMapper, $this->submissionMapper,
$this->configService, $this->configService,
$this->groupManager, $this->groupManager,
$this->logger,
$this->userManager, $this->userManager,
$this->secureRandom, $this->secureRandom,
$this->circlesService, $this->circlesService,