Skip to content

Commit

Permalink
Merge branch 'main' into rector-1-cq
Browse files Browse the repository at this point in the history
# Conflicts:
#	dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Attribute/Edit/AttributeForm.php
#	dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/Edit/Tab/Prices.php
#	dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Catalog/Product/ProductForm.php
#	dev/tests/functional/tests/app/Mage/Adminhtml/Test/Block/Widget/FormTabs.php
#	dev/tests/functional/tests/app/Mage/Bundle/Test/Handler/Curl.php
#	dev/tests/functional/tests/app/Mage/Catalog/Test/TestStep/UpdateConfigurableProductStep/DeleteOptionsSubStep.php
#	dev/tests/functional/tests/app/Mage/Customer/Test/Handler/Customer/Curl.php
#	dev/tests/functional/tests/app/Mage/Weee/Test/Constraint/AssertFptApplied.php
  • Loading branch information
sreichel committed Sep 4, 2024
2 parents adcee64 + 7773015 commit 00bfdb2
Show file tree
Hide file tree
Showing 1,955 changed files with 1,109 additions and 118,795 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/check-files.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:

- name: Get changed files
id: changed-files-specific
uses: tj-actions/changed-files@v44
uses: tj-actions/changed-files@v45
with:
files: |
composer.*
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
name: Labeler
on:
pull_request_target:
# Allow manually triggering the workflow.
workflow_dispatch:

jobs:
triage:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpcs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,4 @@ jobs:

- name: PHPCodeSniffer
run: php vendor/bin/phpcs -s --report=full --standard=${{ matrix.rules.path }}
continue-on-error: ${{ matrix.rules.path != '.phpcs.xml.dist' }}
continue-on-error: ${{ matrix.rules.path == '.phpcs.ecg.xml.dist' }}
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@
/dev/openmage/docker-magento
/dev/openmage/.env
/dev/openmage/Caddyfile
/dev/tests/functional/generated
/dev/tests/functional/vendor

/media/*
!/media/.htaccess
Expand Down
9 changes: 9 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@
*/
$config = new PhpCsFixer\Config();
return $config
->setRiskyAllowed(true)
->setRules([
// PHP arrays should be declared using the configured syntax.
'array_syntax' => ['syntax' => 'short'],
// There MUST be one blank line after the namespace declaration.
'blank_line_after_namespace' => true,
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blank line.
Expand All @@ -33,6 +36,8 @@
'indentation_type' => true,
// All PHP files must use same line ending.
'line_ending' => true,
// Use && and || logical operators instead of and and or.
'logical_operators' => true,
// Cast should be written in lower case.
'lowercase_cast' => true,
// PHP keywords MUST be in lower case.
Expand All @@ -41,6 +46,8 @@
'lowercase_static_reference' => true,
// In method arguments and method call, there MUST NOT be a space before each comma and there MUST be one space after each comma. Argument lists MAY be split across multiple lines, where each subsequent line is indented once. When doing so, the first item in the list MUST be on the next line, and there MUST be only one argument per line.
'method_argument_space' => true,
// Replaces intval, floatval, doubleval, strval and boolval function calls with according type casting operator.
'modernize_types_casting' => true,
// All instances created with new keyword must be followed by braces.
'new_with_braces' => true,
// There should be no empty lines after class opening brace.
Expand Down Expand Up @@ -83,6 +90,8 @@
'single_import_per_statement' => true,
// Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.
'single_line_after_imports' => true,
// Convert double quotes to single quotes for simple strings.
'single_quote' => true,
// Each trait `use` must be done as single statement.
'single_trait_insert_per_statement' => true,
// A case should be followed by a colon and not a semicolon.
Expand Down
53 changes: 53 additions & 0 deletions .phpcs.php.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,57 @@
<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>
6 changes: 3 additions & 3 deletions app/code/core/Mage/Admin/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function __construct()
public function loadAclResources(Mage_Admin_Model_Acl $acl, $resource = null, $parentName = null)
{
if (is_null($resource)) {
$resource = $this->getAdminhtmlConfig()->getNode("acl/resources");
$resource = $this->getAdminhtmlConfig()->getNode('acl/resources');
$resourceName = null;
} else {
$resourceName = (is_null($parentName) ? '' : $parentName . '/') . $resource->getName();
Expand Down Expand Up @@ -117,7 +117,7 @@ public function loadAclResources(Mage_Admin_Model_Acl $acl, $resource = null, $p
*/
public function getAclAssert($name = '')
{
$asserts = $this->getNode("admin/acl/asserts");
$asserts = $this->getNode('admin/acl/asserts');
if ($name === '') {
return $asserts;
}
Expand All @@ -133,7 +133,7 @@ public function getAclAssert($name = '')
*/
public function getAclPrivilegeSet($name = '')
{
$sets = $this->getNode("admin/acl/privilegeSets");
$sets = $this->getNode('admin/acl/privilegeSets');
if ($name === '') {
return $sets;
}
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function actionPreDispatchAdmin($observer)
/** @var Mage_Core_Model_Session $coreSession */
$coreSession = Mage::getSingleton('core/session');

if ($coreSession->validateFormKey($request->getPost("form_key"))) {
if ($coreSession->validateFormKey($request->getPost('form_key'))) {
$postLogin = $request->getPost('login');
$username = $postLogin['username'] ?? '';
$password = $postLogin['password'] ?? '';
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Admin/Model/Resource/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr)
Mage::helper('adminhtml')->__(
'The following role resources are no longer available in the system: %s. You can delete them by <a href="%s">clicking here</a>.',
implode(', ', $orphanedResources),
Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource')
Mage::helper('adminhtml')->getUrl('adminhtml/permissions_orphanedResource')
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function _initSelect()
{
parent::_initSelect();

$this->getSelect()->where("main_table.role_type = ?", 'G');
$this->getSelect()->where('main_table.role_type = ?', 'G');

return $this;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function _initSelect()
{
parent::_initSelect();

$this->getSelect()->where("user_id > 0");
$this->getSelect()->where('user_id > 0');

return $this;
}
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Admin/Model/Roles.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,8 @@ protected function _buildResourcesArray(
}

if ($rawNodes) {
$resource->addAttribute("aclpath", $resourceName);
$resource->addAttribute("module_c", $module);
$resource->addAttribute('aclpath', $resourceName);
$resource->addAttribute('module_c', $module);
}

if (is_null($represent2Darray)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
->addColumn('variable_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, [
'primary' => true,
'nullable' => false,
'default' => "",
'default' => '',
], 'Config Path')
->addColumn('is_allowed', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, [
'nullable' => false,
Expand Down Expand Up @@ -73,7 +73,7 @@
], 'Block ID')
->addColumn('block_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, [
'nullable' => false,
'default' => "",
'default' => '',
], 'Block Name')
->addColumn('is_allowed', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, [
'nullable' => false,
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Api/Editroles.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function __construct()
protected function _beforeToHtml()
{
$roleId = $this->getRequest()->getParam('rid', false);
$role = Mage::getModel("api/roles")
$role = Mage::getModel('api/roles')
->load($roleId);

$this->addTab('info', [
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct()

protected function _prepareCollection()
{
$collection = Mage::getModel("api/roles")->getCollection();
$collection = Mage::getModel('api/roles')->getCollection();
$this->setCollection($collection);

return parent::_prepareCollection();
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function getGridUrl()
*/
protected function _getUsers($json = false)
{
if ($this->getRequest()->getParam('in_role_user') != "") {
if ($this->getRequest()->getParam('in_role_user') != '') {
return (int)$this->getRequest()->getParam('in_role_user');
}
$roleId = ($this->getRequest()->getParam('rid') > 0) ? $this->getRequest()->getParam('rid') : Mage::registry('RID');
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct()

$roleId = $this->getRequest()->getParam('rid', false);

$users = Mage::getModel("api/user")->getCollection()->load();
$users = Mage::getModel('api/user')->getCollection()->load();
$this->setTemplate('api/rolesusers.phtml')
->assign('users', $users->getItems())
->assign('roleId', $roleId);
Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ public function __construct()

$uid = $this->getRequest()->getParam('id', false);
$uid = !empty($uid) ? $uid : 0;
$roles = Mage::getModel("api/roles")
$roles = Mage::getModel('api/roles')
->getCollection()
->load();

$user_roles = Mage::getModel("api/roles")
$user_roles = Mage::getModel('api/roles')
->getUsersCollection()
->setUserFilter($uid)
->load();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public function getGridUrl()
*/
protected function _getSelectedRoles($json = false)
{
if ($this->getRequest()->getParam('user_roles') != "") {
if ($this->getRequest()->getParam('user_roles') != '') {
return $this->getRequest()->getParam('user_roles');
}
$uRoles = Mage::registry('api_user')->getRoles();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public function getSaveUrl(array $args = [])

public function getEditUrl()
{
return $this->getUrl("*/catalog_category/edit", ['_current' => true, 'store' => null, '_query' => false, 'id' => null, 'parent' => null]);
return $this->getUrl('*/catalog_category/edit', ['_current' => true, 'store' => null, '_query' => false, 'id' => null, 'parent' => null]);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Pricestep extends Varien_Data
public function getToggleCode()
{
$htmlId = 'use_config_' . $this->getHtmlId();
return "toggleValueElements(this, this.parentNode.parentNode);"
return 'toggleValueElements(this, this.parentNode.parentNode);'
. "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Sortby_Available extends Vari
public function getToggleCode()
{
$htmlId = 'use_config_' . $this->getHtmlId();
return "toggleValueElements(this, this.parentNode.parentNode);"
return 'toggleValueElements(this, this.parentNode.parentNode);'
. "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Sortby_Default extends Varien
public function getToggleCode()
{
$htmlId = 'use_config_' . $this->getHtmlId();
return "toggleValueElements(this, this.parentNode.parentNode);"
return 'toggleValueElements(this, this.parentNode.parentNode);'
. "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);";
}

Expand Down
4 changes: 2 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public function __construct()

protected function _prepareLayout()
{
$addUrl = $this->getUrl("*/*/add", [
$addUrl = $this->getUrl('*/*/add', [
'_current' => true,
'id' => null,
'_query' => false
Expand Down Expand Up @@ -141,7 +141,7 @@ public function getNodesUrl()
public function getSwitchTreeUrl()
{
return $this->getUrl(
"*/catalog_category/tree",
'*/catalog_category/tree',
['_current' => true, 'store' => null, '_query' => false, 'id' => null, 'parent' => null]
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected function _prepareForm()

$fieldset->addField('is_filterable', 'select', [
'name' => 'is_filterable',
'label' => Mage::helper('catalog')->__("Use In Layered Navigation"),
'label' => Mage::helper('catalog')->__('Use In Layered Navigation'),
'title' => Mage::helper('catalog')->__('Can be used only with catalog input type Dropdown, Multiple Select and Price'),
'note' => Mage::helper('catalog')->__('Can be used only with catalog input type Dropdown, Multiple Select and Price'),
'values' => [
Expand All @@ -160,7 +160,7 @@ protected function _prepareForm()

$fieldset->addField('is_filterable_in_search', 'select', [
'name' => 'is_filterable_in_search',
'label' => Mage::helper('catalog')->__("Use In Search Results Layered Navigation"),
'label' => Mage::helper('catalog')->__('Use In Search Results Layered Navigation'),
'title' => Mage::helper('catalog')->__('Can be used only with catalog input type Dropdown, Multiple Select and Price'),
'note' => Mage::helper('catalog')->__('Can be used only with catalog input type Dropdown, Multiple Select and Price'),
'values' => $yesnoSource,
Expand Down Expand Up @@ -233,9 +233,9 @@ protected function _prepareForm()
/** @var Mage_Adminhtml_Block_Widget_Form_Element_Dependence $block */
$block = $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence');
$this->setChild('form_after', $block
->addFieldMap("is_wysiwyg_enabled", 'wysiwyg_enabled')
->addFieldMap("is_html_allowed_on_front", 'html_allowed_on_front')
->addFieldMap("frontend_input", 'frontend_input_type')
->addFieldMap('is_wysiwyg_enabled', 'wysiwyg_enabled')
->addFieldMap('is_html_allowed_on_front', 'html_allowed_on_front')
->addFieldMap('frontend_input', 'frontend_input_type')
->addFieldDependence('wysiwyg_enabled', 'frontend_input_type', 'textarea')
->addFieldDependence('html_allowed_on_front', 'wysiwyg_enabled', '0'));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,12 @@ public function usedDefault($attribute)

// special management for "label" and "position" since they're columns of the
// catalog_product_entity_media_gallery_value database table
if ($attributeCode == "label" || $attributeCode == "position") {
if ($attributeCode == 'label' || $attributeCode == 'position') {
$media_gallery = $this->getDataObject()->getMediaGallery();
if (!count($media_gallery["images"])) {
if (!count($media_gallery['images'])) {
return true;
}
return $media_gallery["images"][0]["{$attributeCode}_use_default"];
return $media_gallery['images'][0]["{$attributeCode}_use_default"];
}

$defaultValue = $this->getDataObject()->getAttributeDefaultValue($attributeCode);
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,6 @@ public function canShow()
*/
public function getSecurityAdminUrl()
{
return Mage::helper("adminhtml")->getUrl('adminhtml/system_config/edit/section/admin');
return Mage::helper('adminhtml')->getUrl('adminhtml/system_config/edit/section/admin');
}
}
Loading

0 comments on commit 00bfdb2

Please sign in to comment.