diff options
author | Joas Schilling <coding@schilljs.com> | 2018-01-17 11:35:20 +0100 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2018-01-17 13:53:09 +0100 |
commit | ed999066e5e05fc569c1a9940e64aa13a916ddc8 (patch) | |
tree | 69af8b0fe2446718e52e70da6e777762cc028d51 /core | |
parent | 4f30c2fbe43e0d6f24ba3bff881526b2b6c2747d (diff) | |
download | nextcloud-server-ed999066e5e05fc569c1a9940e64aa13a916ddc8.tar.gz nextcloud-server-ed999066e5e05fc569c1a9940e64aa13a916ddc8.zip |
Fix the type hints of migrations and correctly inject the wrapped schema into migrations
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'core')
7 files changed, 26 insertions, 29 deletions
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 { '<?php namespace {{namespace}}; -use Doctrine\DBAL\Schema\Schema; +use OCP\DB\ISchemaWrapper; use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; @@ -50,7 +50,7 @@ class {{classname}} 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 */ @@ -59,9 +59,9 @@ class {{classname}} 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) { @@ -70,7 +70,7 @@ class {{classname}} 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/Command/Db/Migrations/GenerateFromSchemaFileCommand.php b/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php index d8dc2be11a4..3ccaa563e89 100644 --- a/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php +++ b/core/Command/Db/Migrations/GenerateFromSchemaFileCommand.php @@ -91,7 +91,7 @@ class GenerateFromSchemaFileCommand extends GenerateCommand { */ protected function schemaToMigration(Schema $schema) { $content = <<<'EOT' - /** @var Schema $schema */ + /** @var ISchemaWrapper $schema */ $schema = $schemaClosure(); EOT; diff --git a/core/Migrations/Version13000Date20170705121758.php b/core/Migrations/Version13000Date20170705121758.php index 6f9c2d243f8..9d8b373b6b9 100644 --- a/core/Migrations/Version13000Date20170705121758.php +++ b/core/Migrations/Version13000Date20170705121758.php @@ -23,21 +23,21 @@ 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; class Version13000Date20170705121758 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('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! |