diff options
author | Carl Schwan <carl@carlschwan.eu> | 2022-10-10 13:15:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-10 13:15:50 +0200 |
commit | 84f3f6eddd7359bbbd0ca7fc9489e7b3165996fa (patch) | |
tree | 5829cbec3705c7b9e4298048eec03208825b5cc3 | |
parent | 936c3b629766161bd88924ff23942b31114d2694 (diff) | |
parent | d151999fc8f31f7c9e76e9aa07a0ca50a9d5bdd6 (diff) | |
download | nextcloud-server-84f3f6eddd7359bbbd0ca7fc9489e7b3165996fa.tar.gz nextcloud-server-84f3f6eddd7359bbbd0ca7fc9489e7b3165996fa.zip |
Merge pull request #34488 from nextcloud/typehint_closures
typehint migrationservice closures
-rw-r--r-- | lib/private/DB/MigrationService.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/private/DB/MigrationService.php b/lib/private/DB/MigrationService.php index 4b7e4d3a040..7993730b230 100644 --- a/lib/private/DB/MigrationService.php +++ b/lib/private/DB/MigrationService.php @@ -40,6 +40,7 @@ use OC\IntegrityCheck\Helpers\AppLocator; use OC\Migration\SimpleOutput; use OCP\AppFramework\App; use OCP\AppFramework\QueryException; +use OCP\DB\ISchemaWrapper; use OCP\Migration\IMigrationStep; use OCP\Migration\IOutput; use Psr\Log\LoggerInterface; @@ -440,7 +441,7 @@ class MigrationService { foreach ($toBeExecuted as $version) { $instance = $this->createInstance($version); - $toSchema = $instance->changeSchema($this->output, function () use ($toSchema) { + $toSchema = $instance->changeSchema($this->output, function () use ($toSchema): ISchemaWrapper { return $toSchema ?: new SchemaWrapper($this->connection); }, ['tablePrefix' => $this->connection->getPrefix()]) ?: $toSchema; } @@ -513,12 +514,12 @@ class MigrationService { $instance = $this->createInstance($version); if (!$schemaOnly) { - $instance->preSchemaChange($this->output, function () { + $instance->preSchemaChange($this->output, function (): ISchemaWrapper { return new SchemaWrapper($this->connection); }, ['tablePrefix' => $this->connection->getPrefix()]); } - $toSchema = $instance->changeSchema($this->output, function () { + $toSchema = $instance->changeSchema($this->output, function (): ISchemaWrapper { return new SchemaWrapper($this->connection); }, ['tablePrefix' => $this->connection->getPrefix()]); @@ -533,7 +534,7 @@ class MigrationService { } if (!$schemaOnly) { - $instance->postSchemaChange($this->output, function () { + $instance->postSchemaChange($this->output, function (): ISchemaWrapper { return new SchemaWrapper($this->connection); }, ['tablePrefix' => $this->connection->getPrefix()]); } |