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\Share\IShare;
use Psr\Log\LoggerInterface;
class ActivityManager {
public function __construct(
@ -40,7 +38,6 @@ class ActivityManager {
private ?string $userId,
private IManager $manager,
private IGroupManager $groupManager,
private LoggerInterface $logger,
private CirclesService $circlesService,
) {
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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