Skip to content

Commit 1f7f746

Browse files
authored
Merge branch 'main' into documentation
2 parents b394a2c + 220399d commit 1f7f746

File tree

349 files changed

+1021
-1129
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

349 files changed

+1021
-1129
lines changed

.github/workflows/labeler.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
name: Labeler
99
on:
1010
pull_request_target:
11+
# Allow manually triggering the workflow.
12+
workflow_dispatch:
1113

1214
jobs:
1315
triage:

.github/workflows/phpcs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@ jobs:
4545

4646
- name: PHPCodeSniffer
4747
run: php vendor/bin/phpcs -s --report=full --standard=${{ matrix.rules.path }}
48-
continue-on-error: ${{ matrix.rules.path != '.phpcs.xml.dist' }}
48+
continue-on-error: ${{ matrix.rules.path == '.phpcs.ecg.xml.dist' }}

.php-cs-fixer.dist.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,8 @@
8383
'single_import_per_statement' => true,
8484
// Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.
8585
'single_line_after_imports' => true,
86+
// Convert double quotes to single quotes for simple strings.
87+
'single_quote' => true,
8688
// Each trait `use` must be done as single statement.
8789
'single_trait_insert_per_statement' => true,
8890
// A case should be followed by a colon and not a semicolon.

app/code/core/Mage/Admin/Model/Config.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function __construct()
7979
public function loadAclResources(Mage_Admin_Model_Acl $acl, $resource = null, $parentName = null)
8080
{
8181
if (is_null($resource)) {
82-
$resource = $this->getAdminhtmlConfig()->getNode("acl/resources");
82+
$resource = $this->getAdminhtmlConfig()->getNode('acl/resources');
8383
$resourceName = null;
8484
} else {
8585
$resourceName = (is_null($parentName) ? '' : $parentName . '/') . $resource->getName();
@@ -117,7 +117,7 @@ public function loadAclResources(Mage_Admin_Model_Acl $acl, $resource = null, $p
117117
*/
118118
public function getAclAssert($name = '')
119119
{
120-
$asserts = $this->getNode("admin/acl/asserts");
120+
$asserts = $this->getNode('admin/acl/asserts');
121121
if ($name === '') {
122122
return $asserts;
123123
}
@@ -133,7 +133,7 @@ public function getAclAssert($name = '')
133133
*/
134134
public function getAclPrivilegeSet($name = '')
135135
{
136-
$sets = $this->getNode("admin/acl/privilegeSets");
136+
$sets = $this->getNode('admin/acl/privilegeSets');
137137
if ($name === '') {
138138
return $sets;
139139
}

app/code/core/Mage/Admin/Model/Observer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function actionPreDispatchAdmin($observer)
5555
/** @var Mage_Core_Model_Session $coreSession */
5656
$coreSession = Mage::getSingleton('core/session');
5757

58-
if ($coreSession->validateFormKey($request->getPost("form_key"))) {
58+
if ($coreSession->validateFormKey($request->getPost('form_key'))) {
5959
$postLogin = $request->getPost('login');
6060
$username = $postLogin['username'] ?? '';
6161
$password = $postLogin['password'] ?? '';

app/code/core/Mage/Admin/Model/Resource/Acl.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr)
148148
Mage::helper('adminhtml')->__(
149149
'The following role resources are no longer available in the system: %s. You can delete them by <a href="%s">clicking here</a>.',
150150
implode(', ', $orphanedResources),
151-
Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource')
151+
Mage::helper('adminhtml')->getUrl('adminhtml/permissions_orphanedResource')
152152
)
153153
);
154154
}

app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function _initSelect()
3333
{
3434
parent::_initSelect();
3535

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

3838
return $this;
3939
}

app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ protected function _initSelect()
3333
{
3434
parent::_initSelect();
3535

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

3838
return $this;
3939
}

app/code/core/Mage/Admin/Model/Roles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ protected function _buildResourcesArray(
146146
}
147147

148148
if ($rawNodes) {
149-
$resource->addAttribute("aclpath", $resourceName);
150-
$resource->addAttribute("module_c", $module);
149+
$resource->addAttribute('aclpath', $resourceName);
150+
$resource->addAttribute('module_c', $module);
151151
}
152152

153153
if (is_null($represent2Darray)) {

app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
->addColumn('variable_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, [
2929
'primary' => true,
3030
'nullable' => false,
31-
'default' => "",
31+
'default' => '',
3232
], 'Config Path')
3333
->addColumn('is_allowed', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, [
3434
'nullable' => false,
@@ -73,7 +73,7 @@
7373
], 'Block ID')
7474
->addColumn('block_name', Varien_Db_Ddl_Table::TYPE_VARCHAR, 255, [
7575
'nullable' => false,
76-
'default' => "",
76+
'default' => '',
7777
], 'Block Name')
7878
->addColumn('is_allowed', Varien_Db_Ddl_Table::TYPE_BOOLEAN, null, [
7979
'nullable' => false,

app/code/core/Mage/Adminhtml/Block/Api/Editroles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function __construct()
3030
protected function _beforeToHtml()
3131
{
3232
$roleId = $this->getRequest()->getParam('rid', false);
33-
$role = Mage::getModel("api/roles")
33+
$role = Mage::getModel('api/roles')
3434
->load($roleId);
3535

3636
$this->addTab('info', [

app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct()
3333

3434
protected function _prepareCollection()
3535
{
36-
$collection = Mage::getModel("api/roles")->getCollection();
36+
$collection = Mage::getModel('api/roles')->getCollection();
3737
$this->setCollection($collection);
3838

3939
return parent::_prepareCollection();

app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function getGridUrl()
145145
*/
146146
protected function _getUsers($json = false)
147147
{
148-
if ($this->getRequest()->getParam('in_role_user') != "") {
148+
if ($this->getRequest()->getParam('in_role_user') != '') {
149149
return (int)$this->getRequest()->getParam('in_role_user');
150150
}
151151
$roleId = ($this->getRequest()->getParam('rid') > 0) ? $this->getRequest()->getParam('rid') : Mage::registry('RID');

app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function __construct()
2525

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

28-
$users = Mage::getModel("api/user")->getCollection()->load();
28+
$users = Mage::getModel('api/user')->getCollection()->load();
2929
$this->setTemplate('api/rolesusers.phtml')
3030
->assign('users', $users->getItems())
3131
->assign('roleId', $roleId);

app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ public function __construct()
2525

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

32-
$user_roles = Mage::getModel("api/roles")
32+
$user_roles = Mage::getModel('api/roles')
3333
->getUsersCollection()
3434
->setUserFilter($uid)
3535
->load();

app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function getGridUrl()
103103
*/
104104
protected function _getSelectedRoles($json = false)
105105
{
106-
if ($this->getRequest()->getParam('user_roles') != "") {
106+
if ($this->getRequest()->getParam('user_roles') != '') {
107107
return $this->getRequest()->getParam('user_roles');
108108
}
109109
$uRoles = Mage::registry('api_user')->getRoles();

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function getSaveUrl(array $args = [])
163163

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

169169
/**

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Pricestep extends Varien_Data
2929
public function getToggleCode()
3030
{
3131
$htmlId = 'use_config_' . $this->getHtmlId();
32-
return "toggleValueElements(this, this.parentNode.parentNode);"
32+
return 'toggleValueElements(this, this.parentNode.parentNode);'
3333
. "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);";
3434
}
3535

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Sortby_Available extends Vari
2929
public function getToggleCode()
3030
{
3131
$htmlId = 'use_config_' . $this->getHtmlId();
32-
return "toggleValueElements(this, this.parentNode.parentNode);"
32+
return 'toggleValueElements(this, this.parentNode.parentNode);'
3333
. "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);";
3434
}
3535

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class Mage_Adminhtml_Block_Catalog_Category_Helper_Sortby_Default extends Varien
2929
public function getToggleCode()
3030
{
3131
$htmlId = 'use_config_' . $this->getHtmlId();
32-
return "toggleValueElements(this, this.parentNode.parentNode);"
32+
return 'toggleValueElements(this, this.parentNode.parentNode);'
3333
. "if (!this.checked) toggleValueElements($('$htmlId'), $('$htmlId').parentNode);";
3434
}
3535

app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function __construct()
3333

3434
protected function _prepareLayout()
3535
{
36-
$addUrl = $this->getUrl("*/*/add", [
36+
$addUrl = $this->getUrl('*/*/add', [
3737
'_current' => true,
3838
'id' => null,
3939
'_query' => false
@@ -141,7 +141,7 @@ public function getNodesUrl()
141141
public function getSwitchTreeUrl()
142142
{
143143
return $this->getUrl(
144-
"*/catalog_category/tree",
144+
'*/catalog_category/tree',
145145
['_current' => true, 'store' => null, '_query' => false, 'id' => null, 'parent' => null]
146146
);
147147
}

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ protected function _prepareForm()
148148

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

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

app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ public function usedDefault($attribute)
7979

8080
// special management for "label" and "position" since they're columns of the
8181
// catalog_product_entity_media_gallery_value database table
82-
if ($attributeCode == "label" || $attributeCode == "position") {
82+
if ($attributeCode == 'label' || $attributeCode == 'position') {
8383
$media_gallery = $this->getDataObject()->getMediaGallery();
84-
if (!count($media_gallery["images"])) {
84+
if (!count($media_gallery['images'])) {
8585
return true;
8686
}
87-
return $media_gallery["images"][0]["{$attributeCode}_use_default"];
87+
return $media_gallery['images'][0]["{$attributeCode}_use_default"];
8888
}
8989

9090
$defaultValue = $this->getDataObject()->getAttributeDefaultValue($attributeCode);

app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ public function canShow()
3939
*/
4040
public function getSecurityAdminUrl()
4141
{
42-
return Mage::helper("adminhtml")->getUrl('adminhtml/system_config/edit/section/admin');
42+
return Mage::helper('adminhtml')->getUrl('adminhtml/system_config/edit/section/admin');
4343
}
4444
}

app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -253,10 +253,10 @@ public function getChartUrl($directUrl = true)
253253
$this->_allSeries = $datas;
254254

255255
// Image-Charts Awesome data format values
256-
$params['chd'] = "a:";
257-
$dataDelimiter = ",";
258-
$dataSetdelimiter = "|";
259-
$dataMissing = "_";
256+
$params['chd'] = 'a:';
257+
$dataDelimiter = ',';
258+
$dataSetdelimiter = '|';
259+
$dataMissing = '_';
260260

261261
// process each string in the array, and find the max length
262262
foreach ($this->getAllSeries() as $index => $serie) {
@@ -321,9 +321,9 @@ public function getChartUrl($directUrl = true)
321321

322322
$params['chd'] .= $buffer;
323323

324-
$labelBuffer = "";
324+
$labelBuffer = '';
325325
$valueBuffer = [];
326-
$rangeBuffer = "";
326+
$rangeBuffer = '';
327327

328328
if (count($this->_axisLabels)) {
329329
$params['chxt'] = implode(',', array_keys($this->_axisLabels));
@@ -353,7 +353,7 @@ public function getChartUrl($directUrl = true)
353353
case '2y':
354354
$formats = Mage::app()->getLocale()->getTranslationList('datetime');
355355
$format = $formats['yyMM'] ?? 'MM/yyyy';
356-
$format = str_replace(["yyyy", "yy", "MM"], ["Y", "y", "m"], $format);
356+
$format = str_replace(['yyyy', 'yy', 'MM'], ['Y', 'y', 'm'], $format);
357357
$this->_axisLabels[$idx][$_index] = date($format, strtotime($_label));
358358
break;
359359
}
@@ -364,21 +364,21 @@ public function getChartUrl($directUrl = true)
364364

365365
$tmpstring = implode('|', $this->_axisLabels[$idx]);
366366

367-
$valueBuffer[] = $indexid . ":|" . $tmpstring;
367+
$valueBuffer[] = $indexid . ':|' . $tmpstring;
368368
if (count($this->_axisLabels[$idx]) > 1) {
369369
$deltaX = 100 / (count($this->_axisLabels[$idx]) - 1);
370370
} else {
371371
$deltaX = 100;
372372
}
373373
} elseif ($idx === 'y') {
374-
$valueBuffer[] = $indexid . ":|" . implode('|', $yLabels);
374+
$valueBuffer[] = $indexid . ':|' . implode('|', $yLabels);
375375
if (count($yLabels) - 1) {
376376
$deltaY = 100 / (count($yLabels) - 1);
377377
} else {
378378
$deltaY = 100;
379379
}
380380
// setting range values for y axis
381-
$rangeBuffer = $indexid . "," . $miny . "," . $maxy . "|";
381+
$rangeBuffer = $indexid . ',' . $miny . ',' . $maxy . '|';
382382
}
383383
$indexid++;
384384
}

app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ protected function _toHtml()
4949
$storeId = Mage::app()->getAnyStoreView()->getId();
5050
}
5151

52-
Varien_Profiler::start("newsletter_queue_proccessing");
52+
Varien_Profiler::start('newsletter_queue_proccessing');
5353
$vars = [];
5454

5555
$vars['subscriber'] = Mage::getModel('newsletter/subscriber');
@@ -59,13 +59,13 @@ protected function _toHtml()
5959
$template->revertDesign();
6060

6161
if ($template->isPlain()) {
62-
$templateProcessed = "<pre>" . htmlspecialchars($templateProcessed) . "</pre>";
62+
$templateProcessed = '<pre>' . htmlspecialchars($templateProcessed) . '</pre>';
6363
}
6464

6565
$templateProcessed = Mage::getSingleton('core/input_filter_maliciousCode')
6666
->linkFilter($templateProcessed);
6767

68-
Varien_Profiler::stop("newsletter_queue_proccessing");
68+
Varien_Profiler::stop('newsletter_queue_proccessing');
6969

7070
return $templateProcessed;
7171
}

app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ protected function _toHtml()
4545
$storeId = Mage::app()->getAnyStoreView()->getId();
4646
}
4747

48-
Varien_Profiler::start("newsletter_template_proccessing");
48+
Varien_Profiler::start('newsletter_template_proccessing');
4949
$vars = [];
5050

5151
$vars['subscriber'] = Mage::getModel('newsletter/subscriber');
@@ -58,13 +58,13 @@ protected function _toHtml()
5858
$template->revertDesign();
5959

6060
if ($template->isPlain()) {
61-
$templateProcessed = "<pre>" . htmlspecialchars($templateProcessed) . "</pre>";
61+
$templateProcessed = '<pre>' . htmlspecialchars($templateProcessed) . '</pre>';
6262
}
6363

6464
$templateProcessed = Mage::getSingleton('core/input_filter_maliciousCode')
6565
->linkFilter($templateProcessed);
6666

67-
Varien_Profiler::stop("newsletter_template_proccessing");
67+
Varien_Profiler::stop('newsletter_template_proccessing');
6868

6969
return $templateProcessed;
7070
}

0 commit comments

Comments
 (0)