Skip to content

Commit

Permalink
Merge branch 'main' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel authored Dec 19, 2024
2 parents 84d8b91 + 2c80954 commit 01fcd30
Show file tree
Hide file tree
Showing 9 changed files with 107 additions and 96 deletions.
12 changes: 2 additions & 10 deletions .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,9 @@ on:

jobs:
phpcs:
name: ${{ matrix.rules.label }}
name: Validation
runs-on: [ubuntu-latest]

strategy:
matrix:
rules:
- label: Ecg
path: .phpcs.dist.ecg.xml
- label: PhpCompatibility
path: .phpcs.dist.php.xml

steps:
- name: Setup PHP
uses: shivammathur/setup-php@v2
Expand All @@ -42,4 +34,4 @@ jobs:
run: composer install --prefer-dist --no-progress --ignore-platform-req=ext-*

- name: PHPCodeSniffer
run: php vendor/bin/phpcs -s -p --report=full --standard=${{ matrix.rules.path }}
run: php vendor/bin/phpcs -s -p --report=full --standard=.phpcs.dist.xml
76 changes: 0 additions & 76 deletions .phpcs.dist.php.xml

This file was deleted.

64 changes: 63 additions & 1 deletion .phpcs.dist.ecg.xml → .phpcs.dist.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0"?>
<ruleset name="OpenMage ECG" namespace="OpenMage\CS\Standard">
<ruleset name="OpenMage" namespace="OpenMage\CS\Standard">
<file>api.php</file>
<file>cron.php</file>
<file>get.php</file>
Expand All @@ -12,6 +12,7 @@
<file>lib/Magento/</file>
<file>lib/Varien/</file>
<file>shell/</file>
<file>tests/unit/</file>

<exclude-pattern>*/core/Mage/*/data/*</exclude-pattern>
<exclude-pattern>*/core/Mage/*/sql/*</exclude-pattern>
Expand Down Expand Up @@ -143,4 +144,65 @@
<!-- should be reviewed -->
<exclude name="Squiz.PHP.Eval.Discouraged"/>
</rule>

<rule ref="PHPCompatibility" />
<rule ref="PHPCompatibility.FunctionNameRestrictions.ReservedFunctionNames.MethodDoubleUnderscore">
<exclude-pattern>*/Varien/Object.php*</exclude-pattern>
<exclude-pattern>*/Varien/Data/Form/Abstract.php*</exclude-pattern>
<exclude-pattern>*/Varien/Db/Tree.php*</exclude-pattern>
<exclude-pattern>*/Varien/Directory/Collection.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.Constants.RemovedConstants.mcrypt_blowfishDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.Constants.RemovedConstants.mcrypt_mode_cbcDeprecatedRemoved">
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.Constants.RemovedConstants.mcrypt_mode_ecbDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.Constants.RemovedConstants.mcrypt_randDeprecatedRemoved">
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_create_ivDeprecatedRemoved">
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.Extensions.RemovedExtensions.mcryptDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_enc_get_iv_sizeDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_enc_get_key_sizeDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_genericDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_generic_deinitDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_generic_initDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_module_closeDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mcrypt_module_openDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
<rule ref="PHPCompatibility.FunctionUse.RemovedFunctions.mdecrypt_genericDeprecatedRemoved">
<exclude-pattern>*/Magento/Crypt.php*</exclude-pattern>
<exclude-pattern>*/Varien/Crypt/Mcrypt.php*</exclude-pattern>
</rule>
</ruleset>
5 changes: 0 additions & 5 deletions .phpcs.xml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
[![All Contributors](https://img.shields.io/github/all-contributors/openmage/magento-lts?color=ee8449)](#contributors)
[![Version](http://poser.pugx.org/openmage/magento-lts/version)](https://packagist.org/packages/openmage/magento-lts)
![https://packagist.org/packages/openmage/magento-lts](https://poser.pugx.org/openmage/magento-lts/license.svg)
![https://packagist.org/packages/openmage/magento-lts](https://poser.pugx.org/openmage/magento-lts/d/total.svg)
![https://github.com/openmage/magento-lts/actions/workflows/security-php.yml](https://github.com/openmage/magento-lts/actions/workflows/security-php.yml/badge.svg)
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Captcha/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ protected function _resetAttempt($login)
protected function _getCaptchaString($request, $formId)
{
$captchaParams = $request->getPost(Mage_Captcha_Helper_Data::INPUT_NAME_FIELD_VALUE);
return $captchaParams[$formId];
return $captchaParams[$formId] ?? '';
}

/**
Expand Down
6 changes: 5 additions & 1 deletion app/code/core/Mage/Core/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
* @method $this setCurrencyCode(string $value)
* @method $this setFormData(array $value)
* @method int getJustVotedPoll()
* @method array getOrderIds()
* @method $this setOrderIds(array $value)
* @method $this setJustVotedPoll(int $value)
* @method $this setLastUrl(string $value)
Expand Down Expand Up @@ -75,4 +74,9 @@ public function validateFormKey($formKey)
{
return ($formKey === $this->getFormKey());
}

public function getOrderIds(bool $clear = false): array
{
return $this->getData('order_ids', $clear) ?? [];
}
}
2 changes: 1 addition & 1 deletion app/code/core/Mage/Tax/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<config>
<modules>
<Mage_Tax>
<version>1.6.0.4</version>
<version>1.6.0.5</version>
</Mage_Tax>
</modules>
<global>
Expand Down
35 changes: 35 additions & 0 deletions app/code/core/Mage/Tax/sql/tax_setup/upgrade-1.6.0.4-1.6.0.5.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php
/**
* OpenMage
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available at https://opensource.org/license/osl-3-0-php
*
* @category Mage
* @package Mage_Tax
* @copyright Copyright (c) 2006-2020 Magento, Inc. (https://www.magento.com)
* @copyright Copyright (c) 2020-2025 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/** @var Mage_Tax_Model_Resource_Setup $this */

$this->startSetup();

$taxTable = $this->getTable('tax/sales_order_tax');
$orderTable = $this->getTable('sales/order');

// adds FK_SALES_ORDER_TAX_ORDER back again
$this->getConnection()->addForeignKey(
$this->getFkName($taxTable, 'order_id', $orderTable, 'entity_id'),
$taxTable,
'order_id',
$orderTable,
'entity_id',
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE,
Varien_Db_Adapter_Interface::FK_ACTION_CASCADE,
true
);

$this->endSetup();

0 comments on commit 01fcd30

Please sign in to comment.