From d0c2de82feb6a15522754317baf20a53c255f6ef Mon Sep 17 00:00:00 2001 From: silver Date: Tue, 16 Jun 2026 16:00:22 +0200 Subject: [PATCH 1/2] chore(psalm): bump phpVersion to 8.3 Signed-off-by: silver --- psalm.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/psalm.xml b/psalm.xml index 9875eb513da..3d5ef0ef20b 100644 --- a/psalm.xml +++ b/psalm.xml @@ -6,7 +6,7 @@ xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd" errorBaseline="tests/psalm-baseline.xml" findUnusedCode="false" - phpVersion="8.2" + phpVersion="8.3" > From a06fccf49f95e8a2df42b9250d5ac61d5bf13059 Mon Sep 17 00:00:00 2001 From: silver Date: Tue, 16 Jun 2026 16:19:46 +0200 Subject: [PATCH 2/2] fix(backend): add types for a happy psalm with php8.3 Signed-off-by: silver --- lib/AppInfo/Application.php | 2 +- lib/Controller/AttachmentController.php | 4 ++-- lib/Controller/SettingsController.php | 2 +- lib/DAV/WorkspacePlugin.php | 8 ++++---- lib/Db/Step.php | 2 +- lib/DirectEditing/TextDocumentCreator.php | 2 +- lib/Notification/Notifier.php | 6 +++--- lib/Service/DocumentService.php | 2 +- lib/Service/EncodingService.php | 4 ++-- lib/Service/InitialStateProvider.php | 2 +- lib/Service/SessionService.php | 2 +- lib/Service/WorkspaceService.php | 4 ++-- lib/YjsMessage.php | 12 ++++++------ 13 files changed, 26 insertions(+), 26 deletions(-) diff --git a/lib/AppInfo/Application.php b/lib/AppInfo/Application.php index 4c6e6c5366d..cd1c8f2c703 100644 --- a/lib/AppInfo/Application.php +++ b/lib/AppInfo/Application.php @@ -43,7 +43,7 @@ use OCP\Files\Template\RegisterTemplateCreatorEvent; class Application extends App implements IBootstrap { - public const APP_NAME = 'text'; + public const string APP_NAME = 'text'; public function __construct(array $params = []) { parent::__construct(self::APP_NAME, $params); diff --git a/lib/Controller/AttachmentController.php b/lib/Controller/AttachmentController.php index 050533f1dbe..0ace6cf5537 100644 --- a/lib/Controller/AttachmentController.php +++ b/lib/Controller/AttachmentController.php @@ -31,7 +31,7 @@ class AttachmentController extends ApiController implements ISessionAwareController { use TSessionAwareController; - public const IMAGE_MIME_TYPES = [ + public const array IMAGE_MIME_TYPES = [ 'image/png', 'image/jpeg', 'image/jpg', @@ -44,7 +44,7 @@ class AttachmentController extends ApiController implements ISessionAwareControl 'image/heic', 'image/heif', ]; - public const BROWSER_SUPPORTED_IMAGE_MIME_TYPES = [ + public const array BROWSER_SUPPORTED_IMAGE_MIME_TYPES = [ 'image/png', 'image/jpeg', 'image/jpg', diff --git a/lib/Controller/SettingsController.php b/lib/Controller/SettingsController.php index 9eb45e40889..6ac66c28bb9 100644 --- a/lib/Controller/SettingsController.php +++ b/lib/Controller/SettingsController.php @@ -16,7 +16,7 @@ use OCP\IRequest; class SettingsController extends Controller { - public const ACCEPTED_KEYS = [ + public const array ACCEPTED_KEYS = [ 'workspace_enabled', 'is_full_width_editor' ]; diff --git a/lib/DAV/WorkspacePlugin.php b/lib/DAV/WorkspacePlugin.php index a76d153cacd..83fbe1a14b8 100644 --- a/lib/DAV/WorkspacePlugin.php +++ b/lib/DAV/WorkspacePlugin.php @@ -25,10 +25,10 @@ use Sabre\DAV\ServerPlugin; class WorkspacePlugin extends ServerPlugin { - public const WORKSPACE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace'; - public const WORKSPACE_FILE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace-file'; - public const WORKSPACE_PROPERTY_FLAT = '{http://nextcloud.org/ns}rich-workspace-flat'; - public const WORKSPACE_FILE_PROPERTY_FLAT = '{http://nextcloud.org/ns}rich-workspace-file-flat'; + public const string WORKSPACE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace'; + public const string WORKSPACE_FILE_PROPERTY = '{http://nextcloud.org/ns}rich-workspace-file'; + public const string WORKSPACE_PROPERTY_FLAT = '{http://nextcloud.org/ns}rich-workspace-flat'; + public const string WORKSPACE_FILE_PROPERTY_FLAT = '{http://nextcloud.org/ns}rich-workspace-file-flat'; private Server $server; diff --git a/lib/Db/Step.php b/lib/Db/Step.php index dbc4d08ed92..57b6b2bf2d3 100644 --- a/lib/Db/Step.php +++ b/lib/Db/Step.php @@ -29,7 +29,7 @@ class Step extends Entity implements JsonSerializable { * To ensure that new steps always have a larger version than those that * used the version field, use the largest possible 32-bit integer value. */ - public const VERSION_STORED_IN_ID = 2147483647; + public const int VERSION_STORED_IN_ID = 2147483647; public $id = null; protected string $data = ''; diff --git a/lib/DirectEditing/TextDocumentCreator.php b/lib/DirectEditing/TextDocumentCreator.php index 5cfab330a35..6c455ee5249 100644 --- a/lib/DirectEditing/TextDocumentCreator.php +++ b/lib/DirectEditing/TextDocumentCreator.php @@ -12,7 +12,7 @@ use OCP\IL10N; class TextDocumentCreator extends ACreateEmpty { - public const CREATOR_ID = 'textdocument'; + public const string CREATOR_ID = 'textdocument'; /** * @var IL10N diff --git a/lib/Notification/Notifier.php b/lib/Notification/Notifier.php index 6e3dd1d373b..1b9093b8121 100644 --- a/lib/Notification/Notifier.php +++ b/lib/Notification/Notifier.php @@ -24,9 +24,9 @@ use OCP\Notification\UnknownNotificationException; class Notifier implements INotifier { - public const TYPE_MENTIONED = 'mentioned'; - public const SUBJECT_MENTIONED_SOURCE_USER = 'sourceUser'; - public const SUBJECT_MENTIONED_TARGET_USER = 'targetUser'; + public const string TYPE_MENTIONED = 'mentioned'; + public const string SUBJECT_MENTIONED_SOURCE_USER = 'sourceUser'; + public const string SUBJECT_MENTIONED_TARGET_USER = 'targetUser'; public function __construct( private IFactory $factory, diff --git a/lib/Service/DocumentService.php b/lib/Service/DocumentService.php index d18a8a39324..b21f09c62c7 100644 --- a/lib/Service/DocumentService.php +++ b/lib/Service/DocumentService.php @@ -55,7 +55,7 @@ class DocumentService { /** * Delay to wait for between autosave versions */ - public const AUTOSAVE_MINIMUM_DELAY = 10; + public const int AUTOSAVE_MINIMUM_DELAY = 10; private bool $saveFromText = false; diff --git a/lib/Service/EncodingService.php b/lib/Service/EncodingService.php index e328b85a502..1ed1cea5494 100644 --- a/lib/Service/EncodingService.php +++ b/lib/Service/EncodingService.php @@ -10,9 +10,9 @@ namespace OCA\Text\Service; class EncodingService { - public const COMMON_ENCODINGS = [ 'UTF-8', 'GB2312', 'GBK', 'BIG-5', 'SJIS-win', 'EUC-JP', 'Windows-1252', 'ISO-8859-15', 'ISO-8859-1', 'ASCII']; + public const array COMMON_ENCODINGS = [ 'UTF-8', 'GB2312', 'GBK', 'BIG-5', 'SJIS-win', 'EUC-JP', 'Windows-1252', 'ISO-8859-15', 'ISO-8859-1', 'ASCII']; - public const UTF_BOMs = [ + public const array UTF_BOMs = [ 'UTF-32BE' => "\x00\x00\xfe\xff", 'UTF-32LE' => "\xff\xfe\x00\x00", 'UTF-16BE' => "\xfe\xff", diff --git a/lib/Service/InitialStateProvider.php b/lib/Service/InitialStateProvider.php index 20c0ef2a4f0..8b550d57ca1 100644 --- a/lib/Service/InitialStateProvider.php +++ b/lib/Service/InitialStateProvider.php @@ -11,7 +11,7 @@ use OCP\TaskProcessing\IManager; class InitialStateProvider { - private const ASSISTANT_TASK_TYPES = [ + private const array ASSISTANT_TASK_TYPES = [ 'core:text2text', 'core:text2text:formalization', 'core:text2text:headline', diff --git a/lib/Service/SessionService.php b/lib/Service/SessionService.php index bca114942c9..93ae716e890 100644 --- a/lib/Service/SessionService.php +++ b/lib/Service/SessionService.php @@ -23,7 +23,7 @@ use OCP\Security\ISecureRandom; class SessionService { - public const SESSION_VALID_TIME = 5 * 60; + public const int SESSION_VALID_TIME = 5 * 60; private SessionMapper $sessionMapper; private ISecureRandom $secureRandom; diff --git a/lib/Service/WorkspaceService.php b/lib/Service/WorkspaceService.php index 34c8ec43e3d..2b200d88262 100644 --- a/lib/Service/WorkspaceService.php +++ b/lib/Service/WorkspaceService.php @@ -19,9 +19,9 @@ class WorkspaceService { private IL10N $l10n; - public const DEFAULT_FILENAME = 'Readme.md'; + public const string DEFAULT_FILENAME = 'Readme.md'; - private const SUPPORTED_STATIC_FILENAMES = [ + private const array SUPPORTED_STATIC_FILENAMES = [ self::DEFAULT_FILENAME, 'README.md', 'readme.md', diff --git a/lib/YjsMessage.php b/lib/YjsMessage.php index 021dd695197..9f2ef34876e 100644 --- a/lib/YjsMessage.php +++ b/lib/YjsMessage.php @@ -24,13 +24,13 @@ */ class YjsMessage { - public const YJS_MESSAGE_SYNC = 0; - public const YJS_MESSAGE_AWARENESS = 1; - public const YJS_MESSAGE_AWARENESS_QUERY = 3; + public const int YJS_MESSAGE_SYNC = 0; + public const int YJS_MESSAGE_AWARENESS = 1; + public const int YJS_MESSAGE_AWARENESS_QUERY = 3; - public const YJS_MESSAGE_SYNC_STEP1 = 0; - public const YJS_MESSAGE_SYNC_STEP2 = 1; - public const YJS_MESSAGE_SYNC_UPDATE = 2; + public const int YJS_MESSAGE_SYNC_STEP1 = 0; + public const int YJS_MESSAGE_SYNC_STEP2 = 1; + public const int YJS_MESSAGE_SYNC_UPDATE = 2; private int $pos = 0;