Skip to content

Commit f8cdfcc

Browse files
php-cs-fixer
1 parent 5401258 commit f8cdfcc

29 files changed

+244
-429
lines changed

appinfo/routes.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@
2323
['name' => 'settings#getCounters', 'url' => '/getCounters', 'verb' => 'GET'],
2424
['name' => 'settings#getSendMailOnVirusUpload', 'url' => '/getSendMailOnVirusUpload', 'verb' => 'GET'],
2525
['name' => 'settings#setSendMailOnVirusUpload', 'url' => '/setSendMailOnVirusUpload', 'verb' => 'POST'],
26-
['name' => 'settings#getSendMailSummaryOfMaliciousFiles', 'url' =>
27-
'/getSendMailSummaryOfMaliciousFiles', 'verb' => 'GET'],
28-
['name' => 'settings#setSendMailSummaryOfMaliciousFiles', 'url' =>
29-
'/setSendMailSummaryOfMaliciousFiles', 'verb' => 'POST']
26+
['name' => 'settings#getSendMailSummaryOfMaliciousFiles', 'url'
27+
=> '/getSendMailSummaryOfMaliciousFiles', 'verb' => 'GET'],
28+
['name' => 'settings#setSendMailSummaryOfMaliciousFiles', 'url'
29+
=> '/setSendMailSummaryOfMaliciousFiles', 'verb' => 'POST']
3030
]
3131
];

lib/Activity/Provider.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@
3131
use OCP\IURLGenerator;
3232
use OCP\L10N\IFactory;
3333

34-
class Provider implements IProvider
35-
{
34+
class Provider implements IProvider {
3635
public const TYPE_VIRUS_DETECTED = 'virus_detected';
3736

3837
public const SUBJECT_VIRUS_DETECTED = 'virus_detected';
@@ -47,14 +46,12 @@ class Provider implements IProvider
4746
/** @var IURLGenerator */
4847
private $urlGenerator;
4948

50-
public function __construct(IFactory $languageFactory, IURLGenerator $urlGenerator)
51-
{
49+
public function __construct(IFactory $languageFactory, IURLGenerator $urlGenerator) {
5250
$this->languageFactory = $languageFactory;
5351
$this->urlGenerator = $urlGenerator;
5452
}
5553

56-
public function parse($language, IEvent $event, ?IEvent $previousEvent = null)
57-
{
54+
public function parse($language, IEvent $event, ?IEvent $previousEvent = null) {
5855
if ($event->getApp() !== Application::APP_ID || $event->getType() !== self::TYPE_VIRUS_DETECTED) {
5956
throw new InvalidArgumentException();
6057
}
@@ -125,8 +122,7 @@ public function parse($language, IEvent $event, ?IEvent $previousEvent = null)
125122
return $event;
126123
}
127124

128-
private function setSubjects(IEvent $event, string $subject, array $parameters): void
129-
{
125+
private function setSubjects(IEvent $event, string $subject, array $parameters): void {
130126
$placeholders = $replacements = [];
131127
foreach ($parameters as $placeholder => $parameter) {
132128
$placeholders[] = '{' . $placeholder . '}';

lib/AppInfo/Application.php

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,14 @@
2222
use Psr\Container\NotFoundExceptionInterface;
2323
use Psr\Log\LoggerInterface;
2424

25-
class Application extends App implements IBootstrap
26-
{
25+
class Application extends App implements IBootstrap {
2726
public const APP_ID = 'gdatavaas';
2827

2928
/**
3029
* @throws ContainerExceptionInterface
3130
* @throws NotFoundExceptionInterface
3231
*/
33-
public function __construct()
34-
{
32+
public function __construct() {
3533
parent::__construct(self::APP_ID);
3634

3735
$container = $this->getContainer();
@@ -47,8 +45,7 @@ public function __construct()
4745
* @param IRegistrationContext $context
4846
* @return void
4947
*/
50-
public function register(IRegistrationContext $context): void
51-
{
48+
public function register(IRegistrationContext $context): void {
5249
require_once file_exists(__DIR__ . '/../../vendor/scoper-autoload.php')
5350
? __DIR__ . '/../../vendor/scoper-autoload.php'
5451
: __DIR__ . '/../../vendor/autoload.php';
@@ -59,8 +56,8 @@ public function register(IRegistrationContext $context): void
5956
$systemTagManager = $c->get(ISystemTagManager::class);
6057
$standardTagMapper = $c->get(ISystemTagObjectMapper::class);
6158
$dbConnection = $c->get(IDBConnection::class);
62-
$silentTagMapper =
63-
SystemTagObjectMapperWithoutActivityFactory::createSilentSystemTagObjectMapper(
59+
$silentTagMapper
60+
= SystemTagObjectMapperWithoutActivityFactory::createSilentSystemTagObjectMapper(
6461
$dbConnection,
6562
$systemTagManager
6663
);
@@ -72,7 +69,6 @@ public function register(IRegistrationContext $context): void
7269
FileEventsListener::register($context);
7370
}
7471

75-
public function boot(IBootContext $context): void
76-
{
72+
public function boot(IBootContext $context): void {
7773
}
7874
}

lib/BackgroundJobs/NotifyAdminJob.php

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,21 @@
1717
use OCP\SystemTag\TagNotFoundException;
1818
use Psr\Log\LoggerInterface;
1919

20-
class NotifyAdminJob extends TimedJob
21-
{
20+
class NotifyAdminJob extends TimedJob {
2221
private IAppConfig $appConfig;
2322
private TagService $tagService;
2423
private DbFileMapper $dbFileMapper;
2524
private MailService $mailService;
2625
private LoggerInterface $logger;
2726
private FileService $fileService;
2827

29-
public function __construct(ITimeFactory $time,
30-
IAppConfig $appConfig,
31-
TagService $tagService,
32-
DbFileMapper $dbFileMapper,
33-
LoggerInterface $logger,
34-
MailService $mailService,
35-
FileService $fileService)
36-
{
28+
public function __construct(ITimeFactory $time,
29+
IAppConfig $appConfig,
30+
TagService $tagService,
31+
DbFileMapper $dbFileMapper,
32+
LoggerInterface $logger,
33+
MailService $mailService,
34+
FileService $fileService) {
3735
parent::__construct($time);
3836

3937
$this->appConfig = $appConfig;
@@ -56,8 +54,7 @@ public function __construct(ITimeFactory $time,
5654
* @throws NotPermittedException
5755
* @throws \Exception
5856
*/
59-
protected function run($argument): void
60-
{
57+
protected function run($argument): void {
6158
$notifyAdminEnabled = $this->appConfig->getValueBool(Application::APP_ID, 'notifyAdminEnabled');
6259
if (!$notifyAdminEnabled) {
6360
return;
@@ -89,8 +86,7 @@ protected function run($argument): void
8986
* @throws NotFoundException
9087
* @throws NotPermittedException
9188
*/
92-
private function getFilesFromFileIds(array $fileIds): array
93-
{
89+
private function getFilesFromFileIds(array $fileIds): array {
9490
$files = [];
9591
foreach ($fileIds as $fileId) {
9692
$file = $this->fileService->getNodeFromFileId($fileId);

lib/BackgroundJobs/ScanJob.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,11 @@
1111
use OCP\Files\NotPermittedException;
1212
use OCP\IAppConfig;
1313

14-
class ScanJob extends TimedJob
15-
{
14+
class ScanJob extends TimedJob {
1615
private ScanService $scanService;
1716
private IAppConfig $appConfig;
1817

19-
public function __construct(ITimeFactory $time, ScanService $scanService, IAppConfig $appConfig)
20-
{
18+
public function __construct(ITimeFactory $time, ScanService $scanService, IAppConfig $appConfig) {
2119
parent::__construct($time);
2220

2321
$this->scanService = $scanService;
@@ -35,8 +33,7 @@ public function __construct(ITimeFactory $time, ScanService $scanService, IAppCo
3533
* @throws NotFoundException
3634
* @throws NotPermittedException
3735
*/
38-
protected function run($argument): void
39-
{
36+
protected function run($argument): void {
4037
$autoScan = $this->appConfig->getValueBool(Application::APP_ID, 'autoScanFiles');
4138
if (!$autoScan) {
4239
return;

lib/BackgroundJobs/TagUnscannedJob.php

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@
77
use OCP\BackgroundJob\TimedJob;
88
use OCP\DB\Exception;
99

10-
class TagUnscannedJob extends TimedJob
11-
{
10+
class TagUnscannedJob extends TimedJob {
1211
private TagUnscannedService $tagUnscannedService;
1312

14-
public function __construct(ITimeFactory $time, TagUnscannedService $tagUnscannedService)
15-
{
13+
public function __construct(ITimeFactory $time, TagUnscannedService $tagUnscannedService) {
1614
parent::__construct($time);
1715

1816
$this->tagUnscannedService = $tagUnscannedService;
@@ -27,8 +25,7 @@ public function __construct(ITimeFactory $time, TagUnscannedService $tagUnscanne
2725
* @return void
2826
* @throws Exception if the database platform is not supported
2927
*/
30-
protected function run($argument): void
31-
{
28+
protected function run($argument): void {
3229
$this->tagUnscannedService->run();
3330
}
3431
}

lib/Command/GetTagIdCommand.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
use Symfony\Component\Console\Input\InputInterface;
1212
use Symfony\Component\Console\Output\OutputInterface;
1313

14-
class GetTagIdCommand extends Command
15-
{
14+
class GetTagIdCommand extends Command {
1615
public const TAG_NAME = 'tag-name';
1716

1817
private LoggerInterface $logger;
1918
private TagService $tagService;
2019

21-
public function __construct(TagService $tagService, LoggerInterface $logger)
22-
{
20+
public function __construct(TagService $tagService, LoggerInterface $logger) {
2321
parent::__construct();
2422
$this->logger = $logger;
2523
$this->tagService = $tagService;
@@ -28,17 +26,15 @@ public function __construct(TagService $tagService, LoggerInterface $logger)
2826
/**
2927
* @return void
3028
*/
31-
protected function configure(): void
32-
{
29+
protected function configure(): void {
3330
$this->setName('gdatavaas:get-tag-id');
3431
$this->setDescription('Gets the ID of a tag');
3532
$this->addArgument(
3633
self::TAG_NAME, InputArgument::REQUIRED, 'Tag name you want to get the id for.'
3734
);
3835
}
3936

40-
protected function execute(InputInterface $input, OutputInterface $output): int
41-
{
37+
protected function execute(InputInterface $input, OutputInterface $output): int {
4238
$logger = new ConsoleCommandLogger($this->logger, $output);
4339
$tagName = $input->getArgument('tag-name');
4440
try {

lib/Command/GetTagsForFileCommand.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,7 @@
1414
use Symfony\Component\Console\Input\InputInterface;
1515
use Symfony\Component\Console\Output\OutputInterface;
1616

17-
class GetTagsForFileCommand extends Command
18-
{
17+
class GetTagsForFileCommand extends Command {
1918
public const FILE_PATH = 'file-path';
2019

2120
private LoggerInterface $logger;
@@ -27,9 +26,8 @@ public function __construct(
2726
LoggerInterface $logger,
2827
IRootFolder $rootFolder,
2928
ISystemTagObjectMapper $systemTagObjectMapper,
30-
ISystemTagManager $tagManager
31-
)
32-
{
29+
ISystemTagManager $tagManager,
30+
) {
3331
parent::__construct();
3432

3533
$this->logger = $logger;
@@ -41,8 +39,7 @@ public function __construct(
4139
/**
4240
* @return void
4341
*/
44-
protected function configure(): void
45-
{
42+
protected function configure(): void {
4643
$this->setName('gdatavaas:get-tags-for-file');
4744
$this->setDescription('get tags for file');
4845

@@ -58,8 +55,7 @@ protected function configure(): void
5855
* @throws InvalidPathException
5956
* @throws NotFoundException
6057
*/
61-
protected function execute(InputInterface $input, OutputInterface $output): int
62-
{
58+
protected function execute(InputInterface $input, OutputInterface $output): int {
6359
$logger = new ConsoleCommandLogger($this->logger, $output);
6460

6561
$filePath = $input->getArgument('file-path');

lib/Command/RemoveTagCommand.php

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,13 @@
1111
use Symfony\Component\Console\Input\InputInterface;
1212
use Symfony\Component\Console\Output\OutputInterface;
1313

14-
class RemoveTagCommand extends Command
15-
{
14+
class RemoveTagCommand extends Command {
1615
public const TAG_NAME = 'tag-name';
1716

1817
private LoggerInterface $logger;
1918
private TagService $tagService;
2019

21-
public function __construct(TagService $tagService, LoggerInterface $logger)
22-
{
20+
public function __construct(TagService $tagService, LoggerInterface $logger) {
2321
parent::__construct();
2422
$this->logger = $logger;
2523
$this->tagService = $tagService;
@@ -28,15 +26,13 @@ public function __construct(TagService $tagService, LoggerInterface $logger)
2826
/**
2927
* @return void
3028
*/
31-
protected function configure(): void
32-
{
29+
protected function configure(): void {
3330
$this->setName('gdatavaas:remove-tag');
3431
$this->setDescription('deletes a tag');
3532
$this->addArgument(self::TAG_NAME, InputArgument::REQUIRED, 'Tag name want to delete.');
3633
}
3734

38-
protected function execute(InputInterface $input, OutputInterface $output): int
39-
{
35+
protected function execute(InputInterface $input, OutputInterface $output): int {
4036
$logger = new ConsoleCommandLogger($this->logger, $output);
4137
$tagName = $input->getArgument('tag-name');
4238
try {

lib/Command/ScanCommand.php

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,16 @@
1313
use Symfony\Component\Console\Input\InputInterface;
1414
use Symfony\Component\Console\Output\OutputInterface;
1515

16-
class ScanCommand extends Command
17-
{
16+
class ScanCommand extends Command {
1817
private ScanService $scanService;
1918
private TagUnscannedService $tagUnscannedService;
2019
private LoggerInterface $logger;
2120

2221
public function __construct(
2322
ScanService $scanService,
2423
TagUnscannedService $tagUnscannedService,
25-
LoggerInterface $logger
26-
)
27-
{
24+
LoggerInterface $logger,
25+
) {
2826
parent::__construct();
2927

3028
$this->scanService = $scanService;
@@ -35,8 +33,7 @@ public function __construct(
3533
/**
3634
* @return void
3735
*/
38-
protected function configure(): void
39-
{
36+
protected function configure(): void {
4037
$this->setName('gdatavaas:scan');
4138
$this->setDescription('scan files for malware');
4239
}
@@ -49,8 +46,7 @@ protected function configure(): void
4946
* @throws NotFoundException
5047
* @throws NotPermittedException
5148
*/
52-
protected function execute(InputInterface $input, OutputInterface $output): int
53-
{
49+
protected function execute(InputInterface $input, OutputInterface $output): int {
5450
$logger = new ConsoleCommandLogger($this->logger, $output);
5551
$logger->info('scanning files');
5652
$start = microtime(true);

0 commit comments

Comments
 (0)