Skip to content
Code-Schnipsel Gruppen Projekte

fix(phpstan): code improvements and resolve warnings

Zusammengeführt Henning Leutz schlägt vor, next-2.x in main zu mergen.
1 Datei
+ 11
11
Änderungen vergleichen
  • Nebeneinander
  • In der Reihe
  • Modified 'var' declarations to 'const' in CouponCodeInput.js file for better ES6 compliance. This
    refactoring helps increase code readability and ensures variables are block-scoped, reducing the
    risk of accidental variable reassignment or mutation.
@@ -23,7 +23,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
], function(QUI, QUIControl, QUILoader, Sessions, CouponCodes, QUIAjax, QUILocale, Mustache, template) {
'use strict';
var lg = 'quiqqer/coupons';
const lg = 'quiqqer/coupons';
return new Class({
@@ -50,8 +50,8 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
* Event: onInject
*/
$onInject: function() {
var self = this;
var lgPrefix = 'controls.frontend.CouponCodeInput.template.';
const self = this;
const lgPrefix = 'controls.frontend.CouponCodeInput.template.';
this.$Elm.addClass('quiqqer-coupons-field');
@@ -81,7 +81,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
});
if (this.isInOrder()) {
var OrderProcess = this.getOrderProcess();
const OrderProcess = this.getOrderProcess();
new Promise(function(resolve) {
if (!OrderProcess.isLoaded()) {
@@ -118,8 +118,8 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
return;
}
var self = this;
var code = this.$Input.value.trim();
const self = this;
const code = this.$Input.value.trim();
if (code === '') {
this.$Input.focus();
@@ -192,7 +192,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
return;
}
var OrderProcess = this.getOrderProcess();
const OrderProcess = this.getOrderProcess();
OrderProcess.Loader.show();
@@ -239,7 +239,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
* @return {boolean}
*/
isInOrder: function() {
var OrderProcessNode = this.getElm().getParent(
const OrderProcessNode = this.getElm().getParent(
'[data-qui="package/quiqqer/order/bin/frontend/controls/OrderProcess"]'
);
@@ -252,7 +252,7 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
* @return {Object}
*/
getOrderProcess: function() {
var OrderProcessNode = this.getElm().getParent(
const OrderProcessNode = this.getElm().getParent(
'[data-qui="package/quiqqer/order/bin/frontend/controls/OrderProcess"]'
);
@@ -269,10 +269,10 @@ define('package/quiqqer/coupons/bin/frontend/controls/CouponCodeInput', [
return Promise.resolve();
}
var self = this;
const self = this;
return new Promise(function(resolve) {
var OrderProcess = self.getOrderProcess();
const OrderProcess = self.getOrderProcess();
OrderProcess.Loader.show();
OrderProcess.getOrder().then(function(orderHash) {