From ed999066e5e05fc569c1a9940e64aa13a916ddc8 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Wed, 17 Jan 2018 11:35:20 +0100 Subject: Fix the type hints of migrations and correctly inject the wrapped schema into migrations Signed-off-by: Joas Schilling --- core/Command/Db/Migrations/GenerateCommand.php | 10 +++++----- core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php | 2 +- core/Migrations/Version13000Date20170705121758.php | 8 ++++---- core/Migrations/Version13000Date20170718121200.php | 8 ++++---- core/Migrations/Version13000Date20170814074715.php | 12 ++++++------ core/Migrations/Version13000Date20170919121250.php | 12 ++++++------ core/Migrations/Version13000Date20170926101637.php | 3 --- 7 files changed, 26 insertions(+), 29 deletions(-) (limited to 'core') diff --git a/core/Command/Db/Migrations/GenerateCommand.php b/core/Command/Db/Migrations/GenerateCommand.php index 8fbc1781d94..e37c51e85fb 100644 --- a/core/Command/Db/Migrations/GenerateCommand.php +++ b/core/Command/Db/Migrations/GenerateCommand.php @@ -39,7 +39,7 @@ class GenerateCommand extends Command { 'hasTable('personal_sections')) { diff --git a/core/Migrations/Version13000Date20170718121200.php b/core/Migrations/Version13000Date20170718121200.php index e71debfcb4b..139129eb600 100644 --- a/core/Migrations/Version13000Date20170718121200.php +++ b/core/Migrations/Version13000Date20170718121200.php @@ -23,8 +23,8 @@ namespace OC\Core\Migrations; -use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Types\Type; +use OCP\DB\ISchemaWrapper; use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; @@ -32,13 +32,13 @@ class Version13000Date20170718121200 extends SimpleMigrationStep { /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options - * @return null|Schema + * @return null|ISchemaWrapper * @since 13.0.0 */ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { - /** @var Schema $schema */ + /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); if (!$schema->hasTable('appconfig')) { diff --git a/core/Migrations/Version13000Date20170814074715.php b/core/Migrations/Version13000Date20170814074715.php index 097db51984e..0eae4167fb6 100644 --- a/core/Migrations/Version13000Date20170814074715.php +++ b/core/Migrations/Version13000Date20170814074715.php @@ -23,7 +23,7 @@ namespace OC\Core\Migrations; -use Doctrine\DBAL\Schema\Schema; +use OCP\DB\ISchemaWrapper; use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; @@ -31,7 +31,7 @@ class Version13000Date20170814074715 extends SimpleMigrationStep { /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options * @since 13.0.0 */ @@ -40,13 +40,13 @@ class Version13000Date20170814074715 extends SimpleMigrationStep { /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options - * @return null|Schema + * @return null|ISchemaWrapper * @since 13.0.0 */ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { - /** @var Schema $schema */ + /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); @@ -69,7 +69,7 @@ class Version13000Date20170814074715 extends SimpleMigrationStep { /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options * @since 13.0.0 */ diff --git a/core/Migrations/Version13000Date20170919121250.php b/core/Migrations/Version13000Date20170919121250.php index 0857d6d5ceb..6bdd79cf672 100644 --- a/core/Migrations/Version13000Date20170919121250.php +++ b/core/Migrations/Version13000Date20170919121250.php @@ -23,7 +23,7 @@ */ namespace OC\Core\Migrations; -use Doctrine\DBAL\Schema\Schema; +use OCP\DB\ISchemaWrapper; use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; @@ -34,7 +34,7 @@ class Version13000Date20170919121250 extends SimpleMigrationStep { /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options * @since 13.0.0 */ @@ -43,13 +43,13 @@ class Version13000Date20170919121250 extends SimpleMigrationStep { /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options - * @return null|Schema + * @return null|ISchemaWrapper * @since 13.0.0 */ public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { - /** @var Schema $schema */ + /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); $table = $schema->getTable('jobs'); @@ -115,7 +115,7 @@ class Version13000Date20170919121250 extends SimpleMigrationStep { /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `Schema` + * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options * @since 13.0.0 */ diff --git a/core/Migrations/Version13000Date20170926101637.php b/core/Migrations/Version13000Date20170926101637.php index f51828e7a33..088de988020 100644 --- a/core/Migrations/Version13000Date20170926101637.php +++ b/core/Migrations/Version13000Date20170926101637.php @@ -23,10 +23,7 @@ */ namespace OC\Core\Migrations; -use Doctrine\DBAL\Schema\Schema; use OCP\Migration\BigIntMigration; -use OCP\Migration\SimpleMigrationStep; -use OCP\Migration\IOutput; /** * Auto-generated migration step: Please modify to your needs! -- cgit v1.2.3