Skip to content

Commit 17e87a7

Browse files
committed
fix(backend): add types for a happy psalm with php8.3
Signed-off-by: silver <s.szmajduch@posteo.de>
1 parent d0c2de8 commit 17e87a7

10 files changed

Lines changed: 17 additions & 17 deletions

File tree

lib/AppInfo/Application.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
use OCP\Files\Template\RegisterTemplateCreatorEvent;
4444

4545
class Application extends App implements IBootstrap {
46-
public const APP_NAME = 'text';
46+
public const string APP_NAME = 'text';
4747

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

lib/Controller/AttachmentController.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
class AttachmentController extends ApiController implements ISessionAwareController {
3333
use TSessionAwareController;
34-
public const IMAGE_MIME_TYPES = [
34+
public const array IMAGE_MIME_TYPES = [
3535
'image/png',
3636
'image/jpeg',
3737
'image/jpg',
@@ -44,7 +44,7 @@ class AttachmentController extends ApiController implements ISessionAwareControl
4444
'image/heic',
4545
'image/heif',
4646
];
47-
public const BROWSER_SUPPORTED_IMAGE_MIME_TYPES = [
47+
public const array BROWSER_SUPPORTED_IMAGE_MIME_TYPES = [
4848
'image/png',
4949
'image/jpeg',
5050
'image/jpg',

lib/Controller/SettingsController.php

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

1818
class SettingsController extends Controller {
19-
public const ACCEPTED_KEYS = [
19+
public const array ACCEPTED_KEYS = [
2020
'workspace_enabled',
2121
'is_full_width_editor'
2222
];

lib/DAV/WorkspacePlugin.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
use Sabre\DAV\ServerPlugin;
2626

2727
class WorkspacePlugin extends ServerPlugin {
28-
public const WORKSPACE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace';
29-
public const WORKSPACE_FILE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace-file';
30-
public const WORKSPACE_PROPERTY_FLAT = '{http://nextcloud.org/ns}rich-workspace-flat';
31-
public const WORKSPACE_FILE_PROPERTY_FLAT = '{http://nextcloud.org/ns}rich-workspace-file-flat';
28+
public const string WORKSPACE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace';
29+
public const string WORKSPACE_FILE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace-file';
30+
public const string WORKSPACE_PROPERTY_FLAT = '{http://nextcloud.org/ns}rich-workspace-flat';
31+
public const string WORKSPACE_FILE_PROPERTY_FLAT = '{http://nextcloud.org/ns}rich-workspace-file-flat';
3232

3333
private Server $server;
3434

lib/Db/Step.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Step extends Entity implements JsonSerializable {
2929
* To ensure that new steps always have a larger version than those that
3030
* used the version field, use the largest possible 32-bit integer value.
3131
*/
32-
public const VERSION_STORED_IN_ID = 2147483647;
32+
public const int VERSION_STORED_IN_ID = 2147483647;
3333

3434
public $id = null;
3535
protected string $data = '';

lib/DirectEditing/TextDocumentCreator.php

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

1414
class TextDocumentCreator extends ACreateEmpty {
15-
public const CREATOR_ID = 'textdocument';
15+
public const string CREATOR_ID = 'textdocument';
1616

1717
/**
1818
* @var IL10N

lib/Notification/Notifier.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@
2424
use OCP\Notification\UnknownNotificationException;
2525

2626
class Notifier implements INotifier {
27-
public const TYPE_MENTIONED = 'mentioned';
28-
public const SUBJECT_MENTIONED_SOURCE_USER = 'sourceUser';
29-
public const SUBJECT_MENTIONED_TARGET_USER = 'targetUser';
27+
public const string TYPE_MENTIONED = 'mentioned';
28+
public const string SUBJECT_MENTIONED_SOURCE_USER = 'sourceUser';
29+
public const string SUBJECT_MENTIONED_TARGET_USER = 'targetUser';
3030

3131
public function __construct(
3232
private IFactory $factory,

lib/Service/DocumentService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class DocumentService {
5555
/**
5656
* Delay to wait for between autosave versions
5757
*/
58-
public const AUTOSAVE_MINIMUM_DELAY = 10;
58+
public const int AUTOSAVE_MINIMUM_DELAY = 10;
5959

6060
private bool $saveFromText = false;
6161

lib/Service/EncodingService.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
namespace OCA\Text\Service;
1111

1212
class EncodingService {
13-
public const COMMON_ENCODINGS = [ 'UTF-8', 'GB2312', 'GBK', 'BIG-5', 'SJIS-win', 'EUC-JP', 'Windows-1252', 'ISO-8859-15', 'ISO-8859-1', 'ASCII'];
13+
public const array COMMON_ENCODINGS = [ 'UTF-8', 'GB2312', 'GBK', 'BIG-5', 'SJIS-win', 'EUC-JP', 'Windows-1252', 'ISO-8859-15', 'ISO-8859-1', 'ASCII'];
1414

15-
public const UTF_BOMs = [
15+
public const array UTF_BOMs = [
1616
'UTF-32BE' => "\x00\x00\xfe\xff",
1717
'UTF-32LE' => "\xff\xfe\x00\x00",
1818
'UTF-16BE' => "\xfe\xff",

lib/Service/InitialStateProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
use OCP\TaskProcessing\IManager;
1212

1313
class InitialStateProvider {
14-
private const ASSISTANT_TASK_TYPES = [
14+
private const array ASSISTANT_TASK_TYPES = [
1515
'core:text2text',
1616
'core:text2text:formalization',
1717
'core:text2text:headline',

0 commit comments

Comments
 (0)