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

[REF] remove instances of pass-by-reference where no change takes place #14693

Merged
merged 1 commit into from
Jul 2, 2019
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
9 changes: 4 additions & 5 deletions CRM/Core/BAO/SchemaHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,12 @@ class CRM_Core_BAO_SchemaHandler {
* TRUE if successfully created, FALSE otherwise
*
*/
public static function createTable(&$params) {
public static function createTable($params) {
$sql = self::buildTableSQL($params);
// do not i18n-rewrite
CRM_Core_DAO::executeQuery($sql, [], TRUE, NULL, FALSE, FALSE);

$config = CRM_Core_Config::singleton();
if ($config->logging) {
if (CRM_Core_Config::singleton()->logging) {
// logging support
$logging = new CRM_Logging_Schema();
$logging->fixSchemaDifferencesFor($params['name'], NULL, FALSE);
Expand All @@ -87,7 +86,7 @@ public static function createTable(&$params) {
*
* @return string
*/
public static function buildTableSQL(&$params) {
public static function buildTableSQL($params) {
$sql = "CREATE TABLE {$params['name']} (";
if (isset($params['fields']) &&
is_array($params['fields'])
Expand Down Expand Up @@ -295,7 +294,7 @@ public static function buildForeignKeySQL($params, $separator, $prefix, $tableNa
*
* @return bool
*/
public static function alterFieldSQL(&$params, $indexExist = FALSE, $triggerRebuild = TRUE) {
public static function alterFieldSQL($params, $indexExist = FALSE, $triggerRebuild = TRUE) {

// lets suppress the required flag, since that can cause sql issue
$params['required'] = FALSE;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@eileenmcnaughton do we need to carry forward this assignment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The function that calls it (the only one) doesn't make use of the $params afterwards

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup make sense.

Expand Down