Skip to content

Commit

Permalink
Merge branch 'main' into rector-1-cq
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Sep 6, 2024
2 parents 6a1bd03 + a375fad commit e4e6484
Show file tree
Hide file tree
Showing 26 changed files with 51 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .ddev/commands/web/magerun
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## Example: "ddev magerun"

if [ ! -f vendor/bin/n98-magerun ]; then
read -r -p "n98-magerun is not installed. Do you want to install it? [y/N] " INSTALL_MAGE
read -r -p "n98-magerun is not installed. Do you want to install it? [y/N] " INSTALL_MAGERUN
INSTALL_MAGERUN=${INSTALL_MAGERUN,,} # to lower
if [[ "${INSTALL_MAGERUN}" =~ ^(yes|y) ]]; then
composer require --dev n98/magerun:dev-develop
Expand Down
Empty file modified .ddev/commands/web/openmage-admin
100644 → 100755
Empty file.
1 change: 1 addition & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -887,6 +887,7 @@
'phpstan':
- changed-files:
- any-glob-to-any-file: [
.phpstan*,
phpstan*,
.github/workflows/phpstan.yml
]
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,11 @@
.phpcs*.xml
!.phpcs*.xml.dist

# PhpStan
.phpstan*.neon
phpstan*.neon
!phpstan.dist.*.neon
!.phpstan.dist.neon
!.phpstan.dist.*.neon

# dev scripts loaded via composer
/shell/update-copyright.php
Expand Down
2 changes: 2 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
'class_definition' => true,
// Remove extra spaces in a nullable typehint.
'compact_nullable_typehint' => true,
// Concatenation should be spaced according to configuration.
'concat_space' => ['spacing' => 'one'],
// The PHP constants `true`, `false`, and `null` MUST be written using the correct casing.
'constant_case' => true,
// Equal sign in declare statement should be surrounded by spaces or not following configuration.
Expand Down
5 changes: 5 additions & 0 deletions phpstan.dist.baseline.neon → .phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3960,6 +3960,11 @@ parameters:
count: 1
path: app/code/core/Mage/Sales/Model/Entity/Quote/Address/Attribute/Frontend/Tax.php

-
message: "#^Negated boolean expression is always true\\.$#"
count: 1
path: app/code/core/Mage/Sales/Model/Order.php

-
message: "#^Variable \\$oldArea might not be defined\\.$#"
count: 1
Expand Down
2 changes: 1 addition & 1 deletion phpstan.dist.neon → .phpstan.dist.neon
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
includes:
- vendor/macopedia/phpstan-magento1/extension.neon
- phpstan.dist.baseline.neon
- .phpstan.dist.baseline.neon
- phar://phpstan.phar/conf/bleedingEdge.neon
parameters:
magentoRootPath: %currentWorkingDirectory%
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function _prepareForm()

$fieldset->addField('req_text', 'note', [
'text' => '<ul class="messages"><li class="notice-msg"><ul><li>'
. $this->__('Only attributes with scope "Global", input type "Dropdown" and Use To Create Configurable Product "Yes" are available.')
. $this->__('Only attributes with scope "Global", input type "Dropdown" and Use To Create Configurable Product "Yes" are available.')
. '</li></ul></li></ul>'
]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function initForm()
$form->getElement('website_id')->setAfterElementHtml(
'<script type="text/javascript">'
. "
var {$prefix}_websites = " . Mage::helper('core')->jsonEncode($websites) .";
var {$prefix}_websites = " . Mage::helper('core')->jsonEncode($websites) . ";
Validation.add(
'validate-website-has-store',
'" . Mage::helper('core')->jsQuoteEscape(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ protected function _prepareLayout()
'name' => 'add_address_button',
'element_name' => 'add_address_button',
'disabled' => $this->isReadonly(),
'class' => 'add' . ($this->isReadonly() ? ' disabled' : ''),
'class' => 'add' . ($this->isReadonly() ? ' disabled' : ''),
'onclick' => 'customerAddresses.addNewAddress()'
])
);
Expand All @@ -75,7 +75,7 @@ protected function _prepareLayout()
'id' => 'cancel_add_address' . $this->getTemplatePrefix(),
'name' => 'cancel_address',
'element_name' => 'cancel_address',
'class' => 'cancel delete-address' . ($this->isReadonly() ? ' disabled' : ''),
'class' => 'cancel delete-address' . ($this->isReadonly() ? ' disabled' : ''),
'disabled' => $this->isReadonly(),
'onclick' => 'customerAddresses.cancelAdd(this)',
])
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Catalog/Model/Product/Image.php
Original file line number Diff line number Diff line change
Expand Up @@ -389,9 +389,9 @@ public function setBaseFile($file)
// add misc params as a hash
$miscParams = [
($this->_keepAspectRatio ? '' : 'non') . 'proportional',
($this->_keepFrame ? '' : 'no') . 'frame',
($this->_keepTransparency ? '' : 'no') . 'transparency',
($this->_constrainOnly ? 'do' : 'not') . 'constrainonly',
($this->_keepFrame ? '' : 'no') . 'frame',
($this->_keepTransparency ? '' : 'no') . 'transparency',
($this->_constrainOnly ? 'do' : 'not') . 'constrainonly',
$this->_backgroundColorStr,
'angle' . $this->_angle,
'quality' . $this->_quality
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Core/Model/Translate.php
Original file line number Diff line number Diff line change
Expand Up @@ -465,7 +465,7 @@ public function getTemplateFile($file, $type, $localeCode = null)
$localeCode = $this->getLocale();
}

$filePath = Mage::getBaseDir('locale') . DS
$filePath = Mage::getBaseDir('locale') . DS
. $localeCode . DS . 'template' . DS . $type . DS . $file;

if (!file_exists($filePath)) { // If no template specified for this locale, use store default
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/ImportExport/Model/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,6 @@ public function getFileFormat()
*/
public function getFileName()
{
return $this->getEntity() . '_' . date('Ymd_His') . '.' . $this->_getWriter()->getFileExtension();
return $this->getEntity() . '_' . date('Ymd_His') . '.' . $this->_getWriter()->getFileExtension();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ protected function _getExtraJs($element, $tooltipsExist = false)
if (conflict && !confirmationShowed && anotherEnabler.value == 1) {
if (isEvent) {
confirmationApproved = confirm(\'' . $this->helper('core')->jsQuoteEscape($this->__('There is already another PayPal solution enabled. Enable this solution instead?')) . '\');
confirmationApproved = confirm(\'' . $this->helper('core')->jsQuoteEscape($this->__('There is already another PayPal solution enabled. Enable this solution instead?')) . '\');
} else {
paypalConflictsObject.isConflict = true;
}
Expand Down Expand Up @@ -320,14 +320,14 @@ protected function _getExtraJs($element, $tooltipsExist = false)
paypalConflictsObject.toggleBmlEnabler(enablerElement);
});
if (paypalConflictsObject.isConflict || paypalConflictsObject.ecMissed) {
var notification = \'' . $this->helper('core')->jsQuoteEscape($this->__('The following error(s) occured:')) . '\';
var notification = \'' . $this->helper('core')->jsQuoteEscape($this->__('The following error(s) occured:')) . '\';
if (paypalConflictsObject.isConflict) {
notification += "\\n " + \'' . $this->helper('core')->jsQuoteEscape($this->__('Some PayPal solutions conflict.')) . '\';
notification += "\\n " + \'' . $this->helper('core')->jsQuoteEscape($this->__('Some PayPal solutions conflict.')) . '\';
}
if (paypalConflictsObject.ecMissed) {
notification += "\\n " + \'' . $this->helper('core')->jsQuoteEscape($this->__('PayPal Express Checkout is not enabled.')) . '\';
notification += "\\n " + \'' . $this->helper('core')->jsQuoteEscape($this->__('PayPal Express Checkout is not enabled.')) . '\';
}
notification += "\\n" + \'' . $this->helper('core')->jsQuoteEscape($this->__('Please re-enable the previously enabled payment solutions.')) . '\';
notification += "\\n" + \'' . $this->helper('core')->jsQuoteEscape($this->__('Please re-enable the previously enabled payment solutions.')) . '\';
setTimeout(function() {
alert(notification);
}, 1);
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Rule/Model/Resource/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public function bindRuleToEntity($ruleIds, $entityIds, $entityType, $deleteOldRe
if ($deleteOldResults) {
$adapter->delete(
$this->getTable($entityInfo['associations_table']),
$adapter->quoteInto($entityInfo['rule_id_field'] . ' IN (?) AND ', $ruleIds) .
$adapter->quoteInto($entityInfo['rule_id_field'] . ' IN (?) AND ', $ruleIds) .
$adapter->quoteInto($entityInfo['entity_id_field'] . ' NOT IN (?)', $entityIds)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -913,13 +913,13 @@

if ($joinCount > 60) { // If we have too much joins for mysql
$joinCount = 0;
$sql .= $select->crossUpdateFromSelect(['e' => $installer->getTable($flatTablePrefix)]) . "; \n";
$sql .= $select->crossUpdateFromSelect(['e' => $installer->getTable($flatTablePrefix)]) . "; \n";
$select->reset();
}
}

if ($joinCount > 0) {
$sql .= $select->crossUpdateFromSelect(['e' => $installer->getTable($flatTablePrefix)]) . "; \n";
$sql .= $select->crossUpdateFromSelect(['e' => $installer->getTable($flatTablePrefix)]) . "; \n";
}
}
} else {
Expand Down
3 changes: 3 additions & 0 deletions app/code/core/Mage/Sendfriend/Model/Resource/Sendfriend.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
*/
class Mage_Sendfriend_Model_Resource_Sendfriend extends Mage_Core_Model_Resource_Db_Abstract
{
/**
* @return void
*/
protected function _construct()
{
$this->_init('sendfriend/sendfriend', 'log_id');
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Sendfriend/Model/Sendfriend.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function getCookie()
/**
* Set Visitor Remote Address
*
* @param int $ipAddr the IP address on Long Format
* @param string|false $ipAddr the IP address on Long Format
* @return $this
*/
public function setRemoteAddr($ipAddr)
Expand All @@ -255,7 +255,7 @@ public function getRemoteAddr()
/**
* Set Website Id
*
* @param int $id - website id
* @param int|string|null $id - website id
* @return $this
*/
public function setWebsiteId($id)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ protected function _initSendToFriendModel()
/**
* Show Send to a Friend Form
*
* @return void
*/
public function sendAction()
{
Expand Down Expand Up @@ -132,6 +133,7 @@ public function sendAction()
/**
* Send Email Post Action
*
* @return $this|void
*/
public function sendmailAction()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1096,7 +1096,7 @@ protected function _getWeightUnit()
protected function getCountryParams($countryCode)
{
if (empty($this->_countryParams)) {
$dhlConfigPath = Mage::getModuleDir('etc', 'Mage_Usa') . DS . 'dhl' . DS;
$dhlConfigPath = Mage::getModuleDir('etc', 'Mage_Usa') . DS . 'dhl' . DS;
$countriesXml = file_get_contents($dhlConfigPath . 'international' . DS . 'countries.xml');
$this->_countryParams = new Varien_Simplexml_Element($countriesXml);
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ class Mage_Usa_Model_Shipping_Carrier_Fedex extends Mage_Usa_Model_Shipping_Carr
public function __construct()
{
parent::__construct();
$wsdlBasePath = Mage::getModuleDir('etc', 'Mage_Usa') . DS . 'wsdl' . DS . 'FedEx' . DS;
$wsdlBasePath = Mage::getModuleDir('etc', 'Mage_Usa') . DS . 'wsdl' . DS . 'FedEx' . DS;
$this->_shipServiceWsdl = $wsdlBasePath . 'ShipService_v10.wsdl';
$this->_rateServiceWsdl = $wsdlBasePath . 'RateService_v10.wsdl';
$this->_trackServiceWsdl = $wsdlBasePath . 'TrackService_v5.wsdl';
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"openmage/dev-meta-package": "^1.0",
"phpcompatibility/php-compatibility": "^9.3",
"phpmd/phpmd": "^2.13",
"phpstan/phpstan": "^1.11",
"phpstan/phpstan": "^1.12.1",
"phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.7",
"symplify/vendor-patches": "^11.1"
Expand Down
12 changes: 6 additions & 6 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/Varien/Data/Form/Element/Color.php
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public function getElementHtml()
}

$html = '<input type="color" id="' . $id . ':html5" class="input-color-html5" '
. 'value="#' . trim($this->getEscapedValue(), '#') . '" oninput="' . $oninput . '" '
. 'value="#' . trim($this->getEscapedValue(), '#') . '" oninput="' . $oninput . '" '
. '/>' . "\n";

$this->addClass('input-color');
Expand Down
4 changes: 2 additions & 2 deletions lib/Varien/Db/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ public function getChildren($ID, $start_level = 0, $end_level = 0)

$dbSelect = new Zend_Db_Select($this->_db);
$dbSelect->from($this->_table)
->where($this->_left . ' >= :left')
->where($this->_left . ' >= :left')
->where($this->_right . ' <= :right')
->order($this->_left);

Expand Down Expand Up @@ -524,7 +524,7 @@ public function getNode($nodeId)
{
$dbSelect = new Zend_Db_Select($this->_db);
$dbSelect->from($this->_table)
->where($this->_table . '.' . $this->_id . ' >= :id');
->where($this->_table . '.' . $this->_id . ' >= :id');

$this->_addExtTablesToSelect($dbSelect);

Expand Down
2 changes: 1 addition & 1 deletion lib/Varien/Filter/FormElementName.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function filter($value)
$pattern = '/[^a-zA-Z0-9\[\];_\-' . $whiteSpace . ']/';
} elseif (self::$_meansEnglishAlphabet) {
//The Alphabet means english alphabet.
$pattern = '/[^a-zA-Z0-9\[\];_\-' . $whiteSpace . ']/u';
$pattern = '/[^a-zA-Z0-9\[\];_\-' . $whiteSpace . ']/u';
} else {
//The Alphabet means each language's alphabet.
$pattern = '/[^\p{L}\p{N}\[\];_\-' . $whiteSpace . ']/u';
Expand Down

0 comments on commit e4e6484

Please sign in to comment.