diff options
Diffstat (limited to 'core/Command/Db/Migrations/GenerateCommand.php')
-rw-r--r-- | core/Command/Db/Migrations/GenerateCommand.php | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/core/Command/Db/Migrations/GenerateCommand.php b/core/Command/Db/Migrations/GenerateCommand.php index 6e3b26f583c..b352e86ec62 100644 --- a/core/Command/Db/Migrations/GenerateCommand.php +++ b/core/Command/Db/Migrations/GenerateCommand.php @@ -22,14 +22,12 @@ * along with this program. If not, see <http://www.gnu.org/licenses/> * */ - namespace OC\Core\Command\Db\Migrations; - +use OC\DB\Connection; use OC\DB\MigrationService; use OC\Migration\ConsoleOutput; use OCP\App\IAppManager; -use OCP\IDBConnection; use Stecman\Component\Symfony\Console\BashCompletion\Completion\CompletionAwareInterface; use Stecman\Component\Symfony\Console\BashCompletion\CompletionContext; use Symfony\Component\Console\Command\Command; @@ -39,7 +37,6 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class GenerateCommand extends Command implements CompletionAwareInterface { - protected static $_templateSimple = '<?php @@ -62,7 +59,7 @@ class {{classname}} extends SimpleMigrationStep { * @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): void { } /** @@ -71,7 +68,7 @@ class {{classname}} extends SimpleMigrationStep { * @param array $options * @return null|ISchemaWrapper */ - public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { {{schemabody}} } @@ -80,22 +77,22 @@ class {{classname}} extends SimpleMigrationStep { * @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): void { } } '; - /** @var IDBConnection */ + /** @var Connection */ protected $connection; /** @var IAppManager */ protected $appManager; /** - * @param IDBConnection $connection + * @param Connection $connection * @param IAppManager $appManager */ - public function __construct(IDBConnection $connection, IAppManager $appManager) { + public function __construct(Connection $connection, IAppManager $appManager) { $this->connection = $connection; $this->appManager = $appManager; @@ -112,7 +109,7 @@ class {{classname}} extends SimpleMigrationStep { parent::configure(); } - public function execute(InputInterface $input, OutputInterface $output) { + public function execute(InputInterface $input, OutputInterface $output): int { $appName = $input->getArgument('app'); $version = $input->getArgument('version'); |