Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFC] Add in type hints to template upgrade functions #21390

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions CRM/Upgrade/Incremental/php/Template.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class CRM_Upgrade_Incremental_php_<?php echo $camelNumber; ?> extends CRM_Upgrad
* a version number, e.g. '4.4.alpha1', '4.4.beta3', '4.4.0'.
* @param null $currentVer
*/
public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL) {
public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NULL): void {
// Example: Generate a pre-upgrade message.
// if ($rev == '5.12.34') {
// $preUpgradeMessage .= '<p>' . ts('A new permission, "%1", has been added. This permission is now used to control access to the Manage Tags screen.', array(1 => ts('manage tags'))) . '</p>';
Expand All @@ -48,7 +48,7 @@ public function setPreUpgradeMessage(&$preUpgradeMessage, $rev, $currentVer = NU
* @param string $rev
* an intermediate version; note that setPostUpgradeMessage is called repeatedly with different $revs.
*/
public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
public function setPostUpgradeMessage(&$postUpgradeMessage, $rev): void {
// Example: Generate a post-upgrade message.
// if ($rev == '5.12.34') {
// $postUpgradeMessage .= '<br /><br />' . ts("By default, CiviCRM now disables the ability to import directly from SQL. To use this feature, you must explicitly grant permission 'import SQL datasource'.");
Expand All @@ -66,15 +66,15 @@ public function setPostUpgradeMessage(&$postUpgradeMessage, $rev) {
// *
// * @param string $rev
// */
// public function upgrade_5_0_x($rev) {
// public function upgrade_5_0_x($rev): void {
// $this->addTask(ts('Upgrade DB to %1: SQL', [1 => $rev]), 'runSql', $rev);
// $this->addTask('Do the foo change', 'taskFoo', ...);
// // Additional tasks here...
// // Note: do not use ts() in the addTask description because it adds unnecessary strings to transifex.
// // The above is an exception because 'Upgrade DB to %1: SQL' is generic & reusable.
// }

// public static function taskFoo(CRM_Queue_TaskContext $ctx, ...) {
// public static function taskFoo(CRM_Queue_TaskContext $ctx, ...): bool {
// return TRUE;
// }

Expand Down