Skip to content

Commit 3cd0f70

Browse files
committed
chore(rector): Run rector on apps, core and tests directory
Signed-off-by: Carl Schwan <[email protected]>
1 parent d843e03 commit 3cd0f70

File tree

71 files changed

+139
-202
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+139
-202
lines changed

apps/dav/lib/CalDAV/Security/RateLimitingPlugin.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,14 @@
2424

2525
class RateLimitingPlugin extends ServerPlugin {
2626

27-
private Limiter $limiter;
28-
2927
public function __construct(
30-
Limiter $limiter,
28+
private Limiter $limiter,
3129
private IUserManager $userManager,
3230
private CalDavBackend $calDavBackend,
3331
private LoggerInterface $logger,
3432
private IAppConfig $config,
3533
private ?string $userId,
3634
) {
37-
$this->limiter = $limiter;
3835
}
3936

4037
public function initialize(DAV\Server $server): void {

apps/dav/lib/Connector/Sabre/Principal.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,6 @@ class Principal implements BackendInterface {
4242
/** @var bool */
4343
private $hasCircles;
4444

45-
/** @var KnownUserService */
46-
private $knownUserService;
47-
4845
public function __construct(
4946
private IUserManager $userManager,
5047
private IGroupManager $groupManager,
@@ -53,14 +50,13 @@ public function __construct(
5350
private IUserSession $userSession,
5451
private IAppManager $appManager,
5552
private ProxyMapper $proxyMapper,
56-
KnownUserService $knownUserService,
53+
private KnownUserService $knownUserService,
5754
private IConfig $config,
5855
private IFactory $languageFactory,
5956
string $principalPrefix = 'principals/users/',
6057
) {
6158
$this->principalPrefix = trim($principalPrefix, '/');
6259
$this->hasGroups = $this->hasCircles = ($principalPrefix === 'principals/users/');
63-
$this->knownUserService = $knownUserService;
6460
}
6561

6662
use PrincipalProxyTrait {

apps/dav/lib/Provisioning/Apple/AppleProvisioningPlugin.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,17 @@ class AppleProvisioningPlugin extends ServerPlugin {
2222
*/
2323
protected $server;
2424

25-
/**
26-
* @var \OC_Defaults
27-
*/
28-
protected $themingDefaults;
29-
3025
/**
3126
* AppleProvisioningPlugin constructor.
3227
*/
3328
public function __construct(
3429
protected IUserSession $userSession,
3530
protected IURLGenerator $urlGenerator,
36-
\OC_Defaults $themingDefaults,
31+
protected \OC_Defaults $themingDefaults,
3732
protected IRequest $request,
3833
protected IL10N $l10n,
3934
protected \Closure $uuidClosure,
4035
) {
41-
$this->themingDefaults = $themingDefaults;
4236
}
4337

4438
/**

apps/dav/lib/Settings/AvailabilitySettings.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use OCP\IConfig;
1818
use OCP\Settings\ISettings;
1919
use OCP\User\IAvailabilityCoordinator;
20+
use OCP\Util;
2021
use Psr\Log\LoggerInterface;
2122

2223
class AvailabilitySettings implements ISettings {
@@ -56,8 +57,8 @@ public function getForm(): TemplateResponse {
5657
}
5758
}
5859

59-
\OCP\Util::addStyle(Application::APP_ID, 'settings-personal-availability');
60-
\OCP\Util::addScript(Application::APP_ID, 'settings-personal-availability');
60+
Util::addStyle(Application::APP_ID, 'settings-personal-availability');
61+
Util::addScript(Application::APP_ID, 'settings-personal-availability');
6162
return new TemplateResponse(Application::APP_ID, 'settings-personal-availability');
6263
}
6364

apps/dav/lib/Settings/CalDAVSettings.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use OCP\IConfig;
1414
use OCP\IURLGenerator;
1515
use OCP\Settings\IDelegatedSettings;
16+
use OCP\Util;
1617

1718
class CalDAVSettings implements IDelegatedSettings {
1819

@@ -45,8 +46,8 @@ public function getForm(): TemplateResponse {
4546
$this->initialState->provideInitialState($key, $value === 'yes');
4647
}
4748

48-
\OCP\Util::addScript(Application::APP_ID, 'settings-admin-caldav');
49-
\OCP\Util::addStyle(Application::APP_ID, 'settings-admin-caldav');
49+
Util::addScript(Application::APP_ID, 'settings-admin-caldav');
50+
Util::addStyle(Application::APP_ID, 'settings-admin-caldav');
5051
return new TemplateResponse(Application::APP_ID, 'settings-admin-caldav');
5152
}
5253

apps/dav/lib/Settings/ExampleContentSettings.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use OCP\AppFramework\Services\IAppConfig;
1717
use OCP\AppFramework\Services\IInitialState;
1818
use OCP\Settings\ISettings;
19+
use OCP\Util;
1920

2021
class ExampleContentSettings implements ISettings {
2122
public function __construct(
@@ -53,8 +54,8 @@ public function getForm(): TemplateResponse {
5354
);
5455
}
5556

56-
\OCP\Util::addStyle(Application::APP_ID, 'settings-admin-example-content');
57-
\OCP\Util::addScript(Application::APP_ID, 'settings-admin-example-content');
57+
Util::addStyle(Application::APP_ID, 'settings-admin-example-content');
58+
Util::addScript(Application::APP_ID, 'settings-admin-example-content');
5859
return new TemplateResponse(Application::APP_ID, 'settings-admin-example-content');
5960
}
6061

apps/dav/lib/SystemTag/SystemTagsInUseCollection.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,15 @@
2222
use Sabre\DAV\SimpleCollection;
2323

2424
class SystemTagsInUseCollection extends SimpleCollection {
25-
protected SystemTagsInFilesDetector $systemTagsInFilesDetector;
26-
2725
/** @noinspection PhpMissingParentConstructorInspection */
2826
public function __construct(
2927
protected IUserSession $userSession,
3028
protected IRootFolder $rootFolder,
3129
protected ISystemTagManager $systemTagManager,
3230
protected ISystemTagObjectMapper $tagMapper,
33-
SystemTagsInFilesDetector $systemTagsInFilesDetector,
31+
protected SystemTagsInFilesDetector $systemTagsInFilesDetector,
3432
protected string $mediaType = '',
3533
) {
36-
$this->systemTagsInFilesDetector = $systemTagsInFilesDetector;
3734
$this->name = 'systemtags-assigned';
3835
if ($this->mediaType != '') {
3936
$this->name .= '/' . $this->mediaType;

apps/dav/tests/unit/Paginate/PaginatePluginTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ private function initializePlugin(): void {
134134
private function expectSequentialCalls(MockObject $mock, string $method, array $expectedCalls): void {
135135
$mock->expects(self::exactly(\count($expectedCalls)))
136136
->method($method)
137-
->willReturnCallback(function (...$args) use (&$expectedCalls) {
137+
->willReturnCallback(function (...$args) use (&$expectedCalls): void {
138138
$expected = array_shift($expectedCalls);
139139
self::assertNotNull($expected);
140140
self::assertSame($expected, $args);

apps/federatedfilesharing/lib/Notifications.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
*/
88
namespace OCA\FederatedFileSharing;
99

10+
use OC\ServerNotAvailableException;
1011
use OCA\FederatedFileSharing\Events\FederatedShareAddedEvent;
1112
use OCP\AppFramework\Http;
1213
use OCP\BackgroundJob\IJobList;
@@ -47,7 +48,7 @@ public function __construct(
4748
* @param int $shareType (can be a remote user or group share)
4849
* @return bool
4950
* @throws HintException
50-
* @throws \OC\ServerNotAvailableException
51+
* @throws ServerNotAvailableException
5152
*/
5253
public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $ownerFederatedId, $sharedBy, $sharedByFederatedId, $shareType) {
5354
[$user, $remote] = $this->addressHandler->splitUserRemote($shareWith);
@@ -106,7 +107,7 @@ public function sendRemoteShare($token, $shareWith, $name, $remoteId, $owner, $o
106107
* @param string $filename
107108
* @return array|false
108109
* @throws HintException
109-
* @throws \OC\ServerNotAvailableException
110+
* @throws ServerNotAvailableException
110111
*/
111112
public function requestReShare($token, $id, $shareId, $remote, $shareWith, $permission, $filename, $shareType) {
112113
$fields = [

apps/federation/lib/SyncFederationAddressBooks.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,15 @@
1010
use OC\OCS\DiscoveryService;
1111
use OCA\DAV\CardDAV\SyncService;
1212
use OCP\AppFramework\Http;
13-
use OCP\OCS\IDiscoveryService;
1413
use Psr\Log\LoggerInterface;
1514

1615
class SyncFederationAddressBooks {
17-
private DiscoveryService $ocsDiscoveryService;
18-
1916
public function __construct(
2017
protected DbHandler $dbHandler,
2118
private SyncService $syncService,
22-
IDiscoveryService $ocsDiscoveryService,
19+
private DiscoveryService $ocsDiscoveryService,
2320
private LoggerInterface $logger,
2421
) {
25-
$this->ocsDiscoveryService = $ocsDiscoveryService;
2622
}
2723

2824
/**

0 commit comments

Comments
 (0)