Skip to content

Commit 9f3ea2a

Browse files
committed
chore: Make classes final and add Override attribute
Signed-off-by: Julius Knorr <jus@bitgrid.net>
1 parent c05edb3 commit 9f3ea2a

68 files changed

Lines changed: 569 additions & 285 deletions

File tree

Some content is hidden

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

composer.lock

Lines changed: 440 additions & 218 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/AppInfo/Application.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@
4141
use OCP\Files\Events\Node\NodeCopiedEvent;
4242
use OCP\Files\Template\RegisterTemplateCreatorEvent;
4343

44-
class Application extends App implements IBootstrap {
44+
final class Application extends App implements IBootstrap {
4545
public const APP_NAME = 'text';
4646

4747
public function __construct(array $params = []) {
4848
parent::__construct(self::APP_NAME, $params);
4949
}
5050

51+
#[\Override]
5152
public function register(IRegistrationContext $context): void {
5253
$context->registerEventListener(RegisterDirectEditorEvent::class, RegisterDirectEditorEventListener::class);
5354
$context->registerEventListener(LoadViewer::class, LoadViewerListener::class);
@@ -69,6 +70,7 @@ public function register(IRegistrationContext $context): void {
6970
$context->registerMiddleware(SessionMiddleware::class);
7071
}
7172

73+
#[\Override]
7274
public function boot(IBootContext $context): void {
7375
}
7476
}

lib/Command/ResetDocument.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use Symfony\Component\Console\Input\InputInterface;
1616
use Symfony\Component\Console\Output\OutputInterface;
1717

18-
class ResetDocument extends Command {
18+
final class ResetDocument extends Command {
1919
protected DocumentService $documentService;
2020

2121
public function __construct(DocumentService $documentService) {

lib/Controller/AttachmentController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
use OCP\Util;
3030
use Psr\Log\LoggerInterface;
3131

32-
class AttachmentController extends ApiController implements ISessionAwareController {
32+
final class AttachmentController extends ApiController implements ISessionAwareController {
3333
use TSessionAwareController;
3434
public const IMAGE_MIME_TYPES = [
3535
'image/png',

lib/Controller/NavigationController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
use OCP\AppFramework\Controller;
1313
use OCP\AppFramework\Http\TemplateResponse;
1414

15-
class NavigationController extends Controller {
15+
final class NavigationController extends Controller {
1616

1717
/**
1818
*

lib/Controller/PublicSessionController.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
use OCP\Share\IManager as ShareManager;
2222
use OCP\Share\IShare;
2323

24-
class PublicSessionController extends PublicShareController implements ISessionAwareController {
24+
final class PublicSessionController extends PublicShareController implements ISessionAwareController {
2525
use TSessionAwareController;
2626

2727
private ?IShare $share = null;
@@ -44,10 +44,12 @@ private function getShare(): IShare {
4444
return $this->share;
4545
}
4646

47+
#[\Override]
4748
protected function getPasswordHash(): ?string {
4849
return $this->getShare()->getPassword();
4950
}
5051

52+
#[\Override]
5153
public function isValidToken(): bool {
5254
try {
5355
$this->share = $this->shareManager->getShareByToken($this->getToken());
@@ -57,6 +59,7 @@ public function isValidToken(): bool {
5759
}
5860
}
5961

62+
#[\Override]
6063
protected function isPasswordProtected(): bool {
6164
/** @psalm-suppress RedundantConditionGivenDocblockType */
6265
return $this->getShare()->getPassword() !== null;

lib/Controller/SessionController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
use OCP\IUserManager;
2424
use OCP\IUserSession;
2525

26-
class SessionController extends ApiController implements ISessionAwareController {
26+
final class SessionController extends ApiController implements ISessionAwareController {
2727
use TSessionAwareController;
2828

2929
private bool $restoreUser = false;

lib/Controller/SettingsController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
use OCP\IConfig;
1616
use OCP\IRequest;
1717

18-
class SettingsController extends Controller {
18+
final class SettingsController extends Controller {
1919
public const ACCEPTED_KEYS = [
2020
'workspace_enabled',
2121
'is_full_width_editor'

lib/Controller/UserApiController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use OCP\IUserManager;
2121
use OCP\Share\IShare;
2222

23-
class UserApiController extends ApiController implements ISessionAwareController {
23+
final class UserApiController extends ApiController implements ISessionAwareController {
2424
use TSessionAwareController;
2525

2626
public function __construct(

lib/Controller/WorkspaceController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
use OCP\Share\IManager;
5656
use Psr\Log\LoggerInterface;
5757

58-
class WorkspaceController extends OCSController {
58+
final class WorkspaceController extends OCSController {
5959
public function __construct(
6060
string $appName,
6161
IRequest $request,

0 commit comments

Comments
 (0)