diff options
author | blizzz <blizzz@arthur-schiwon.de> | 2018-09-07 12:58:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-07 12:58:48 +0200 |
commit | f14f8cc51e081d04de5927cfbbb2a9f354e0c658 (patch) | |
tree | 2c51706e8d2e0455d768d8e315952c796bd5f9ce | |
parent | 0947cc6a7d8fb5e1f63f3dcb438340935ca90bee (diff) | |
parent | c5cd8d91669b14ae8945a347efe28fc1aa980d39 (diff) | |
download | nextcloud-server-f14f8cc51e081d04de5927cfbbb2a9f354e0c658.tar.gz nextcloud-server-f14f8cc51e081d04de5927cfbbb2a9f354e0c658.zip |
Merge pull request #11100 from nextcloud/enhancement/generated-migrations
Improve class import and strict typing for generated migration class
-rw-r--r-- | core/Command/Db/Migrations/GenerateCommand.php | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/core/Command/Db/Migrations/GenerateCommand.php b/core/Command/Db/Migrations/GenerateCommand.php index f3af3e0e6d2..69bf4a84a8f 100644 --- a/core/Command/Db/Migrations/GenerateCommand.php +++ b/core/Command/Db/Migrations/GenerateCommand.php @@ -40,8 +40,12 @@ class GenerateCommand extends Command implements CompletionAwareInterface { protected static $_templateSimple = '<?php + +declare(strict_types=1); + namespace {{namespace}}; +use Closure; use OCP\DB\ISchemaWrapper; use OCP\Migration\SimpleMigrationStep; use OCP\Migration\IOutput; @@ -53,28 +57,28 @@ class {{classname}} extends SimpleMigrationStep { /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options */ - public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { + public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { } /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options * @return null|ISchemaWrapper */ - public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) { + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { {{schemabody}} } /** * @param IOutput $output - * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` + * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper` * @param array $options */ - public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) { + public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) { } } '; |