diff --git a/apps/dav/lib/Migration/Version1025Date20240308063933.php b/apps/dav/lib/Migration/Version1025Date20240308063933.php
index 83a0b46a23edc..37217918679e9 100644
--- a/apps/dav/lib/Migration/Version1025Date20240308063933.php
+++ b/apps/dav/lib/Migration/Version1025Date20240308063933.php
@@ -17,21 +17,17 @@
use OCP\IDBConnection;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
class Version1025Date20240308063933 extends SimpleMigrationStep {
public function __construct(
- private IAppConfig $appConfig,
- private IDBConnection $db,
+ private readonly IAppConfig $appConfig,
+ private readonly IDBConnection $db,
) {
}
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
@@ -50,6 +46,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
return $schema;
}
+ #[Override]
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options): void {
// The threshold is higher than the default of \OCA\DAV\BackgroundJob\PruneOutdatedSyncTokensJob
// but small enough to fit into a cluster transaction size.
diff --git a/apps/dav/lib/Migration/Version1027Date20230504122946.php b/apps/dav/lib/Migration/Version1027Date20230504122946.php
index 89c192a841968..af23dbd052f36 100644
--- a/apps/dav/lib/Migration/Version1027Date20230504122946.php
+++ b/apps/dav/lib/Migration/Version1027Date20230504122946.php
@@ -11,11 +11,11 @@
use Closure;
use OCA\DAV\CardDAV\SyncService;
-use OCP\DB\ISchemaWrapper;
use OCP\IConfig;
use OCP\IUserManager;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
use Psr\Log\LoggerInterface;
use Throwable;
@@ -27,11 +27,8 @@ public function __construct(
private IConfig $config,
) {
}
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- */
+
+ #[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
if ($this->userManager->countSeenUsers() > 100 || $this->userManager->countUsersTotal(100) >= 100) {
$this->config->setAppValue('dav', 'needs_system_address_book_sync', 'yes');
diff --git a/apps/dav/lib/Migration/Version1029Date20231004091403.php b/apps/dav/lib/Migration/Version1029Date20231004091403.php
index 1dcbf9c5dfcdc..f34eae6f1e8cd 100644
--- a/apps/dav/lib/Migration/Version1029Date20231004091403.php
+++ b/apps/dav/lib/Migration/Version1029Date20231004091403.php
@@ -12,16 +12,14 @@
use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\DB\Types;
+use OCP\Migration\Attributes\CreateTable;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
+#[CreateTable(table: 'dav_absence')]
class Version1029Date20231004091403 extends SimpleMigrationStep {
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/apps/dav/lib/Migration/Version1030Date20240205103243.php b/apps/dav/lib/Migration/Version1030Date20240205103243.php
index 72cbcafc444d6..1fb1e54e772e1 100644
--- a/apps/dav/lib/Migration/Version1030Date20240205103243.php
+++ b/apps/dav/lib/Migration/Version1030Date20240205103243.php
@@ -11,17 +11,14 @@
use Closure;
use OCP\DB\ISchemaWrapper;
+use OCP\Migration\Attributes\DropIndex;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
+#[DropIndex(table: 'cards')]
class Version1030Date20240205103243 extends SimpleMigrationStep {
-
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/apps/dav/lib/Migration/Version1034Date20250605132605.php b/apps/dav/lib/Migration/Version1034Date20250605132605.php
index 2eff120c393bb..9bb7f4fe71873 100644
--- a/apps/dav/lib/Migration/Version1034Date20250605132605.php
+++ b/apps/dav/lib/Migration/Version1034Date20250605132605.php
@@ -17,16 +17,12 @@
use OCP\Migration\Attributes\CreateTable;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
#[AddColumn(table: 'dav_shares', name: 'token', type: ColumnType::STRING)]
#[CreateTable(table: 'calendars_federated', columns: ['id', 'display_name', 'color', 'uri', 'principaluri', 'remote_Url', 'token', 'sync_token', 'last_sync', 'shared_by', 'shared_by_display_name', 'components', 'permissions'], description: 'Supporting Federated Calender')]
class Version1034Date20250605132605 extends SimpleMigrationStep {
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/apps/dav/lib/Migration/Version1034Date20250813093701.php b/apps/dav/lib/Migration/Version1034Date20250813093701.php
index e357178104249..e3670ffbc8f88 100644
--- a/apps/dav/lib/Migration/Version1034Date20250813093701.php
+++ b/apps/dav/lib/Migration/Version1034Date20250813093701.php
@@ -10,7 +10,6 @@
namespace OCA\DAV\Migration;
use Closure;
-use OCP\DB\ISchemaWrapper;
use OCP\DB\QueryBuilder\IQueryBuilder;
use OCP\IDBConnection;
use OCP\Migration\Attributes\DataCleansing;
@@ -25,11 +24,6 @@ public function __construct(
) {
}
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- */
#[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$qb = $this->db->getQueryBuilder();
diff --git a/apps/dav/lib/Migration/Version1036Date20251202000000.php b/apps/dav/lib/Migration/Version1036Date20251202000000.php
index 745a9a019059d..39c03d7d154b9 100644
--- a/apps/dav/lib/Migration/Version1036Date20251202000000.php
+++ b/apps/dav/lib/Migration/Version1036Date20251202000000.php
@@ -21,9 +21,6 @@
#[ModifyColumn(table: 'calendar_reminders', name: 'uid', type: ColumnType::STRING, description: 'Increase uid length to 512 characters')]
#[ModifyColumn(table: 'calendar_invitations', name: 'uid', type: ColumnType::STRING, description: 'Increase uid length to 512 characters')]
class Version1036Date20251202000000 extends SimpleMigrationStep {
- /**
- * @param Closure(): ISchemaWrapper $schemaClosure
- */
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
diff --git a/apps/files/lib/Migration/Version2003Date20241021095629.php b/apps/files/lib/Migration/Version2003Date20241021095629.php
index 30d05fa12ad82..7d40acb90fdc1 100644
--- a/apps/files/lib/Migration/Version2003Date20241021095629.php
+++ b/apps/files/lib/Migration/Version2003Date20241021095629.php
@@ -11,26 +11,26 @@
use Closure;
use OCA\Files\Service\ChunkedUploadConfig;
-use OCP\DB\ISchemaWrapper;
-use OCP\IConfig;
+use OCP\IAppConfig;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
-use OCP\Server;
+use Override;
class Version2003Date20241021095629 extends SimpleMigrationStep {
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- */
+ public function __construct(
+ public readonly IAppConfig $appConfig,
+ ) {
+ }
+
+ #[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
- $maxChunkSize = Server::get(IConfig::class)->getAppValue('files', 'max_chunk_size');
- if ($maxChunkSize === '') {
+ $maxChunkSize = $this->appConfig->getValueInt('files', 'max_chunk_size');
+ if ($maxChunkSize === 0) {
// Skip if no value was configured before
return;
}
- ChunkedUploadConfig::setMaxChunkSize((int)$maxChunkSize);
- Server::get(IConfig::class)->deleteAppValue('files', 'max_chunk_size');
+ ChunkedUploadConfig::setMaxChunkSize($maxChunkSize);
+ $this->appConfig->deleteKey('files', 'max_chunk_size');
}
}
diff --git a/apps/files_external/lib/Migration/Version1025Date20250228162604.php b/apps/files_external/lib/Migration/Version1025Date20250228162604.php
index f3d76ed7baa4e..ec70dac8c1023 100644
--- a/apps/files_external/lib/Migration/Version1025Date20250228162604.php
+++ b/apps/files_external/lib/Migration/Version1025Date20250228162604.php
@@ -11,10 +11,9 @@
use Closure;
use OCA\Files_External\Service\GlobalStoragesService;
-use OCP\DB\ISchemaWrapper;
-use OCP\IAppConfig;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
/**
* Check for any external storage overwriting the home folder
@@ -22,13 +21,10 @@
class Version1025Date20250228162604 extends SimpleMigrationStep {
public function __construct(
private GlobalStoragesService $globalStoragesServices,
- private IAppConfig $appConfig,
) {
}
- /**
- * @param Closure(): ISchemaWrapper $schemaClosure
- */
+ #[Override]
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
$this->globalStoragesServices->updateOverwriteHomeFolders();
}
diff --git a/apps/files_sharing/lib/Migration/Version31000Date20240821142813.php b/apps/files_sharing/lib/Migration/Version31000Date20240821142813.php
index 71b2c1817e6b2..509936531f79f 100644
--- a/apps/files_sharing/lib/Migration/Version31000Date20240821142813.php
+++ b/apps/files_sharing/lib/Migration/Version31000Date20240821142813.php
@@ -16,17 +16,13 @@
use OCP\Migration\Attributes\ColumnType;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
#[AddColumn(table: 'share', name: 'reminder_sent', type: ColumnType::BOOLEAN)]
class Version31000Date20240821142813 extends SimpleMigrationStep {
-
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
$table = $schema->getTable('share');
if ($table->hasColumn('reminder_sent')) {
diff --git a/apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php b/apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php
index 3e85edf40b6fc..6a2988fdf1d6e 100644
--- a/apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php
+++ b/apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php
@@ -16,13 +16,11 @@
use OCP\Migration\Attributes\ColumnType;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
#[AddColumn(table: 'files_trash', name: 'deleted_by', type: ColumnType::STRING)]
class Version1020Date20240403003535 extends SimpleMigrationStep {
-
- /**
- * @param Closure(): ISchemaWrapper $schemaClosure
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/apps/webhook_listeners/lib/Migration/Version1000Date20240527153425.php b/apps/webhook_listeners/lib/Migration/Version1000Date20240527153425.php
index ca8e708040c36..4f6bd13372f27 100644
--- a/apps/webhook_listeners/lib/Migration/Version1000Date20240527153425.php
+++ b/apps/webhook_listeners/lib/Migration/Version1000Date20240527153425.php
@@ -15,11 +15,10 @@
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
class Version1000Date20240527153425 extends SimpleMigrationStep {
- /**
- * @param Closure(): ISchemaWrapper $schemaClosure
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/apps/webhook_listeners/lib/Migration/Version1001Date20240716184935.php b/apps/webhook_listeners/lib/Migration/Version1001Date20240716184935.php
index 58c3ce6c181d2..fd4f2226fb64b 100644
--- a/apps/webhook_listeners/lib/Migration/Version1001Date20240716184935.php
+++ b/apps/webhook_listeners/lib/Migration/Version1001Date20240716184935.php
@@ -14,16 +14,12 @@
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
class Version1001Date20240716184935 extends SimpleMigrationStep {
-
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
if ($schema->hasTable(WebhookListenerMapper::TABLE_NAME)) {
diff --git a/apps/webhook_listeners/lib/Migration/Version1500Date20251007130000.php b/apps/webhook_listeners/lib/Migration/Version1500Date20251007130000.php
index 4ca578da98936..427e82d44cfed 100644
--- a/apps/webhook_listeners/lib/Migration/Version1500Date20251007130000.php
+++ b/apps/webhook_listeners/lib/Migration/Version1500Date20251007130000.php
@@ -16,15 +16,10 @@
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
class Version1500Date20251007130000 extends SimpleMigrationStep {
-
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
$schema = $schemaClosure();
$schemaHasChanged = false;
diff --git a/build/psalm-baseline.xml b/build/psalm-baseline.xml
index 1163db1d93015..7fe18b8fc9514 100644
--- a/build/psalm-baseline.xml
+++ b/build/psalm-baseline.xml
@@ -1318,12 +1318,6 @@
-
-
-
-
-
-
getUID())]]>
@@ -3535,7 +3529,6 @@
-
diff --git a/core/Command/Db/ExpectedSchema.php b/core/Command/Db/ExpectedSchema.php
index e8635b1117d14..8c942a023a748 100644
--- a/core/Command/Db/ExpectedSchema.php
+++ b/core/Command/Db/ExpectedSchema.php
@@ -14,6 +14,7 @@
use OC\DB\MigrationService;
use OC\DB\SchemaWrapper;
use OC\Migration\NullOutput;
+use Override;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -21,11 +22,12 @@
class ExpectedSchema extends Base {
public function __construct(
- protected Connection $connection,
+ protected readonly Connection $connection,
) {
parent::__construct();
}
+ #[Override]
protected function configure(): void {
$this
->setName('db:schema:expected')
@@ -36,6 +38,7 @@ protected function configure(): void {
parent::configure();
}
+ #[Override]
protected function execute(InputInterface $input, OutputInterface $output): int {
$schema = new Schema();
$onlyTable = $input->getArgument('table');
diff --git a/core/Migrations/Version29000Date20231213104850.php b/core/Migrations/Version29000Date20231213104850.php
index 41f0594a33e66..cbbb76963464a 100644
--- a/core/Migrations/Version29000Date20231213104850.php
+++ b/core/Migrations/Version29000Date20231213104850.php
@@ -14,14 +14,10 @@
use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
class Version29000Date20231213104850 extends SimpleMigrationStep {
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/core/Migrations/Version29000Date20240131122720.php b/core/Migrations/Version29000Date20240131122720.php
index abd5e73165ad1..7be514ec094a0 100644
--- a/core/Migrations/Version29000Date20240131122720.php
+++ b/core/Migrations/Version29000Date20240131122720.php
@@ -11,18 +11,14 @@
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
/**
*
*/
class Version29000Date20240131122720 extends SimpleMigrationStep {
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/core/Migrations/Version30000Date20240906095113.php b/core/Migrations/Version30000Date20240906095113.php
index 7c3efe41bc38d..2aff4f914d629 100644
--- a/core/Migrations/Version30000Date20240906095113.php
+++ b/core/Migrations/Version30000Date20240906095113.php
@@ -14,16 +14,12 @@
use OCP\Migration\Attributes\ModifyColumn;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
#[ModifyColumn(table: 'taskprocessing_tasks', name: 'error_message', description: 'Increase column length to 4000 bytes to support longer error messages')]
class Version30000Date20240906095113 extends SimpleMigrationStep {
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/core/Migrations/Version32000Date20250731062008.php b/core/Migrations/Version32000Date20250731062008.php
index 3068c47caa1cd..a2401d7a5842a 100644
--- a/core/Migrations/Version32000Date20250731062008.php
+++ b/core/Migrations/Version32000Date20250731062008.php
@@ -10,7 +10,6 @@
namespace OC\Core\Migrations;
use Closure;
-use OCP\DB\ISchemaWrapper;
use OCP\IDBConnection;
use OCP\Migration\Attributes\DataCleansing;
use OCP\Migration\IOutput;
@@ -26,15 +25,10 @@
#[DataCleansing(table: 'vcategory_to_object', description: 'Update object references')]
class Version32000Date20250731062008 extends SimpleMigrationStep {
public function __construct(
- private IDBConnection $connection,
+ private readonly IDBConnection $connection,
) {
}
- /**
- * @param IOutput $output
- * @param Closure(): ISchemaWrapper $schemaClosure
- * @param array $options
- */
#[Override]
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options): void {
// Clean up duplicate categories before adding unique constraint
diff --git a/core/Migrations/Version33000Date20250819110529.php b/core/Migrations/Version33000Date20250819110529.php
index 32a25b0e33c47..570a2ee72d429 100644
--- a/core/Migrations/Version33000Date20250819110529.php
+++ b/core/Migrations/Version33000Date20250819110529.php
@@ -14,6 +14,7 @@
use OCP\Migration\Attributes\CreateTable;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
/**
*
@@ -22,9 +23,7 @@
#[CreateTable(table: 'preview_locations', description: 'Holds the preview location in an object store')]
class Version33000Date20250819110529 extends SimpleMigrationStep {
- /**
- * @param Closure(): ISchemaWrapper $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
diff --git a/core/Migrations/Version33000Date20251023110529.php b/core/Migrations/Version33000Date20251023110529.php
index d87e8bc1f0b64..26204088a649f 100644
--- a/core/Migrations/Version33000Date20251023110529.php
+++ b/core/Migrations/Version33000Date20251023110529.php
@@ -13,6 +13,7 @@
use OCP\Migration\Attributes\ModifyColumn;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
+use Override;
/**
* Migrate away from auto-increment
@@ -21,9 +22,7 @@
#[ModifyColumn(table: 'previews', name: 'id', description: 'Remove auto-increment')]
#[ModifyColumn(table: 'preview_versions', name: 'id', description: 'Remove auto-increment')]
class Version33000Date20251023110529 extends SimpleMigrationStep {
- /**
- * @param Closure(): ISchemaWrapper $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- */
+ #[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
$schema = $schemaClosure();
diff --git a/core/Migrations/Version33000Date20251023120529.php b/core/Migrations/Version33000Date20251023120529.php
index 5c04b3942084d..1cecb65518130 100644
--- a/core/Migrations/Version33000Date20251023120529.php
+++ b/core/Migrations/Version33000Date20251023120529.php
@@ -26,9 +26,7 @@ public function __construct(
) {
}
- /**
- * @param Closure(): ISchemaWrapper $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- */
+ #[\Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();
@@ -41,6 +39,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
return $schema;
}
+ #[\Override]
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
// This shouldn't run on a production instance, only daily
$qb = $this->connection->getQueryBuilder();
diff --git a/core/Migrations/Version33000Date20251124110529.php b/core/Migrations/Version33000Date20251124110529.php
index a8adeb2313eb3..043367b17d9d3 100644
--- a/core/Migrations/Version33000Date20251124110529.php
+++ b/core/Migrations/Version33000Date20251124110529.php
@@ -17,9 +17,6 @@
#[ModifyColumn(table: 'jobs', name: 'id', description: 'Remove auto-increment')]
class Version33000Date20251124110529 extends SimpleMigrationStep {
- /**
- * @param Closure(): ISchemaWrapper $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- */
#[Override]
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
$schema = $schemaClosure();
diff --git a/lib/public/Migration/IMigrationStep.php b/lib/public/Migration/IMigrationStep.php
index d738fee8e8d7e..584e243631848 100644
--- a/lib/public/Migration/IMigrationStep.php
+++ b/lib/public/Migration/IMigrationStep.php
@@ -11,13 +11,20 @@
use OCP\DB\ISchemaWrapper;
/**
+ * This interface represents a database migration step.
+ *
+ * To implement a migration step, you must extend \OCP\Migration\SimpleMigrationStep
+ *
+ * You should additionally add some attributes found in the
+ * \OCP\Migration\Attributes namespace to the migration, to describe the change
+ * that will be done by the migration step to the admin.
+ *
* @since 13.0.0
*/
interface IMigrationStep {
/**
* Human-readable name of the migration step
*
- * @return string
* @since 14.0.0
*/
public function name(): string;
@@ -25,35 +32,28 @@ public function name(): string;
/**
* Human-readable description of the migration step
*
- * @return string
* @since 14.0.0
*/
public function description(): string;
/**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @psalm-param Closure():ISchemaWrapper $schemaClosure
- * @param array $options
+ * @param Closure():ISchemaWrapper $schemaClosure
+ * @param array{tablePrefix?: string} $options
* @since 13.0.0
*/
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options);
/**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @psalm-param Closure():ISchemaWrapper $schemaClosure
- * @param array $options
+ * @param Closure():ISchemaWrapper $schemaClosure
+ * @param array{tablePrefix?: string} $options
* @return null|ISchemaWrapper
* @since 13.0.0
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options);
/**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @psalm-param Closure():ISchemaWrapper $schemaClosure
- * @param array $options
+ * @param Closure():ISchemaWrapper $schemaClosure
+ * @param array{tablePrefix?: string} $options
* @since 13.0.0
*/
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options);
diff --git a/lib/public/Migration/SimpleMigrationStep.php b/lib/public/Migration/SimpleMigrationStep.php
index 6119d533530e0..4f6f3770919ba 100644
--- a/lib/public/Migration/SimpleMigrationStep.php
+++ b/lib/public/Migration/SimpleMigrationStep.php
@@ -7,62 +7,34 @@
*/
namespace OCP\Migration;
-use Closure;
-use OCP\DB\ISchemaWrapper;
+use Override;
/**
+ * Abstract class implementing migration step.
+ *
* @since 13.0.0
*/
abstract class SimpleMigrationStep implements IMigrationStep {
- /**
- * Human-readable name of the migration step
- *
- * @return string
- * @since 14.0.0
- */
+ #[Override]
public function name(): string {
return '';
}
- /**
- * Human-readable description of the migration step
- *
- * @return string
- * @since 14.0.0
- */
+ #[Override]
public function description(): string {
return '';
}
- /**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @psalm-param Closure():ISchemaWrapper $schemaClosure
- * @param array $options
- * @since 13.0.0
- */
+ #[Override]
public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
}
- /**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @psalm-param Closure():ISchemaWrapper $schemaClosure
- * @param array $options
- * @return null|ISchemaWrapper
- * @since 13.0.0
- */
+ #[Override]
public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
return null;
}
- /**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @psalm-param Closure():ISchemaWrapper $schemaClosure
- * @param array $options
- * @since 13.0.0
- */
+ #[Override]
public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
}
}