From e7339b849679b04f342a1104ed0b5a2696262c64 Mon Sep 17 00:00:00 2001 From: Michael Knappe Date: Wed, 18 Jan 2023 12:51:42 +0100 Subject: [PATCH 1/2] Adjusted template --- templates/Manager/migration_template.php | 35 ++++++++++++++++++++---- 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/templates/Manager/migration_template.php b/templates/Manager/migration_template.php index fda682b20..6cab912ab 100644 --- a/templates/Manager/migration_template.php +++ b/templates/Manager/migration_template.php @@ -9,24 +9,47 @@ */ class { + /** + * @var string + */ public $comment = ''; - public function preUp(MigrationManager $manager) + /** + * @param \Propel\Generator\Manager\MigrationManager $manager + * + * @return void + */ + public function preUp(MigrationManager $manager): void { // add the pre-migration code here } - public function postUp(MigrationManager $manager) + /** + * @param \Propel\Generator\Manager\MigrationManager $manager + * + * @return void + */ + public function postUp(MigrationManager $manager): void { // add the post-migration code here } - public function preDown(MigrationManager $manager) + /** + * @param \Propel\Generator\Manager\MigrationManager $manager + * + * @return void + */ + public function preDown(MigrationManager $manager): void { // add the pre-migration code here } - public function postDown(MigrationManager $manager) + /** + * @param \Propel\Generator\Manager\MigrationManager $manager + * + * @return void + */ + public function postDown(MigrationManager $manager): void { // add the post-migration code here } @@ -37,7 +60,7 @@ public function postDown(MigrationManager $manager) * @return array list of the SQL strings to execute for the Up migration * the keys being the datasources */ - public function getUpSQL() + public function getUpSQL(): array { $sql): ?> = <<< 'EOT' @@ -58,7 +81,7 @@ public function getUpSQL() * @return array list of the SQL strings to execute for the Down migration * the keys being the datasources */ - public function getDownSQL() + public function getDownSQL(): array { $sql): ?> = <<< 'EOT' From 356b07c8b1c53fa90b1a4250695d5fb832aca2ad Mon Sep 17 00:00:00 2001 From: Michael Knappe Date: Wed, 18 Jan 2023 16:17:33 +0100 Subject: [PATCH 2/2] Adjusted return types --- templates/Manager/migration_template.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/templates/Manager/migration_template.php b/templates/Manager/migration_template.php index 6cab912ab..d5f61188d 100644 --- a/templates/Manager/migration_template.php +++ b/templates/Manager/migration_template.php @@ -17,9 +17,9 @@ class /** * @param \Propel\Generator\Manager\MigrationManager $manager * - * @return void + * @return null|false|void */ - public function preUp(MigrationManager $manager): void + public function preUp(MigrationManager $manager) { // add the pre-migration code here } @@ -27,9 +27,9 @@ public function preUp(MigrationManager $manager): void /** * @param \Propel\Generator\Manager\MigrationManager $manager * - * @return void + * @return null|false|void */ - public function postUp(MigrationManager $manager): void + public function postUp(MigrationManager $manager) { // add the post-migration code here } @@ -37,9 +37,9 @@ public function postUp(MigrationManager $manager): void /** * @param \Propel\Generator\Manager\MigrationManager $manager * - * @return void + * @return null|false|void */ - public function preDown(MigrationManager $manager): void + public function preDown(MigrationManager $manager) { // add the pre-migration code here } @@ -47,9 +47,9 @@ public function preDown(MigrationManager $manager): void /** * @param \Propel\Generator\Manager\MigrationManager $manager * - * @return void + * @return null|false|void */ - public function postDown(MigrationManager $manager): void + public function postDown(MigrationManager $manager) { // add the post-migration code here }