Skip to content

Commit 33adc74

Browse files
authored
PHP-CS-Fixer: added check for double quotes (#4126)
* Rector: CQ - UnusedForeachValueToArrayKeysRector (#1) * Rector: CQ - UnusedForeachValueToArrayKeysRector See Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector * fixes + phpstan See fix at rector: rectorphp/rector-src#6164 * Revert "Rector: CQ - UnusedForeachValueToArrayKeysRector (#1)" This reverts commit 3d7eaf6. * Convert double-quotes to single-quotes
1 parent a3df5c4 commit 33adc74

File tree

323 files changed

+937
-933
lines changed

Some content is hidden

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

323 files changed

+937
-933
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:

.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', [

0 commit comments

Comments
 (0)