Skip to content

Commit a4f4c20

Browse files
committed
refactor(rector): Run rector on new code
Signed-off-by: Carl Schwan <carlschwan@kde.org>
1 parent 1dbaf17 commit a4f4c20

File tree

47 files changed

+237
-328
lines changed

Some content is hidden

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

47 files changed

+237
-328
lines changed

apps/dav/appinfo/v1/carddav.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
/** @var string $baseuri defined in remote.php */
9090
$server->setBaseUri($baseuri);
9191
// Add plugins
92-
$server->addPlugin(new MaintenancePlugin(Server::get(IConfig::class), \OCP\Server::get(IL10nFactory::class)->get('dav')));
92+
$server->addPlugin(new MaintenancePlugin(Server::get(IConfig::class), Server::get(IL10nFactory::class)->get('dav')));
9393
$server->addPlugin(new \Sabre\DAV\Auth\Plugin($authBackend));
9494
$server->addPlugin(new Plugin());
9595

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -532,7 +532,7 @@ public function getNodeForPath($path): INode {
532532
}
533533

534534
if ($info->getMimeType() === FileInfo::MIMETYPE_FOLDER) {
535-
$node = new \OCA\DAV\Connector\Sabre\Directory($this->fileView, $info, $this->tree, $this->shareManager);
535+
$node = new Directory($this->fileView, $info, $this->tree, $this->shareManager);
536536
} else {
537537
// In case reading a directory was allowed but it turns out the node was a not a directory, reject it now.
538538
if (!$this->info->isReadable()) {

apps/dav/tests/unit/CalDAV/Schedule/IMipServiceTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use OCP\IAppConfig;
1818
use OCP\IDBConnection;
1919
use OCP\IL10N;
20+
use OCP\IUser;
2021
use OCP\IUserManager;
2122
use OCP\L10N\IFactory;
2223
use OCP\Security\ISecureRandom;
@@ -163,7 +164,7 @@ public function testGetFrom(): void {
163164

164165
public function testIsSystemUserWhenUserExists(): void {
165166
$email = 'user@example.com';
166-
$user = $this->createMock(\OCP\IUser::class);
167+
$user = $this->createMock(IUser::class);
167168

168169
$this->userManager->expects(self::once())
169170
->method('getByEmail')

apps/federatedfilesharing/lib/AppInfo/Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
use OCP\AppFramework\Bootstrap\IBootstrap;
1818
use OCP\AppFramework\Bootstrap\IRegistrationContext;
1919
use OCP\Federation\ICloudFederationProviderManager;
20+
use OCP\Server;
2021

2122
class Application extends App implements IBootstrap {
2223

@@ -41,7 +42,7 @@ private function registerCloudFederationProvider(ICloudFederationProviderManager
4142
$manager->addCloudFederationProvider($type,
4243
'Federated Files Sharing',
4344
function (): CloudFederationProviderFiles {
44-
return \OCP\Server::get(CloudFederationProviderFiles::class);
45+
return Server::get(CloudFederationProviderFiles::class);
4546
});
4647
}
4748
}

apps/federatedfilesharing/lib/Settings/Admin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
use OCP\IL10N;
1515
use OCP\IURLGenerator;
1616
use OCP\Settings\IDelegatedSettings;
17+
use OCP\Util;
1718

1819
class Admin implements IDelegatedSettings {
1920
/**
@@ -44,8 +45,8 @@ public function getForm() {
4445
$this->initialState->provideInitialState('lookupServerUploadEnabled', $this->fedShareProvider->isLookupServerUploadEnabled());
4546
$this->initialState->provideInitialState('federatedTrustedShareAutoAccept', $this->fedShareProvider->isFederatedTrustedShareAutoAccept());
4647

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

apps/federatedfilesharing/lib/Settings/Personal.php

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

2021
class Personal implements ISettings {
2122
public function __construct(
@@ -42,8 +43,8 @@ public function getForm(): TemplateResponse {
4243
$this->initialState->provideInitialState('cloudId', $cloudID);
4344
$this->initialState->provideInitialState('docUrlFederated', $this->urlGenerator->linkToDocs('user-sharing-federated'));
4445

45-
\OCP\Util::addStyle(Application::APP_ID, 'settings-personal');
46-
\OCP\Util::addScript(Application::APP_ID, 'settings-personal');
46+
Util::addStyle(Application::APP_ID, 'settings-personal');
47+
Util::addScript(Application::APP_ID, 'settings-personal');
4748
return new TemplateResponse(Application::APP_ID, 'settings-personal', renderAs: TemplateResponse::RENDER_AS_BLANK);
4849
}
4950

apps/files_external/tests/Settings/AdminTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function testGetForm(): void {
8585
$this->initialState
8686
->expects($this->atLeastOnce())
8787
->method('provideInitialState')
88-
->willReturnCallback(function () use (&$initialState) {
88+
->willReturnCallback(function () use (&$initialState): void {
8989
$args = func_get_args();
9090
$initialState[$args[0]] = $args[1];
9191
});

apps/files_sharing/lib/Controller/DeletedShareAPIController.php

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

11+
use OCA\Deck\Sharing\ShareAPIHelper;
1112
use OCA\Files_Sharing\ResponseDefinitions;
1213
use OCP\App\IAppManager;
1314
use OCP\AppFramework\Http;
@@ -204,12 +205,12 @@ private function getRoomShareHelper(): \OCA\Talk\Share\Helper\DeletedShareAPICon
204205
* @psalm-suppress UndefinedClass
205206
* @throws ContainerExceptionInterface
206207
*/
207-
private function getDeckShareHelper(): \OCA\Deck\Sharing\ShareAPIHelper {
208+
private function getDeckShareHelper(): ShareAPIHelper {
208209
if (!$this->appManager->isEnabledForUser('deck')) {
209210
throw new QueryException();
210211
}
211212

212213
/** @psalm-suppress UndefinedClass */
213-
return Server::get(\OCA\Deck\Sharing\ShareAPIHelper::class);
214+
return Server::get(ShareAPIHelper::class);
214215
}
215216
}

apps/files_trashbin/lib/Trashbin.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
use OC\Files\View;
1717
use OC\User\NoUserException;
1818
use OC_User;
19+
use OCA\FederatedFileSharing\FederatedShareProvider;
1920
use OCA\Files_Trashbin\Command\Expire;
2021
use OCA\Files_Trashbin\Events\BeforeNodeRestoredEvent;
2122
use OCA\Files_Trashbin\Events\NodeRestoredEvent;
@@ -1194,7 +1195,7 @@ private static function overwriteDeletedBy(string $user) {
11941195
return $user;
11951196
}
11961197

1197-
$federatedShareProvider = Server::get(\OCA\FederatedFileSharing\FederatedShareProvider::class);
1198+
$federatedShareProvider = Server::get(FederatedShareProvider::class);
11981199
$share = $federatedShareProvider->getShareByToken($token);
11991200

12001201
return $share->getSharedWith();

apps/oauth2/lib/Settings/Admin.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use OCP\AppFramework\Services\IInitialState;
1414
use OCP\IURLGenerator;
1515
use OCP\Settings\ISettings;
16+
use OCP\Util;
1617
use Psr\Log\LoggerInterface;
1718

1819
class Admin implements ISettings {
@@ -45,8 +46,8 @@ public function getForm(): TemplateResponse {
4546
$this->initialState->provideInitialState('clients', $result);
4647
$this->initialState->provideInitialState('oauth2-doc-link', $this->urlGenerator->linkToDocs('admin-oauth2'));
4748

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

0 commit comments

Comments
 (0)