Skip to content

Commit 76e02ca

Browse files
committed
chore: run rector with NEXTCLOUD_32 set
Signed-off-by: Christian Hartmann <chris-hartmann@gmx.de>
1 parent 6c0d56f commit 76e02ca

3 files changed

Lines changed: 23 additions & 12 deletions

File tree

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"test:unit": "phpunit --display-all-issues -c tests/phpunit.xml",
2121
"test:integration": "phpunit --display-all-issues -c tests/phpunit.integration.xml",
2222
"psalm": "psalm --no-cache",
23-
"openapi": "generate-spec"
23+
"openapi": "generate-spec",
24+
"rector": "./vendor/bin/rector process"
2425
},
2526
"require-dev": {
2627
"bamarni/composer-bin-plugin": "^1.8"

lib/Service/SubmissionService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ public function __construct(
5858
private LoggerInterface $logger,
5959
private IUserManager $userManager,
6060
IUserSession $userSession,
61-
private IMailer $mailer,
6261
private ITempManager $tempManager,
6362
private FormsService $formsService,
6463
private IUrlGenerator $urlGenerator,
6564
private OptionMapper $optionMapper,
65+
private \OCP\Mail\IEmailValidator $emailValidator,
6666
) {
6767
$this->currentUser = $userSession->getUser();
6868
}
@@ -684,7 +684,7 @@ private function validateShortQuestion(array $question, string $data): bool {
684684

685685
switch ($question['extraSettings']['validationType']) {
686686
case 'email':
687-
return $this->mailer->validateMailAddress($data);
687+
return $this->emailValidator->isValid($data);
688688
case 'number':
689689
return is_numeric($data);
690690
case 'phone':

rector.php

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
<?php
22

3+
/**
4+
* SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors
5+
* SPDX-License-Identifier: AGPL-3.0-or-later
6+
*/
7+
38
declare(strict_types=1);
49

10+
use Nextcloud\Rector\Set\NextcloudSets;
511
use Rector\Config\RectorConfig;
612

713
return RectorConfig::configure()
8-
->withPaths([
9-
__DIR__ . '/lib',
10-
__DIR__ . '/tests',
11-
])
12-
// uncomment to reach your current PHP version
13-
// ->withPhpSets()
14-
->withTypeCoverageLevel(0)
15-
->withDeadCodeLevel(0)
16-
->withCodeQualityLevel(0);
14+
->withPaths([
15+
__DIR__ . '/appinfo',
16+
__DIR__ . '/lib',
17+
__DIR__ . '/tests',
18+
])
19+
// uncomment to reach your current PHP version
20+
// ->withPhpSets()
21+
->withTypeCoverageLevel(0)
22+
->withDeadCodeLevel(0)
23+
->withCodeQualityLevel(0)
24+
->withSets([
25+
NextcloudSets::NEXTCLOUD_32,
26+
]);

0 commit comments

Comments
 (0)