application/controllers 1 file with changes =================== 1) application/controllers/ThemeOptionsController.php:361 ---------- begin diff ---------- @@ @@ * * @return void */ - public function actionUpdateSurveyGroup(int $id = null, int $gsid, $l = null) + public function actionUpdateSurveyGroup(int $gsid, int $id = null, $l = null) { if (!Permission::model()->hasGlobalPermission('templates', 'update')) { if (empty($gsid)) { ----------- end diff ----------- Applied rules: * OptionalParametersAfterRequiredRector -- NOTE: This is a false positive. This doesn't fail when the parameter is typed and the default value is null. [OK] 1 file would have been changed (dry-run) by Rector application/core [WARNING] The following file was skipped as starting with short open tag. Migrate to long open PHP tag first: application/core/plugins/TwoFactorAdminLogin/views/_partial/create.php 2 files with changes ==================== 1) application/core/plugins/AzureOAuthSMTP/vendor/paragonie/random_compat/other/build_phar.php:7 ---------- begin diff ---------- @@ @@ } $phar = new Phar( $dist.'/random_compat.phar', - FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::KEY_AS_FILENAME, + FilesystemIterator::CURRENT_AS_FILEINFO | \FilesystemIterator::KEY_AS_FILENAME | \FilesystemIterator::SKIP_DOTS, 'random_compat.phar' ); rename( ----------- end diff ----------- Applied rules: * FilesystemIteratorSkipDotsRector -- NOTE: This is a plugin's vendor folder. Updating the dependencies will probably be enough. Anyway, if this fails, it fails in 8.2 already: https://github.com/rectorphp/rector/blob/main/docs/rector_rules_overview.md#filesystemiteratorskipdotsrector 2) application/core/plugins/TwoFactorAdminLogin/helper/phpqrcode.php:1242 ---------- begin diff ---------- @@ @@ case QR_MODE_NUM: $bits = QRinput::estimateBitsModeNum($this->size); break; case QR_MODE_AN: $bits = QRinput::estimateBitsModeAn($this->size); break; case QR_MODE_8: $bits = QRinput::estimateBitsMode8($this->size); break; - case QR_MODE_KANJI: $bits = QRinput::estimateBitsModeKanji($this->size);break; + case QR_MODE_KANJI: $bits = (new QRinput())->estimateBitsModeKanji($this->size);break; case QR_MODE_STRUCTURE: return STRUCTURE_HEADER_BITS; default: return 0; ----------- end diff ----------- Applied rules: * StaticCallOnNonStaticToInstanceCallRector -- NOTE: This is supposed to be failing since 8.0, but I'm not sure if it's ever called. Anyway, we should probably stop using this library. It's been deprecated for a while according to the project's README (https://github.com/t0k4rt/phpqrcode?tab=readme-ov-file). [OK] 2 files would have been changed (dry-run) by Rector application/helpers 6 files with changes ==================== 1) application/helpers/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php:88 ---------- begin diff ---------- @@ @@ if (!is_array($group)) { continue; } - while (list ($key, $value) = each($group)) { + foreach ($group as $key => $value) { if (is_bool($value)) { // to have the same type than the official WURFL API $features[$key] = ($value ? 'true' : 'false'); ----------- end diff ----------- Applied rules: * WhileEachToForeachRector -- NOTE: This should be failing since 7.2, but we are not using that class. 2) application/helpers/userstatistics_helper.php:2620 ---------- begin diff ---------- @@ @@ } // Creating the first worksheet - $this->sheet = $this->workbook->addWorksheet(utf8_decode('results-survey' . $surveyid)); + $this->sheet = $this->workbook->addWorksheet(mb_convert_encoding('results-survey' . $surveyid, 'ISO-8859-1')); $this->xlsPercents = &$this->workbook->addFormat(); $this->xlsPercents->setNumFormat('0.00%'); $this->formatBold = &$this->workbook->addFormat(array('Bold' => 1)); ----------- end diff ----------- Applied rules: * Utf8DecodeEncodeToMbConvertEncodingRector -- NOTE: utf8_decode has been deprecated in 8.2. We should check if it's failing. 3) application/helpers/admin/import_helper.php:1635 ---------- begin diff ---------- @@ @@ } // #14646: fix utf8 encoding issue if (!mb_detect_encoding($insertdata['group_name'], 'UTF-8', true)) { - $insertdata['group_name'] = utf8_encode($insertdata['group_name']); + $insertdata['group_name'] = mb_convert_encoding($insertdata['group_name'], 'UTF-8', 'ISO-8859-1'); } // Insert the new group $oQuestionGroupL10n = new QuestionGroupL10n(); ----------- end diff ----------- Applied rules: * Utf8DecodeEncodeToMbConvertEncodingRector -- NOTE: utf8_decode has been deprecated in 8.2. We should check if it's failing. 4) application/helpers/admin/statistics_helper.php:3855 ---------- begin diff ---------- @@ @@ } // Creating the first worksheet - $this->sheet = $this->workbook->addWorksheet(utf8_decode('results-survey' . $surveyid)); + $this->sheet = $this->workbook->addWorksheet(mb_convert_encoding('results-survey' . $surveyid, 'ISO-8859-1')); $this->xlsPercents = $this->workbook->addFormat(); $this->xlsPercents->setNumFormat('0.00%'); $this->formatBold = $this->workbook->addFormat(array('Bold' => 1)); ----------- end diff ----------- Applied rules: * Utf8DecodeEncodeToMbConvertEncodingRector -- NOTE: utf8_decode has been deprecated in 8.2. We should check if it's failing. 5) application/helpers/ldap_helper.php:27 ---------- begin diff ---------- @@ @@ } else { $ds = false; if ($ldap_server[$server_id]['protoversion'] == 'ldapv3' && $ldap_server[$server_id]['encrypt'] != 'ldaps') { - $ds = ldap_connect($ldap_server[$server_id]['server'], $ldap_server[$server_id]['port']); + $ds = ldap_connect("{$ldap_server[$server_id]['server']}:{$ldap_server[$server_id]['port']}"); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); if (!$ldap_server[$server_id]['referrals']) { @@ @@ if ($ldap_server[$server_id]['encrypt'] == 'ldaps') { $ds = ldap_connect("ldaps://" . $ldap_server[$server_id]['server'] . ':' . $ldap_server[$server_id]['port']); } else { - $ds = ldap_connect($ldap_server[$server_id]['server'], $ldap_server[$server_id]['port']); + $ds = ldap_connect("{$ldap_server[$server_id]['server']}:{$ldap_server[$server_id]['port']}"); } if (!$ldap_server[$server_id]['referrals']) { ----------- end diff ----------- Applied rules: * CombineHostPortLdapUriRector -- NOTE: This needs to be fixed for 8.3, as ldap_connect no longer supports the second parameter. 6) application/helpers/qanda_helper.php:3535 ---------- begin diff ---------- @@ @@ ), true); } else { $answer = doRender('/survey/questions/answer/arrays/array/dropdown/empty', [], true); - $inputnames = ''; + $inputnames = []; } return array($answer, $inputnames); } ----------- end diff ----------- Applied rules: * AssignArrayToStringRector -- NOTE: It probably wouldn't hurt, but it looks like a false positive. What's been deprecated in 7.1 is the assignment as array on an empty string, which is not happening here. (See: https://www.php.net/manual/en/migration71.incompatible.php#migration71.incompatible.empty-string-modifcation-by-character) [OK] 6 files would have been changed (dry-run) by Rector application/models 1 file with changes =================== 1) application/models/SurveyLink.php:87 ---------- begin diff ---------- @@ @@ $this->deleteLinksBySurvey($iSurveyId); $tableName = "{{tokens_" . $iSurveyId . "}}"; $dateCreated = date('Y-m-d H:i:s', time()); - $query = "INSERT INTO " . SurveyLink::tableName() . " (participant_id, token_id, survey_id, date_created) SELECT participant_id, tid, '" . $iSurveyId . "', '" . $dateCreated . "' FROM " . $tableName . " WHERE participant_id IS NOT NULL"; + $query = "INSERT INTO " . (new SurveyLink())->tableName() . " (participant_id, token_id, survey_id, date_created) SELECT participant_id, tid, '" . $iSurveyId . "', '" . $dateCreated . "' FROM " . $tableName . " WHERE participant_id IS NOT NULL"; return Yii::app()->db->createCommand($query) ->query(); } @@ @@ */ public function deleteTokenLink($aTokenIds, $surveyId) { - $query = "DELETE FROM " . SurveyLink::tableName() + $query = "DELETE FROM " . (new SurveyLink())->tableName() . " WHERE token_id IN (" . implode(", ", $aTokenIds) . ") AND survey_id=:survey_id"; return Yii::app()->db->createCommand($query) ->bindParam(":survey_id", $surveyId) @@ @@ */ public function deleteLinksBySurvey($surveyId) { - $query = "DELETE FROM " . SurveyLink::tableName() . " WHERE survey_id = :survey_id"; + $query = "DELETE FROM " . (new SurveyLink())->tableName() . " WHERE survey_id = :survey_id"; return Yii::app()->db->createCommand($query) ->bindParam(":survey_id", $surveyId) ->query(); ----------- end diff ----------- Applied rules: * StaticCallOnNonStaticToInstanceCallRector [OK] 1 file would have been changed (dry-run) by Rector -- NOTE: This is supposed to be failing since 8.0. I'm not sure why it's not failing. In fact, tableName() is also used like that in other places: - application/models/Answer.php - application/models/Question.php - application/models/TokenDynamic.php