From a3df5c4d99c0a774406593bbd6c5a7772c275480 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 13:42:10 +0800 Subject: [PATCH 1/6] Bump friendsofphp/php-cs-fixer from 3.62.0 to 3.64.0 (#4178) Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.62.0 to 3.64.0. - [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases) - [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md) - [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.62.0...v3.64.0) --- updated-dependencies: - dependency-name: friendsofphp/php-cs-fixer dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- composer.lock | 60 +++++++++++++++++++++++++-------------------------- 1 file changed, 30 insertions(+), 30 deletions(-) diff --git a/composer.lock b/composer.lock index 7afc631ede6..4be079586ce 100644 --- a/composer.lock +++ b/composer.lock @@ -1112,16 +1112,16 @@ }, { "name": "symfony/console", - "version": "v5.4.42", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", - "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "url": "https://api.github.com/repos/symfony/console/zipball/e86f8554de667c16dde8aeb89a3990cfde924df9", + "reference": "e86f8554de667c16dde8aeb89a3990cfde924df9", "shasum": "" }, "require": { @@ -1191,7 +1191,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.42" + "source": "https://github.com/symfony/console/tree/v5.4.43" }, "funding": [ { @@ -1207,7 +1207,7 @@ "type": "tidelift" } ], - "time": "2024-07-26T12:21:55+00:00" + "time": "2024-08-13T16:31:56+00:00" }, { "name": "symfony/css-selector", @@ -2130,16 +2130,16 @@ }, { "name": "symfony/string", - "version": "v5.4.42", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "909cec913edea162a3b2836788228ad45fcab337" + "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/909cec913edea162a3b2836788228ad45fcab337", - "reference": "909cec913edea162a3b2836788228ad45fcab337", + "url": "https://api.github.com/repos/symfony/string/zipball/8be1d484951ff5ca995eaf8edcbcb8b9a5888450", + "reference": "8be1d484951ff5ca995eaf8edcbcb8b9a5888450", "shasum": "" }, "require": { @@ -2196,7 +2196,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.42" + "source": "https://github.com/symfony/string/tree/v5.4.43" }, "funding": [ { @@ -2212,7 +2212,7 @@ "type": "tidelift" } ], - "time": "2024-07-20T18:38:32+00:00" + "time": "2024-08-01T10:24:28+00:00" } ], "packages-dev": [ @@ -2695,16 +2695,16 @@ }, { "name": "fidry/cpu-core-counter", - "version": "1.1.0", + "version": "1.2.0", "source": { "type": "git", "url": "https://github.com/theofidry/cpu-core-counter.git", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42" + "reference": "8520451a140d3f46ac33042715115e290cf5785f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/f92996c4d5c1a696a6a970e20f7c4216200fcc42", - "reference": "f92996c4d5c1a696a6a970e20f7c4216200fcc42", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/8520451a140d3f46ac33042715115e290cf5785f", + "reference": "8520451a140d3f46ac33042715115e290cf5785f", "shasum": "" }, "require": { @@ -2744,7 +2744,7 @@ ], "support": { "issues": "https://github.com/theofidry/cpu-core-counter/issues", - "source": "https://github.com/theofidry/cpu-core-counter/tree/1.1.0" + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.2.0" }, "funding": [ { @@ -2752,20 +2752,20 @@ "type": "github" } ], - "time": "2024-02-07T09:43:46+00:00" + "time": "2024-08-06T10:04:20+00:00" }, { "name": "friendsofphp/php-cs-fixer", - "version": "v3.62.0", + "version": "v3.64.0", "source": { "type": "git", "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", - "reference": "627692f794d35c43483f34b01d94740df2a73507" + "reference": "58dd9c931c785a79739310aef5178928305ffa67" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/627692f794d35c43483f34b01d94740df2a73507", - "reference": "627692f794d35c43483f34b01d94740df2a73507", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/58dd9c931c785a79739310aef5178928305ffa67", + "reference": "58dd9c931c785a79739310aef5178928305ffa67", "shasum": "" }, "require": { @@ -2847,7 +2847,7 @@ ], "support": { "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", - "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.62.0" + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.64.0" }, "funding": [ { @@ -2855,7 +2855,7 @@ "type": "github" } ], - "time": "2024-08-07T17:03:09+00:00" + "time": "2024-08-30T23:09:38+00:00" }, { "name": "macopedia/phpstan-magento1", @@ -6038,16 +6038,16 @@ }, { "name": "symfony/finder", - "version": "v5.4.42", + "version": "v5.4.43", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "0724c51fa067b198e36506d2864e09a52180998a" + "reference": "ae25a9145a900764158d439653d5630191155ca0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/0724c51fa067b198e36506d2864e09a52180998a", - "reference": "0724c51fa067b198e36506d2864e09a52180998a", + "url": "https://api.github.com/repos/symfony/finder/zipball/ae25a9145a900764158d439653d5630191155ca0", + "reference": "ae25a9145a900764158d439653d5630191155ca0", "shasum": "" }, "require": { @@ -6081,7 +6081,7 @@ "description": "Finds files and directories via an intuitive fluent interface", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/finder/tree/v5.4.42" + "source": "https://github.com/symfony/finder/tree/v5.4.43" }, "funding": [ { @@ -6097,7 +6097,7 @@ "type": "tidelift" } ], - "time": "2024-07-22T08:53:29+00:00" + "time": "2024-08-13T14:03:51+00:00" }, { "name": "symfony/options-resolver", From 33adc745c360388f499787dfcd4d4a2b3bcf30e1 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 2 Sep 2024 07:46:22 +0200 Subject: [PATCH 2/6] 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: https://github.com/rectorphp/rector-src/pull/6164 * Revert "Rector: CQ - UnusedForeachValueToArrayKeysRector (#1)" This reverts commit 3d7eaf63f2211a9e1a8defe8c29e8f6da889ab2e. * Convert double-quotes to single-quotes --- .github/workflows/labeler.yml | 2 + .php-cs-fixer.dist.php | 2 + app/code/core/Mage/Admin/Model/Config.php | 6 +- app/code/core/Mage/Admin/Model/Observer.php | 2 +- .../core/Mage/Admin/Model/Resource/Acl.php | 2 +- .../Admin/Model/Resource/Roles/Collection.php | 2 +- .../Model/Resource/Roles/User/Collection.php | 2 +- app/code/core/Mage/Admin/Model/Roles.php | 4 +- .../admin_setup/upgrade-1.6.1.1-1.6.1.2.php | 4 +- .../Mage/Adminhtml/Block/Api/Editroles.php | 2 +- .../Mage/Adminhtml/Block/Api/Grid/Role.php | 2 +- .../Adminhtml/Block/Api/Role/Grid/User.php | 2 +- .../Adminhtml/Block/Api/Tab/Rolesusers.php | 2 +- .../Adminhtml/Block/Api/Tab/Userroles.php | 4 +- .../Block/Api/User/Edit/Tab/Roles.php | 2 +- .../Block/Catalog/Category/Abstract.php | 2 +- .../Catalog/Category/Helper/Pricestep.php | 2 +- .../Category/Helper/Sortby/Available.php | 2 +- .../Category/Helper/Sortby/Default.php | 2 +- .../Adminhtml/Block/Catalog/Category/Tree.php | 4 +- .../Product/Attribute/Edit/Tab/Main.php | 10 +- .../Catalog/Product/Helper/Form/Gallery.php | 6 +- .../Mage/Adminhtml/Block/Checkout/Formkey.php | 2 +- .../Mage/Adminhtml/Block/Dashboard/Graph.php | 20 +- .../Block/Newsletter/Queue/Preview.php | 6 +- .../Block/Newsletter/Template/Preview.php | 6 +- .../Adminhtml/Block/Notification/Curl.php | 2 +- .../Adminhtml/Block/Permissions/Grid/Role.php | 2 +- .../Adminhtml/Block/Permissions/Grid/User.php | 2 +- .../Block/Permissions/Role/Grid/User.php | 2 +- .../Block/Permissions/Tab/Rolesusers.php | 2 +- .../Block/Permissions/Tab/Userroles.php | 4 +- .../Block/Permissions/User/Edit/Tab/Roles.php | 2 +- .../Block/Permissions/Usernroles.php | 4 +- .../core/Mage/Adminhtml/Block/Rating/Edit.php | 2 +- .../Report/Grid/Column/Renderer/Currency.php | 2 +- .../Adminhtml/Block/Sales/Order/Create.php | 2 +- .../Block/Sales/Order/Create/Items/Grid.php | 2 +- .../Block/Sales/Order/View/Tab/History.php | 2 +- .../Block/Sales/Transactions/Detail.php | 2 +- .../Block/System/Config/Form/Field/Export.php | 2 +- .../Adminhtml/Block/System/Config/Tabs.php | 2 +- .../System/Convert/Gui/Edit/Tab/Wizard.php | 4 +- .../Block/System/Convert/Profile/Run.php | 8 +- .../Block/System/Email/Template/Preview.php | 6 +- .../Block/System/Store/Delete/Group.php | 2 +- .../Block/System/Store/Delete/Website.php | 2 +- .../Mage/Adminhtml/Block/Tax/Rule/Edit.php | 2 +- .../Block/Widget/Form/Element/Gallery.php | 2 +- .../core/Mage/Adminhtml/Block/Widget/Grid.php | 4 +- .../Widget/Grid/Column/Renderer/Checkbox.php | 2 +- .../Widget/Grid/Column/Renderer/Currency.php | 2 +- .../Widget/Grid/Column/Renderer/Price.php | 2 +- .../Widget/Grid/Column/Renderer/Wrapline.php | 2 +- .../Block/Widget/Grid/Massaction/Abstract.php | 4 +- .../core/Mage/Adminhtml/Controller/Action.php | 4 +- .../Model/Customer/Renderer/Region.php | 4 +- .../System/Config/Source/Tax/Basedon.php | 2 +- .../System/Config/Source/Tax/Catalog.php | 2 +- .../controllers/Api/RoleController.php | 12 +- .../Adminhtml/controllers/CacheController.php | 10 +- .../Catalog/CategoryController.php | 4 +- .../Catalog/Product/GalleryController.php | 4 +- .../controllers/Catalog/ProductController.php | 4 +- .../controllers/Cms/BlockController.php | 2 +- .../controllers/Cms/PageController.php | 2 +- .../Adminhtml/controllers/IndexController.php | 2 +- .../controllers/RatingController.php | 2 +- .../Sales/Billing/AgreementController.php | 2 +- .../Sales/Order/CreditmemoController.php | 6 +- .../Sales/Order/InvoiceController.php | 2 +- .../Sales/Order/ShipmentController.php | 2 +- .../controllers/Sales/OrderController.php | 2 +- .../Sales/TransactionsController.php | 2 +- .../controllers/System/AccountController.php | 6 +- .../System/Convert/GuiController.php | 2 +- .../controllers/System/DesignController.php | 2 +- .../controllers/System/StoreController.php | 10 +- .../Tax/Class/CustomerController.php | 2 +- .../Tax/Class/ProductController.php | 2 +- .../controllers/Tax/RateController.php | 10 +- .../controllers/Tax/RuleController.php | 4 +- .../Model/Resource/Roles/User/Collection.php | 2 +- .../Api/Model/Resource/Rules/Collection.php | 2 +- app/code/core/Mage/Api/Model/Roles.php | 2 +- app/code/core/Mage/Api/Model/Server.php | 2 +- .../Mage/Api/Model/Server/Adapter/Soap.php | 6 +- .../Mage/Api/Model/Server/Adapter/Xmlrpc.php | 2 +- .../Mage/Api/Model/Server/V2/Adapter/Soap.php | 2 +- .../Api/Model/Server/Wsi/Adapter/Soap.php | 2 +- app/code/core/Mage/Api/Model/Wsdl/Config.php | 8 +- .../Api2/Model/Resource/Validator/Eav.php | 2 +- app/code/core/Mage/Api2/Model/Server.php | 4 +- .../Adminhtml/Api2/RoleController.php | 6 +- .../core/Mage/Authorizenet/Helper/Admin.php | 2 +- .../core/Mage/Authorizenet/Helper/Data.php | 2 +- .../Authorizenet/Model/Directpost/Request.php | 2 +- .../Product/Edit/Tab/Attributes/Extend.php | 12 +- .../Adminhtml/Sales/Order/Items/Renderer.php | 2 +- .../Sales/Order/View/Items/Renderer.php | 2 +- .../Block/Sales/Order/Items/Renderer.php | 2 +- .../Mage/Bundle/Model/Resource/Bundle.php | 12 +- .../Bundle/Model/Resource/Indexer/Price.php | 8 +- .../Mage/Bundle/Model/Resource/Selection.php | 2 +- .../Model/Sales/Order/Pdf/Items/Abstract.php | 2 +- .../mysql4-data-upgrade-0.1.13-0.1.14.php | 4 +- .../core/Mage/Catalog/Block/Widget/Link.php | 6 +- .../Catalog/Helper/Category/Url/Rewrite.php | 4 +- app/code/core/Mage/Catalog/Helper/Data.php | 2 +- app/code/core/Mage/Catalog/Helper/Product.php | 2 +- .../core/Mage/Catalog/Model/Category/Api.php | 4 +- .../Category/Attribute/Backend/Sortby.php | 2 +- .../Catalog/Model/Convert/Adapter/Product.php | 2 +- app/code/core/Mage/Catalog/Model/Design.php | 2 +- app/code/core/Mage/Catalog/Model/Product.php | 2 +- .../Model/Product/Attribute/Backend/Media.php | 16 +- .../core/Mage/Catalog/Model/Product/Image.php | 4 +- .../Model/Product/Option/Type/File.php | 6 +- .../Catalog/Model/Product/Type/Abstract.php | 2 +- .../Mage/Catalog/Model/Resource/Category.php | 6 +- .../Catalog/Model/Resource/Category/Flat.php | 6 +- .../Resource/Category/Indexer/Product.php | 16 +- .../Model/Resource/Collection/Abstract.php | 2 +- .../Model/Resource/Layer/Filter/Decimal.php | 2 +- .../Model/Resource/Product/Collection.php | 2 +- .../Model/Resource/Product/Flat/Indexer.php | 2 +- .../Product/Indexer/Price/Configurable.php | 4 +- .../Product/Indexer/Price/Default.php | 14 +- .../data-upgrade-1.6.0.0.4-1.6.0.0.5.php | 4 +- .../mysql4-upgrade-0.7.13-0.7.14.php | 2 +- .../mysql4-upgrade-0.7.46-0.7.47.php | 4 +- .../mysql4-upgrade-0.7.51-0.7.52.php | 2 +- .../core/Mage/CatalogIndex/Model/Indexer.php | 4 +- .../Model/Resource/Aggregation.php | 2 +- .../Model/Resource/Data/Abstract.php | 8 +- .../CatalogIndex/Model/Resource/Indexer.php | 10 +- .../CatalogIndex/Model/Resource/Price.php | 6 +- .../Model/Action/Index/Refresh.php | 4 +- .../mysql4-upgrade-0.7.1-0.7.2.php | 6 +- .../CatalogSearch/Block/Advanced/Form.php | 2 +- .../CatalogSearch/Model/Resource/Fulltext.php | 2 +- .../Model/Resource/Helper/Mysql4.php | 6 +- .../core/Mage/Centinel/Model/Api/Client.php | 4 +- .../core/Mage/Checkout/Model/Api/Resource.php | 2 +- .../Checkout/Model/Api/Resource/Product.php | 2 +- .../core/Mage/Checkout/Model/Cart/Api.php | 10 +- .../Mage/Checkout/Model/Cart/Coupon/Api.php | 2 +- .../Mage/Checkout/Model/Cart/Customer/Api.php | 4 +- .../Mage/Checkout/Model/Cart/Payment/Api.php | 4 +- .../Mage/Checkout/Model/Cart/Product/Api.php | 44 ++--- .../Mage/Checkout/Model/Cart/Shipping/Api.php | 6 +- .../controllers/OnepageController.php | 2 +- .../data/cms_setup/data-install-1.6.0.0.php | 144 +++++++-------- .../data-upgrade-1.6.0.0.0-1.6.0.0.1.php | 2 +- .../data-upgrade-1.6.0.0.1-1.6.0.0.2.php | 8 +- .../Helper/Productimg.php | 4 +- app/code/core/Mage/Core/Helper/Data.php | 2 +- app/code/core/Mage/Core/Helper/Http.php | 4 +- app/code/core/Mage/Core/Helper/Js.php | 2 +- app/code/core/Mage/Core/Helper/String.php | 2 +- app/code/core/Mage/Core/Helper/Translate.php | 2 +- app/code/core/Mage/Core/Model/App.php | 2 +- app/code/core/Mage/Core/Model/Config.php | 2 +- app/code/core/Mage/Core/Model/Email/Queue.php | 2 +- .../core/Mage/Core/Model/Email/Template.php | 2 +- .../Core/Model/Email/Template/Abstract.php | 14 +- .../core/Mage/Core/Model/File/Uploader.php | 2 +- .../Mage/Core/Model/File/Validator/Image.php | 2 +- .../core/Mage/Core/Model/Input/Filter.php | 2 +- app/code/core/Mage/Core/Model/Layout.php | 2 +- .../core/Mage/Core/Model/Layout/Validator.php | 4 +- app/code/core/Mage/Core/Model/Locale.php | 2 +- .../Model/Resource/Url/Rewrite/Collection.php | 2 +- app/code/core/Mage/Core/Model/Url.php | 2 +- app/code/core/Mage/Core/functions.php | 34 ++-- .../mysql4-upgrade-0.8.14-0.8.15.php | 2 +- .../mysql4-upgrade-0.8.15-0.8.16.php | 2 +- .../mysql4-upgrade-0.8.16-0.8.17.php | 2 +- app/code/core/Mage/Cron/Model/Schedule.php | 4 +- .../Block/Account/Dashboard/Sidebar.php | 2 +- .../Model/Convert/Adapter/Customer.php | 2 +- .../Model/Convert/Parser/Customer.php | 10 +- .../Model/Resource/Group/Collection.php | 2 +- .../controllers/AccountController.php | 6 +- .../Model/Convert/Container/Abstract.php | 8 +- .../Dataflow/Model/Convert/Parser/Csv.php | 4 +- .../Model/Convert/Profile/Abstract.php | 2 +- .../Model/Convert/Validator/Dryrun.php | 2 +- .../Mage/Dataflow/Model/Mysql4/Catalogold.php | 4 +- app/code/core/Mage/Dataflow/Model/Profile.php | 8 +- .../core/Mage/Directory/Model/Country.php | 8 +- .../core/Mage/Directory/Model/Currency.php | 2 +- .../Mage/Directory/Model/Currency/Filter.php | 2 +- .../Model/Resource/Country/Collection.php | 6 +- .../Model/Resource/Currency/Collection.php | 4 +- .../Model/Resource/Region/Collection.php | 2 +- .../Model/Resource/Indexer/Price.php | 2 +- .../Adminhtml/Downloadable/FileController.php | 4 +- .../controllers/DownloadController.php | 4 +- .../Eav/Model/Attribute/Data/Multiline.php | 4 +- app/code/core/Mage/Eav/Model/Config.php | 2 +- .../Mage/Eav/Model/Convert/Adapter/Entity.php | 4 +- .../Eav/Model/Entity/Attribute/Abstract.php | 2 +- .../Entity/Attribute/Backend/Abstract.php | 2 +- .../Eav/Model/Resource/Entity/Attribute.php | 14 +- .../Model/Resource/Entity/Attribute/Group.php | 2 +- .../Resource/Entity/Attribute/Option.php | 10 +- .../mysql4-upgrade-0.7.10-0.7.11.php | 2 +- .../eav_setup/mysql4-upgrade-0.7.7-0.7.8.php | 2 +- .../eav_setup/mysql4-upgrade-0.7.9-0.7.10.php | 2 +- app/code/core/Mage/GiftMessage/Model/Api.php | 10 +- .../core/Mage/GoogleAnalytics/Block/Ga.php | 6 +- .../core/Mage/GoogleAnalytics/Helper/Data.php | 2 +- .../ImportExport/Model/Export/Adapter/Csv.php | 2 +- .../core/Mage/ImportExport/Model/Import.php | 2 +- .../Model/Import/Adapter/Abstract.php | 2 +- .../Model/Import/Entity/Abstract.php | 4 +- .../Index/Model/Resource/Helper/Mysql4.php | 6 +- app/code/core/Mage/Install/Model/Observer.php | 4 +- app/code/core/Mage/Log/Model/Aggregation.php | 2 +- .../Model/Resource/Problem/Collection.php | 2 +- .../Model/Resource/Subscriber/Collection.php | 4 +- .../mysql4-upgrade-0.8.1-0.8.2.php | 2 +- .../mysql4-upgrade-0.8.2-0.8.3.php | 12 +- .../Block/Adminhtml/Oauth/Consumer/Edit.php | 2 +- app/code/core/Mage/Page/Block/Html/Head.php | 10 +- app/code/core/Mage/Payment/Block/Form/Cc.php | 2 +- app/code/core/Mage/Payment/Model/Config.php | 2 +- app/code/core/Mage/Paypal/Model/Config.php | 8 +- app/code/core/Mage/Paypal/Model/Hostedpro.php | 4 +- .../Mage/Paypal/Model/Payflow/Request.php | 2 +- .../Mage/Paypal/Model/Report/Settlement.php | 10 +- .../Payment/Transaction/Collection.php | 2 +- .../System/Config/Source/FetchingSchedule.php | 14 +- .../Mage/Rating/Model/Resource/Rating.php | 2 +- .../Rating/Option/Vote/Collection.php | 4 +- app/code/core/Mage/Reports/Helper/Data.php | 4 +- .../Model/Resource/Customer/Collection.php | 12 +- .../Entity/Summary/Collection/Abstract.php | 8 +- .../Model/Resource/Invoiced/Collection.php | 2 +- .../Model/Resource/Order/Collection.php | 2 +- .../Model/Resource/Product/Collection.php | 8 +- .../Model/Resource/Quote/Collection.php | 4 +- .../Model/Resource/Report/Abstract.php | 4 +- .../Model/Resource/Review/Collection.php | 2 +- .../Resource/Review/Product/Collection.php | 2 +- .../Resource/Tag/Customer/Collection.php | 2 +- .../Reports/Model/Resource/Tax/Collection.php | 2 +- .../Resource/Wishlist/Product/Collection.php | 2 +- app/code/core/Mage/Reports/Model/Test.php | 12 +- app/code/core/Mage/Reports/Model/Totals.php | 2 +- .../Mage/Review/Model/Resource/Review.php | 6 +- .../core/Mage/Rule/Model/Action/Abstract.php | 10 +- .../Mage/Rule/Model/Action/Collection.php | 2 +- .../Mage/Rule/Model/Condition/Combine.php | 8 +- .../Sales/Block/Order/Email/Items/Default.php | 2 +- .../Block/Order/Email/Items/Order/Default.php | 2 +- app/code/core/Mage/Sales/Model/Observer.php | 2 +- app/code/core/Mage/Sales/Model/Order/Api.php | 10 +- .../core/Mage/Sales/Model/Order/Config.php | 2 +- .../Mage/Sales/Model/Order/Invoice/Item.php | 4 +- .../Mage/Sales/Model/Order/Pdf/Abstract.php | 6 +- .../Sales/Model/Order/Pdf/Items/Abstract.php | 2 +- .../Mage/Sales/Model/Recurring/Profile.php | 2 +- .../core/Mage/Sales/Model/Resource/Order.php | 2 +- .../Model/Resource/Order/Item/Collection.php | 2 +- .../mysql4-upgrade-0.8.13-0.8.14.php | 2 +- .../mysql4-upgrade-0.9.46-0.9.47.php | 2 +- .../Model/Rule/Condition/Product/Found.php | 2 +- .../Rule/Condition/Product/Subselect.php | 2 +- .../mysql4-upgrade-0.7.4-0.7.5.php | 2 +- .../Model/Resource/Carrier/Tablerate.php | 4 +- .../Mage/Tag/Model/Resource/Tag/Relation.php | 2 +- app/code/core/Mage/Tax/Helper/Data.php | 2 +- .../Mage/Tax/Model/Resource/Calculation.php | 6 +- .../tax_setup/mysql4-upgrade-0.7.4-0.7.5.php | 2 +- .../tax_setup/mysql4-upgrade-0.7.7-0.7.8.php | 2 +- .../tax_setup/mysql4-upgrade-0.7.9-0.7.10.php | 6 +- .../Mage/Uploader/Model/Config/Abstract.php | 2 +- .../Mage/Usa/Model/Shipping/Carrier/Dhl.php | 2 +- .../Shipping/Carrier/Dhl/International.php | 16 +- .../Carrier/Dhl/Label/Pdf/PageBuilder.php | 16 +- .../Mage/Usa/Model/Shipping/Carrier/Fedex.php | 4 +- .../Mage/Usa/Model/Shipping/Carrier/Ups.php | 172 +++++++++--------- .../Usa/Model/Shipping/Carrier/UpsAuth.php | 4 +- .../Mage/Weee/Block/Renderer/Weee/Tax.php | 2 +- .../weee_setup/mysql4-upgrade-0.11-0.12.php | 2 +- .../sql/weee_setup/mysql4-upgrade-0.2-0.3.php | 2 +- app/code/core/Mage/Widget/Model/Widget.php | 2 +- .../Wishlist/controllers/IndexController.php | 2 +- lib/Mage/Archive/Helper/File.php | 2 +- lib/Mage/Archive/Tar.php | 18 +- lib/Mage/DB/Mysqli.php | 30 +-- lib/Mage/HTTP/Client.php | 12 +- lib/Mage/HTTP/Client/Curl.php | 16 +- lib/Mage/HTTP/Client/Socket.php | 30 +-- lib/Mage/System/Ftp.php | 44 ++--- lib/Magento/Db/Sql/Trigger.php | 6 +- lib/Varien/Cache/Backend/Memcached.php | 2 +- lib/Varien/Cache/Core.php | 2 +- lib/Varien/Convert/Container/Abstract.php | 6 +- lib/Varien/Convert/Parser/Xml/Excel.php | 4 +- lib/Varien/Convert/Profile/Abstract.php | 2 +- lib/Varien/Data/Collection/Db.php | 2 +- lib/Varien/Data/Form/Element/Editor.php | 4 +- lib/Varien/Data/Form/Element/Textarea.php | 2 +- lib/Varien/Db/Adapter/Pdo/Mysql.php | 72 ++++---- lib/Varien/Debug.php | 4 +- lib/Varien/Directory/Collection.php | 2 +- lib/Varien/Directory/Factory.php | 4 +- lib/Varien/File/Object.php | 6 +- lib/Varien/File/Transfer/Adapter/Http.php | 2 +- lib/Varien/File/Uploader/Image.php | 18 +- lib/Varien/Filter/Template.php | 4 +- lib/Varien/Image/Adapter/Gd2.php | 8 +- lib/Varien/Io/Abstract.php | 10 +- lib/Varien/Io/File.php | 8 +- lib/Varien/Io/Sftp.php | 2 +- lib/Varien/Object.php | 4 +- lib/Varien/Profiler.php | 10 +- lib/Varien/Simplexml/Config.php | 2 +- lib/Varien/Simplexml/Element.php | 4 +- shell/indexer.php | 2 +- 323 files changed, 937 insertions(+), 933 deletions(-) diff --git a/.github/workflows/labeler.yml b/.github/workflows/labeler.yml index d0f7a216412..ccf6efe4e53 100644 --- a/.github/workflows/labeler.yml +++ b/.github/workflows/labeler.yml @@ -8,6 +8,8 @@ name: Labeler on: pull_request_target: + # Allow manually triggering the workflow. + workflow_dispatch: jobs: triage: diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index fb06ee5555f..e5c4f7cfcde 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -83,6 +83,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. diff --git a/app/code/core/Mage/Admin/Model/Config.php b/app/code/core/Mage/Admin/Model/Config.php index e2a4e17b0f7..cb7aa5c3816 100644 --- a/app/code/core/Mage/Admin/Model/Config.php +++ b/app/code/core/Mage/Admin/Model/Config.php @@ -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(); @@ -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; } @@ -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; } diff --git a/app/code/core/Mage/Admin/Model/Observer.php b/app/code/core/Mage/Admin/Model/Observer.php index 918ba07c1e2..e945acc6c94 100644 --- a/app/code/core/Mage/Admin/Model/Observer.php +++ b/app/code/core/Mage/Admin/Model/Observer.php @@ -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'] ?? ''; diff --git a/app/code/core/Mage/Admin/Model/Resource/Acl.php b/app/code/core/Mage/Admin/Model/Resource/Acl.php index f7ad5dd0a16..b07083b4c70 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Acl.php +++ b/app/code/core/Mage/Admin/Model/Resource/Acl.php @@ -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 clicking here.', implode(', ', $orphanedResources), - Mage::helper("adminhtml")->getUrl('adminhtml/permissions_orphanedResource') + Mage::helper('adminhtml')->getUrl('adminhtml/permissions_orphanedResource') ) ); } diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php index 0c50262abd5..dad38cc5c52 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles/Collection.php @@ -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; } diff --git a/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php b/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php index c5d3c102903..74c531cca25 100644 --- a/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php +++ b/app/code/core/Mage/Admin/Model/Resource/Roles/User/Collection.php @@ -33,7 +33,7 @@ protected function _initSelect() { parent::_initSelect(); - $this->getSelect()->where("user_id > 0"); + $this->getSelect()->where('user_id > 0'); return $this; } diff --git a/app/code/core/Mage/Admin/Model/Roles.php b/app/code/core/Mage/Admin/Model/Roles.php index 9ecda32e68d..ab3d1b57387 100644 --- a/app/code/core/Mage/Admin/Model/Roles.php +++ b/app/code/core/Mage/Admin/Model/Roles.php @@ -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)) { diff --git a/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php b/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php index 214c224a287..bae52aea26f 100644 --- a/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php +++ b/app/code/core/Mage/Admin/sql/admin_setup/upgrade-1.6.1.1-1.6.1.2.php @@ -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, @@ -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, diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php index 91a146b3c10..a86d17128c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Editroles.php @@ -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', [ diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php index 9399e10b178..bb072483a89 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Grid/Role.php @@ -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(); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php index 22546bb20bd..804d2273e2f 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Role/Grid/User.php @@ -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'); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php index 9c947400215..44ba406e84b 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Rolesusers.php @@ -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); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php index d3abcab2e81..3d6d06704db 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/Tab/Userroles.php @@ -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(); diff --git a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php index e0b684d12ff..eefad54c8d3 100644 --- a/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Api/User/Edit/Tab/Roles.php @@ -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(); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php index 94ce3400af7..8f0d533dc8c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Abstract.php @@ -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]); } /** diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php index 7c8f8f979c1..72e1fc4a4c8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Pricestep.php @@ -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);"; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php index 5b18263637c..bae54abe7ce 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Available.php @@ -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);"; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php index 62ad2eb35ab..91591cc65a4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Helper/Sortby/Default.php @@ -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);"; } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php index 503a2ed4107..e2d48b66b04 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Category/Tree.php @@ -33,7 +33,7 @@ public function __construct() protected function _prepareLayout() { - $addUrl = $this->getUrl("*/*/add", [ + $addUrl = $this->getUrl('*/*/add', [ '_current' => true, 'id' => null, '_query' => false @@ -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] ); } diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php index e72ab3107ee..1c38afcf7cb 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Attribute/Edit/Tab/Main.php @@ -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' => [ @@ -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, @@ -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')); diff --git a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php index 4f865355dc8..dd9369974ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php +++ b/app/code/core/Mage/Adminhtml/Block/Catalog/Product/Helper/Form/Gallery.php @@ -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); diff --git a/app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php b/app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php index 3787ccd3f98..d4c668fee43 100644 --- a/app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php +++ b/app/code/core/Mage/Adminhtml/Block/Checkout/Formkey.php @@ -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'); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php index 700d3b3b17d..5f3870eb050 100644 --- a/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php +++ b/app/code/core/Mage/Adminhtml/Block/Dashboard/Graph.php @@ -253,10 +253,10 @@ public function getChartUrl($directUrl = true) $this->_allSeries = $datas; // Image-Charts Awesome data format values - $params['chd'] = "a:"; - $dataDelimiter = ","; - $dataSetdelimiter = "|"; - $dataMissing = "_"; + $params['chd'] = 'a:'; + $dataDelimiter = ','; + $dataSetdelimiter = '|'; + $dataMissing = '_'; // process each string in the array, and find the max length foreach ($this->getAllSeries() as $index => $serie) { @@ -321,9 +321,9 @@ public function getChartUrl($directUrl = true) $params['chd'] .= $buffer; - $labelBuffer = ""; + $labelBuffer = ''; $valueBuffer = []; - $rangeBuffer = ""; + $rangeBuffer = ''; if (count($this->_axisLabels)) { $params['chxt'] = implode(',', array_keys($this->_axisLabels)); @@ -353,7 +353,7 @@ public function getChartUrl($directUrl = true) case '2y': $formats = Mage::app()->getLocale()->getTranslationList('datetime'); $format = $formats['yyMM'] ?? 'MM/yyyy'; - $format = str_replace(["yyyy", "yy", "MM"], ["Y", "y", "m"], $format); + $format = str_replace(['yyyy', 'yy', 'MM'], ['Y', 'y', 'm'], $format); $this->_axisLabels[$idx][$_index] = date($format, strtotime($_label)); break; } @@ -364,21 +364,21 @@ public function getChartUrl($directUrl = true) $tmpstring = implode('|', $this->_axisLabels[$idx]); - $valueBuffer[] = $indexid . ":|" . $tmpstring; + $valueBuffer[] = $indexid . ':|' . $tmpstring; if (count($this->_axisLabels[$idx]) > 1) { $deltaX = 100 / (count($this->_axisLabels[$idx]) - 1); } else { $deltaX = 100; } } elseif ($idx === 'y') { - $valueBuffer[] = $indexid . ":|" . implode('|', $yLabels); + $valueBuffer[] = $indexid . ':|' . implode('|', $yLabels); if (count($yLabels) - 1) { $deltaY = 100 / (count($yLabels) - 1); } else { $deltaY = 100; } // setting range values for y axis - $rangeBuffer = $indexid . "," . $miny . "," . $maxy . "|"; + $rangeBuffer = $indexid . ',' . $miny . ',' . $maxy . '|'; } $indexid++; } diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php index dabca1b8a51..17a2eceda81 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Queue/Preview.php @@ -49,7 +49,7 @@ protected function _toHtml() $storeId = Mage::app()->getAnyStoreView()->getId(); } - Varien_Profiler::start("newsletter_queue_proccessing"); + Varien_Profiler::start('newsletter_queue_proccessing'); $vars = []; $vars['subscriber'] = Mage::getModel('newsletter/subscriber'); @@ -59,13 +59,13 @@ protected function _toHtml() $template->revertDesign(); if ($template->isPlain()) { - $templateProcessed = "
" . htmlspecialchars($templateProcessed) . "
"; + $templateProcessed = '
' . htmlspecialchars($templateProcessed) . '
'; } $templateProcessed = Mage::getSingleton('core/input_filter_maliciousCode') ->linkFilter($templateProcessed); - Varien_Profiler::stop("newsletter_queue_proccessing"); + Varien_Profiler::stop('newsletter_queue_proccessing'); return $templateProcessed; } diff --git a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php index b66245e6cfa..673121247bd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/Newsletter/Template/Preview.php @@ -45,7 +45,7 @@ protected function _toHtml() $storeId = Mage::app()->getAnyStoreView()->getId(); } - Varien_Profiler::start("newsletter_template_proccessing"); + Varien_Profiler::start('newsletter_template_proccessing'); $vars = []; $vars['subscriber'] = Mage::getModel('newsletter/subscriber'); @@ -58,13 +58,13 @@ protected function _toHtml() $template->revertDesign(); if ($template->isPlain()) { - $templateProcessed = "
" . htmlspecialchars($templateProcessed) . "
"; + $templateProcessed = '
' . htmlspecialchars($templateProcessed) . '
'; } $templateProcessed = Mage::getSingleton('core/input_filter_maliciousCode') ->linkFilter($templateProcessed); - Varien_Profiler::stop("newsletter_template_proccessing"); + Varien_Profiler::stop('newsletter_template_proccessing'); return $templateProcessed; } diff --git a/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php b/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php index 0f95b91ce96..e6fe15454c1 100644 --- a/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php +++ b/app/code/core/Mage/Adminhtml/Block/Notification/Curl.php @@ -63,7 +63,7 @@ protected function _canShow() public function getMessage() { return $this->helper('adminhtml')->__( - "Your current version of cURL php5 module is %s, which can prevent services that require TLS v1.2 from working correctly. It is recommended to update your cURL php5 module to version %s or higher.", + 'Your current version of cURL php5 module is %s, which can prevent services that require TLS v1.2 from working correctly. It is recommended to update your cURL php5 module to version %s or higher.', $this->_curlVersion['version'], $this::REQUIRED_CURL_VERSION ); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php index 0387623ca76..9ade3099fb6 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/Role.php @@ -33,7 +33,7 @@ public function __construct() protected function _prepareCollection() { - $collection = Mage::getModel("admin/roles")->getCollection(); + $collection = Mage::getModel('admin/roles')->getCollection(); $this->setCollection($collection); return parent::_prepareCollection(); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php index 6b92fe40e47..6d1fcc5e819 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Grid/User.php @@ -32,7 +32,7 @@ public function __construct() protected function _prepareCollection() { - $collection = Mage::getModel("permissions/users")->getCollection(); + $collection = Mage::getModel('permissions/users')->getCollection(); $this->setCollection($collection); return parent::_prepareCollection(); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php index 197df5b29af..1794f7abfbd 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Role/Grid/User.php @@ -141,7 +141,7 @@ public function getGridUrl() protected function _getUsers($json = false) { - if ($this->getRequest()->getParam('in_role_user') != "") { + if ($this->getRequest()->getParam('in_role_user') != '') { return $this->getRequest()->getParam('in_role_user'); } $roleId = ($this->getRequest()->getParam('rid') > 0) ? $this->getRequest()->getParam('rid') : Mage::registry('RID'); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php index 21d6c748f7a..53a164d42a4 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Rolesusers.php @@ -25,7 +25,7 @@ public function __construct() $roleId = $this->getRequest()->getParam('rid', false); - $users = Mage::getModel("admin/user")->getCollection()->load(); + $users = Mage::getModel('admin/user')->getCollection()->load(); $this->setTemplate('permissions/rolesusers.phtml') ->assign('users', $users->getItems()) ->assign('roleId', $roleId); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php index 65af2a7cd76..4b04f26b5ad 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Tab/Userroles.php @@ -25,11 +25,11 @@ public function __construct() $uid = $this->getRequest()->getParam('id', false); $uid = !empty($uid) ? $uid : 0; - $roles = Mage::getModel("admin/roles") + $roles = Mage::getModel('admin/roles') ->getCollection() ->load(); - $user_roles = Mage::getModel("admin/roles") + $user_roles = Mage::getModel('admin/roles') ->getUsersCollection() ->setUserFilter($uid) ->load(); diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php index bb05bfb8292..2a6be3175d2 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/User/Edit/Tab/Roles.php @@ -92,7 +92,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'); } /** @var Mage_Admin_Model_User $user */ diff --git a/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php b/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php index e2c91d0a256..581de16e558 100644 --- a/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php +++ b/app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php @@ -22,8 +22,8 @@ class Mage_Adminhtml_Block_Permissions_UsernRoles extends Mage_Adminhtml_Block_T public function __construct() { parent::__construct(); - $userCollection = Mage::getModel("permissions/users")->getCollection()->load(); - $rolesCollection = Mage::getModel("permissions/roles")->getCollection()->load(); + $userCollection = Mage::getModel('permissions/users')->getCollection()->load(); + $rolesCollection = Mage::getModel('permissions/roles')->getCollection()->load(); $this->setTemplate('permissions/usernroles.phtml') ->assign('users', $userCollection) diff --git a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php index 87dadb63cc0..656ee9a8040 100644 --- a/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Rating/Edit.php @@ -44,7 +44,7 @@ public function __construct() public function getHeaderText() { if (Mage::registry('rating_data') && Mage::registry('rating_data')->getId()) { - return Mage::helper('rating')->__("Edit Rating", $this->escapeHtml(Mage::registry('rating_data')->getRatingCode())); + return Mage::helper('rating')->__('Edit Rating', $this->escapeHtml(Mage::registry('rating_data')->getRatingCode())); } return Mage::helper('rating')->__('New Rating'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php index bf9b64a0ea6..92c8643a11a 100644 --- a/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/Report/Grid/Column/Renderer/Currency.php @@ -37,7 +37,7 @@ public function render(Varien_Object $row) } $data = (float) $data * $this->_getRate($row); - $data = sprintf("%F", $data); + $data = sprintf('%F', $data); $data = Mage::app()->getLocale()->currency($currency_code)->toCurrency($data); return $data; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php index e4ede5c8026..2a834b56878 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create.php @@ -36,7 +36,7 @@ public function __construct() $storeId = $this->_getSession()->getStoreId(); $this->_updateButton('save', 'label', Mage::helper('sales')->__('Submit Order')); - $this->_updateButton('save', 'onclick', "order.submit()"); + $this->_updateButton('save', 'onclick', 'order.submit()'); $this->_updateButton('save', 'id', 'submit_order_top_button'); if (is_null($customerId) || !$storeId) { $this->_updateButton('save', 'style', 'display:none'); diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php index 11297222419..31340158816 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php @@ -458,7 +458,7 @@ public function isMoveToWishlistAllowed($item) */ public function getCustomerWishlists() { - return Mage::getModel("wishlist/wishlist")->getCollection() + return Mage::getModel('wishlist/wishlist')->getCollection() ->filterByCustomerId($this->getCustomerId()); } } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php index 1ebb1a7e1c3..02d063b64aa 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Order/View/Tab/History.php @@ -116,7 +116,7 @@ public function getFullHistory() ); } - usort($history, [__CLASS__, "_sortHistoryByTimestamp"]); + usort($history, [__CLASS__, '_sortHistoryByTimestamp']); return $history; } diff --git a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php index 76582ddff10..c0b83ee96ac 100644 --- a/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php +++ b/app/code/core/Mage/Adminhtml/Block/Sales/Transactions/Detail.php @@ -64,7 +64,7 @@ public function __construct() public function getHeaderText() { return Mage::helper('sales')->__( - "Transaction # %s | %s", + 'Transaction # %s | %s', $this->_txn->getTxnId(), $this->formatDate( $this->_txn->getCreatedAt(), diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php index 4f61ac0d4cc..961c4b2fc41 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Form/Field/Export.php @@ -34,7 +34,7 @@ public function getElementHtml() $data = [ 'label' => Mage::helper('adminhtml')->__('Export CSV'), - 'onclick' => 'setLocation(\'' . Mage::helper('adminhtml')->getUrl("*/*/exportTablerates", $params) . 'conditionName/\' + $(\'carriers_tablerate_condition_name\').value + \'/tablerates.csv\' )', + 'onclick' => 'setLocation(\'' . Mage::helper('adminhtml')->getUrl('*/*/exportTablerates', $params) . 'conditionName/\' + $(\'carriers_tablerate_condition_name\').value + \'/tablerates.csv\' )', 'class' => '', ]; diff --git a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php index 861de52c603..3871b4a9a5f 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Config/Tabs.php @@ -302,7 +302,7 @@ public function checkSectionPermissions($code = null) { static $permissions; - if (!$code || trim($code) == "") { + if (!$code || trim($code) == '') { return false; } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php index 40c2a54fd93..13abc90c8a0 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Gui/Edit/Tab/Wizard.php @@ -128,7 +128,7 @@ public function getAddMapButtonHtml() if (!$this->_addMapButtonHtml) { $this->_addMapButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button') ->setClass('add')->setLabel($this->__('Add Field Mapping')) - ->setOnClick("addFieldMapping()")->toHtml(); + ->setOnClick('addFieldMapping()')->toHtml(); } return $this->_addMapButtonHtml; } @@ -141,7 +141,7 @@ public function getRemoveMapButtonHtml() if (!$this->_removeMapButtonHtml) { $this->_removeMapButtonHtml = $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button') ->setClass('delete')->setLabel($this->__('Remove')) - ->setOnClick("removeFieldMapping(this)")->toHtml(); + ->setOnClick('removeFieldMapping(this)')->toHtml(); } return $this->_removeMapButtonHtml; } diff --git a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php index 9bc83a880e2..0311bc9c720 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Convert/Profile/Run.php @@ -177,10 +177,10 @@ public function getExceptions() break; } $exceptions[] = [ - "style" => $liStyle, - "src" => Mage::getDesign()->getSkinUrl('images/' . $img), - "message" => $e->getMessage(), - "position" => $e->getPosition() + 'style' => $liStyle, + 'src' => Mage::getDesign()->getSkinUrl('images/' . $img), + 'message' => $e->getMessage(), + 'position' => $e->getPosition() ]; } parent::setExceptions($exceptions); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php index ee8319388f5..b0786525b35 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Email/Template/Preview.php @@ -54,16 +54,16 @@ protected function _toHtml() $this->maliciousCodeFilter($template->getTemplateText()) ); - Varien_Profiler::start("email_template_proccessing"); + Varien_Profiler::start('email_template_proccessing'); $vars = []; $templateProcessed = $template->getProcessedTemplate($vars, true); if ($template->isPlain()) { - $templateProcessed = "
" . htmlspecialchars($templateProcessed) . "
"; + $templateProcessed = '
' . htmlspecialchars($templateProcessed) . '
'; } - Varien_Profiler::stop("email_template_proccessing"); + Varien_Profiler::stop('email_template_proccessing'); // Stop store emulation process $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php index bec54cff8b8..addf1580d4a 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Group.php @@ -36,7 +36,7 @@ protected function _prepareLayout() $this->getLayout()->createBlock('adminhtml/widget_button') ->setData([ 'label' => Mage::helper('core')->__('Delete Store'), - 'onclick' => "deleteForm.submit()", + 'onclick' => 'deleteForm.submit()', 'class' => 'cancel' ]) ); diff --git a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php index bffd0edfc58..115a5e50cae 100644 --- a/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php +++ b/app/code/core/Mage/Adminhtml/Block/System/Store/Delete/Website.php @@ -36,7 +36,7 @@ protected function _prepareLayout() $this->getLayout()->createBlock('adminhtml/widget_button') ->setData([ 'label' => Mage::helper('core')->__('Delete Website'), - 'onclick' => "deleteForm.submit()", + 'onclick' => 'deleteForm.submit()', 'class' => 'cancel' ]) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php index 47453d99d7b..2086b80027c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php +++ b/app/code/core/Mage/Adminhtml/Block/Tax/Rule/Edit.php @@ -48,7 +48,7 @@ public function __construct() public function getHeaderText() { if (Mage::registry('tax_rule')->getId()) { - return Mage::helper('tax')->__("Edit Rule"); + return Mage::helper('tax')->__('Edit Rule'); } return Mage::helper('tax')->__('New Rule'); } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php index 25da4427d28..90ac04bed96 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Form/Element/Gallery.php @@ -57,7 +57,7 @@ protected function _prepareLayout() $this->getLayout()->createBlock('adminhtml/widget_button') ->setData([ 'label' => Mage::helper('adminhtml')->__('Delete'), - 'onclick' => "deleteImage(#image#)", + 'onclick' => 'deleteImage(#image#)', 'class' => 'delete' ]) ); diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index af36a237924..b08285cf842 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -1134,7 +1134,7 @@ protected function _exportCsvItem(Varien_Object $item, Varien_Io_File $adapter) } $adapter->streamWriteCsv( - Mage::helper("core")->getEscapedCSVData($row) + Mage::helper('core')->getEscapedCSVData($row) ); } @@ -1167,7 +1167,7 @@ public function getCsvFile() if ($this->getCountTotals()) { $io->streamWriteCsv( - Mage::helper("core")->getEscapedCSVData($this->_getExportTotals()) + Mage::helper('core')->getEscapedCSVData($this->_getExportTotals()) ); } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php index b9d7f43aa0a..0c747a9defc 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Checkbox.php @@ -64,7 +64,7 @@ public function render(Varien_Object $row) if ($this->getNoObjectId() || $this->getColumn()->getUseIndex()) { $v = $value; } else { - $v = ($row->getId() != "") ? $row->getId() : $value; + $v = ($row->getId() != '') ? $row->getId() : $value; } return $this->_getCheckboxHtml($v, $checked); diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php index 86087468142..4e9f5930488 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Currency.php @@ -45,7 +45,7 @@ public function render(Varien_Object $row) $data = (float) $data * $this->_getRate($row); $sign = (bool)(int)$this->getColumn()->getShowNumberSign() && ($data > 0) ? '+' : ''; - $data = sprintf("%F", $data); + $data = sprintf('%F', $data); $data = Mage::app()->getLocale()->currency($currency_code)->toCurrency($data); return $sign . $data; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php index 8647483d4a0..a09ace5bfd8 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Price.php @@ -43,7 +43,7 @@ public function render(Varien_Object $row) } $data = (float) $data * $this->_getRate($row); - $data = sprintf("%F", $data); + $data = sprintf('%F', $data); $data = Mage::app()->getLocale()->currency($currency_code)->toCurrency($data); return $data; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php index 281c859e4e6..ca9a0b653f5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Renderer/Wrapline.php @@ -42,7 +42,7 @@ public function render(Varien_Object $row) ? $this->getColumn()->getData('lineLength') : $this->_defaultMaxLineLength; for ($i = 0, $n = floor(Mage::helper('core/string')->strlen($line) / $lineLength); $i <= $n; $i++) { - $wrappedLine .= Mage::helper('core/string')->substr($line, ($lineLength * $i), $lineLength) . "
"; + $wrappedLine .= Mage::helper('core/string')->substr($line, ($lineLength * $i), $lineLength) . '
'; } return $wrappedLine; } diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php index 886f76e971d..a7abf519cb5 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid/Massaction/Abstract.php @@ -252,7 +252,7 @@ public function getSelected() */ public function getApplyButtonHtml() { - return $this->getButtonHtml($this->__('Submit'), $this->getJsObjectName() . ".apply()"); + return $this->getButtonHtml($this->__('Submit'), $this->getJsObjectName() . '.apply()'); } /** @@ -282,7 +282,7 @@ public function getGridIdsJson() $gridIds = $this->getParentBlock()->getCollection()->getAllIds(); if (!empty($gridIds)) { - return implode(",", $gridIds); + return implode(',', $gridIds); } return ''; } diff --git a/app/code/core/Mage/Adminhtml/Controller/Action.php b/app/code/core/Mage/Adminhtml/Controller/Action.php index ec3fd52958d..4f1d37c8640 100644 --- a/app/code/core/Mage/Adminhtml/Controller/Action.php +++ b/app/code/core/Mage/Adminhtml/Controller/Action.php @@ -152,9 +152,9 @@ public function preDispatch() { // get legacy theme choice form backend config if (Mage::getStoreConfigFlag('admin/design/use_legacy_theme')) { - $theme = Mage::getConfig()->getNode("stores/admin/design/theme/default"); + $theme = Mage::getConfig()->getNode('stores/admin/design/theme/default'); } else { - $theme = Mage::getConfig()->getNode("stores/admin/design/theme/openmage"); + $theme = Mage::getConfig()->getNode('stores/admin/design/theme/openmage'); } Mage::getDesign() diff --git a/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php b/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php index d5db077f2ce..f22deaaab27 100644 --- a/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php +++ b/app/code/core/Mage/Adminhtml/Model/Customer/Renderer/Region.php @@ -80,7 +80,7 @@ public function render(Varien_Data_Form_Element_Abstract $element) . $element->serialize($htmlAttributes) . '>' . "\n"; foreach ($regionCollection as $region) { $selected = ($regionId == $region['value']) ? ' selected="selected"' : ''; - $value = is_numeric($region['value']) ? (int)$region['value'] : ""; + $value = is_numeric($region['value']) ? (int)$region['value'] : ''; $html .= ''; @@ -101,7 +101,7 @@ public function render(Varien_Data_Form_Element_Abstract $element) $html .= ''; $html .= 'serialize($htmlAttributes) . "/>" . "\n"; + . $element->serialize($htmlAttributes) . '/>' . "\n"; $html .= ''; $html .= '' . "\n"; } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php index 54ee3ea831f..8a127356fd3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Basedon.php @@ -24,7 +24,7 @@ public function toOptionArray() return [ ['value' => 'shipping', 'label' => Mage::helper('adminhtml')->__('Shipping Address')], ['value' => 'billing', 'label' => Mage::helper('adminhtml')->__('Billing Address')], - ['value' => 'origin', 'label' => Mage::helper('adminhtml')->__("Shipping Origin")], + ['value' => 'origin', 'label' => Mage::helper('adminhtml')->__('Shipping Origin')], ]; } } diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php index 4c0be87b86d..785ccd48ce3 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Source/Tax/Catalog.php @@ -24,7 +24,7 @@ public function toOptionArray() return [ ['value' => 0, 'label' => Mage::helper('adminhtml')->__('No (price without tax)')], ['value' => 1, 'label' => Mage::helper('adminhtml')->__('Yes (only price with tax)')], - ['value' => 2, 'label' => Mage::helper('adminhtml')->__("Both (without and with tax)")], + ['value' => 2, 'label' => Mage::helper('adminhtml')->__('Both (without and with tax)')], ]; } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php index ca5b01fa927..75e0d2a2ed7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php @@ -125,13 +125,13 @@ public function deleteAction() } try { - Mage::getModel("api/roles")->load($rid)->delete(); + Mage::getModel('api/roles')->load($rid)->delete(); Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The role has been deleted.')); } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while deleting this role.')); } - $this->_redirect("*/*/"); + $this->_redirect('*/*/'); } public function saveRoleAction() @@ -168,7 +168,7 @@ public function saveRoleAction() $isAll = $this->getRequest()->getParam('all'); if ($isAll) { - $resource = ["all"]; + $resource = ['all']; } try { @@ -178,7 +178,7 @@ public function saveRoleAction() ->setRoleType('G') ->save(); - Mage::getModel("api/rules") + Mage::getModel('api/rules') ->setRoleId($role->getId()) ->setResources($resource) ->saveRel(); @@ -208,7 +208,7 @@ public function editrolegridAction() protected function _deleteUserFromRole($userId, $roleId) { try { - Mage::getModel("api/user") + Mage::getModel('api/user') ->setRoleId($roleId) ->setUserId($userId) ->deleteFromRole(); @@ -220,7 +220,7 @@ protected function _deleteUserFromRole($userId, $roleId) protected function _addUserToRole($userId, $roleId) { - $user = Mage::getModel("api/user")->load($userId); + $user = Mage::getModel('api/user')->load($userId); $user->setRoleId($roleId)->setUserId($userId); if ($user->roleUserExists() === true) { diff --git a/app/code/core/Mage/Adminhtml/controllers/CacheController.php b/app/code/core/Mage/Adminhtml/controllers/CacheController.php index 80d701b0788..407caba728e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/CacheController.php +++ b/app/code/core/Mage/Adminhtml/controllers/CacheController.php @@ -54,7 +54,7 @@ public function flushAllAction() { Mage::app()->getCacheInstance()->flush(); Mage::dispatchEvent('adminhtml_cache_flush_all'); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("The cache storage has been flushed.")); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('The cache storage has been flushed.')); $this->_redirect('*/*'); } @@ -76,7 +76,7 @@ public function flushSystemAction() Mage::getConfig()->releaseCacheSaveLock(); } Mage::dispatchEvent('adminhtml_cache_flush_system'); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("The OpenMage cache has been flushed and updates applied.")); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('The OpenMage cache has been flushed and updates applied.')); $this->_redirect('*/*'); } @@ -97,7 +97,7 @@ public function massEnableAction() } if ($updatedTypes > 0) { Mage::app()->saveUseCache($allTypes); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("%s cache type(s) enabled.", $updatedTypes)); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('%s cache type(s) enabled.', $updatedTypes)); } $this->_redirect('*/*'); } @@ -120,7 +120,7 @@ public function massDisableAction() } if ($updatedTypes > 0) { Mage::app()->saveUseCache($allTypes); - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("%s cache type(s) disabled.", $updatedTypes)); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('%s cache type(s) disabled.', $updatedTypes)); } $this->_redirect('*/*'); } @@ -140,7 +140,7 @@ public function massRefreshAction() } } if ($updatedTypes > 0) { - $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__("%s cache type(s) refreshed.", $updatedTypes)); + $this->_getSession()->addSuccess(Mage::helper('adminhtml')->__('%s cache type(s) refreshed.', $updatedTypes)); } $this->_redirect('*/*'); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php index ad534a4be6c..78bb850604e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/CategoryController.php @@ -320,7 +320,7 @@ public function saveAction() * Proceed with $_POST['use_config'] * set into category model for proccessing through validation */ - $category->setData("use_post_data_config", $this->getRequest()->getPost('use_config')); + $category->setData('use_post_data_config', $this->getRequest()->getPost('use_config')); try { $validate = $category->validate(); @@ -375,7 +375,7 @@ public function moveAction() $category->setData('save_rewrites_history', Mage::helper('catalog')->shouldSaveUrlRewritesHistory()); try { $category->move($parentNodeId, $prevNodeId); - $this->getResponse()->setBody("SUCCESS"); + $this->getResponse()->setBody('SUCCESS'); } catch (Mage_Core_Exception $e) { $this->getResponse()->setBody($e->getMessage()); } catch (Exception $e) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php index 99e5975584f..58c0f9c5ced 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php @@ -56,8 +56,8 @@ public function uploadAction() /** * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS */ - $result['tmp_name'] = str_replace(DS, "/", $result['tmp_name']); - $result['path'] = str_replace(DS, "/", $result['path']); + $result['tmp_name'] = str_replace(DS, '/', $result['tmp_name']); + $result['path'] = str_replace(DS, '/', $result['path']); $result['url'] = Mage::getSingleton('catalog/product_media_config')->getTmpMediaUrl($result['file']); $result['file'] = $result['file'] . '.tmp'; diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php index c5fc49a0e20..6e8df72ded7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php @@ -97,7 +97,7 @@ protected function _initProduct() $productType = $product->getTypeInstance(); if (!$productId || !$productType->getUsedProductAttributeIds()) { $productType->setUsedProductAttributeIds( - explode(",", base64_decode(urldecode($attributes))) + explode(',', base64_decode(urldecode($attributes))) ); } } @@ -106,7 +106,7 @@ protected function _initProduct() if ($this->getRequest()->getParam('popup') && $requiredAttributes = $this->getRequest()->getParam('required') ) { - $requiredAttributes = explode(",", $requiredAttributes); + $requiredAttributes = explode(',', $requiredAttributes); foreach ($product->getAttributes() as $attribute) { if (in_array($attribute->getId(), $requiredAttributes)) { $attribute->setIsRequired(1); diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php index 78d358af8b3..6ba8ede730e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/BlockController.php @@ -168,7 +168,7 @@ public function deleteAction() { // check if we know what should be deleted if ($id = $this->getRequest()->getParam('block_id')) { - $title = ""; + $title = ''; try { // init model and delete $model = Mage::getModel('cms/block'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php index 9924aa89982..7ff8117718a 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/PageController.php @@ -175,7 +175,7 @@ public function deleteAction() { // check if we know what should be deleted if ($id = $this->getRequest()->getParam('page_id')) { - $title = ""; + $title = ''; try { // init model and delete $model = Mage::getModel('cms/page'); diff --git a/app/code/core/Mage/Adminhtml/controllers/IndexController.php b/app/code/core/Mage/Adminhtml/controllers/IndexController.php index 0918021f0f2..555e630f9b7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/IndexController.php +++ b/app/code/core/Mage/Adminhtml/controllers/IndexController.php @@ -89,7 +89,7 @@ public function logoutAction() */ public function globalSearchAction() { - $searchModules = Mage::getConfig()->getNode("adminhtml/global_search"); + $searchModules = Mage::getConfig()->getNode('adminhtml/global_search'); $items = []; if (!Mage::getStoreConfigFlag('admin/global_search/enable') || !Mage::getSingleton('admin/session')->isAllowed('admin/global_search')) { diff --git a/app/code/core/Mage/Adminhtml/controllers/RatingController.php b/app/code/core/Mage/Adminhtml/controllers/RatingController.php index 08a1d5fa62c..64e01257890 100644 --- a/app/code/core/Mage/Adminhtml/controllers/RatingController.php +++ b/app/code/core/Mage/Adminhtml/controllers/RatingController.php @@ -92,7 +92,7 @@ public function saveAction() $i = 1; foreach ($options as $key => $optionCode) { $optionModel = Mage::getModel('rating/rating_option'); - if (!preg_match("/^add_([0-9]*?)$/", $key)) { + if (!preg_match('/^add_([0-9]*?)$/', $key)) { $optionModel->setId($key); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php index a5cabb872cf..2a3dd992164 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Billing/AgreementController.php @@ -56,7 +56,7 @@ public function viewAction() if ($agreementModel) { $this->_title($this->__('Sales')) ->_title($this->__('Billing Agreements')) - ->_title(sprintf("#%s", $agreementModel->getReferenceId())); + ->_title(sprintf('#%s', $agreementModel->getReferenceId())); $this->loadLayout() ->_setActiveMenu('sales/billing_agreement') diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php index 8ad63eb97ae..36bacef02c7 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreditmemoController.php @@ -179,7 +179,7 @@ public function viewAction() { $creditmemo = $this->_initCreditmemo(); if ($creditmemo) { - $this->_title(sprintf("#%s", $creditmemo->getIncrementId())); + $this->_title(sprintf('#%s', $creditmemo->getIncrementId())); $this->loadLayout(); @@ -212,9 +212,9 @@ public function newAction() { if ($creditmemo = $this->_initCreditmemo()) { if ($creditmemo->getInvoice()) { - $this->_title($this->__("New Memo for #%s", $creditmemo->getInvoice()->getIncrementId())); + $this->_title($this->__('New Memo for #%s', $creditmemo->getInvoice()->getIncrementId())); } else { - $this->_title($this->__("New Memo")); + $this->_title($this->__('New Memo')); } if ($comment = Mage::getSingleton('adminhtml/session')->getCommentText(true)) { diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php index f382469a91c..2319d945f5e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/InvoiceController.php @@ -130,7 +130,7 @@ public function viewAction() { $invoice = $this->_initInvoice(); if ($invoice) { - $this->_title(sprintf("#%s", $invoice->getIncrementId())); + $this->_title(sprintf('#%s', $invoice->getIncrementId())); $this->loadLayout() ->_setActiveMenu('sales/invoice'); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php index dd803294b5a..ae7a56568ec 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/ShipmentController.php @@ -119,7 +119,7 @@ public function viewAction() { $shipment = $this->_initShipment(); if ($shipment) { - $this->_title(sprintf("#%s", $shipment->getIncrementId())); + $this->_title(sprintf('#%s', $shipment->getIncrementId())); $this->loadLayout(); diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php index de4a727492b..74dc1789a6c 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/OrderController.php @@ -110,7 +110,7 @@ public function viewAction() $this->_initAction(); - $this->_title(sprintf("#%s", $order->getRealOrderId())); + $this->_title(sprintf('#%s', $order->getRealOrderId())); $this->renderLayout(); } diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php index 5187b8acd41..73b2f894af3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/TransactionsController.php @@ -79,7 +79,7 @@ public function viewAction() } $this->_title($this->__('Sales')) ->_title($this->__('Transactions')) - ->_title(sprintf("#%s", $txn->getTxnId())); + ->_title(sprintf('#%s', $txn->getTxnId())); $this->loadLayout() ->_setActiveMenu('sales/transactions') diff --git a/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php b/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php index e1c719d5700..d55ca3c7084 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/AccountController.php @@ -43,7 +43,7 @@ public function indexAction() public function saveAction() { $userId = Mage::getSingleton('admin/session')->getUser()->getId(); - $user = Mage::getModel("admin/user")->load($userId); + $user = Mage::getModel('admin/user')->load($userId); $user->setId($userId) ->setUsername($this->getRequest()->getParam('username', false)) @@ -74,7 +74,7 @@ public function saveAction() foreach ($result as $error) { Mage::getSingleton('adminhtml/session')->addError($error); } - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return; } @@ -86,6 +86,6 @@ public function saveAction() } catch (Exception $e) { Mage::getSingleton('adminhtml/session')->addError(Mage::helper('adminhtml')->__('An error occurred while saving account.')); } - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); } } diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php b/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php index 53a03873d9f..a957e1846ad 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Convert/GuiController.php @@ -13,7 +13,7 @@ * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -include_once "ProfileController.php"; +include_once 'ProfileController.php'; /** * Convert GUI admin controller diff --git a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php index 51b34e561f5..780a432dbb0 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/DesignController.php @@ -130,7 +130,7 @@ public function deleteAction() ->addError($e->getMessage()); } catch (Exception $e) { Mage::getSingleton('adminhtml/session') - ->addException($e, $this->__("Cannot delete the design change.")); + ->addException($e, $this->__('Cannot delete the design change.')); } } $this->getResponse()->setRedirect($this->getUrl('*/*/')); diff --git a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php index 87154be97c6..07f04a18227 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/StoreController.php @@ -117,21 +117,21 @@ public function editStoreAction() case 'website': $itemId = $this->getRequest()->getParam('website_id', null); $model = Mage::getModel('core/website'); - $title = Mage::helper('core')->__("Website"); - $notExists = Mage::helper('core')->__("The website does not exist."); + $title = Mage::helper('core')->__('Website'); + $notExists = Mage::helper('core')->__('The website does not exist.'); $codeBase = Mage::helper('core')->__('Before modifying the website code please make sure that it is not used in index.php.'); break; case 'group': $itemId = $this->getRequest()->getParam('group_id', null); $model = Mage::getModel('core/store_group'); - $title = Mage::helper('core')->__("Store"); - $notExists = Mage::helper('core')->__("The store does not exist"); + $title = Mage::helper('core')->__('Store'); + $notExists = Mage::helper('core')->__('The store does not exist'); $codeBase = false; break; case 'store': $itemId = $this->getRequest()->getParam('store_id', null); $model = Mage::getModel('core/store'); - $title = Mage::helper('core')->__("Store View"); + $title = Mage::helper('core')->__('Store View'); $notExists = Mage::helper('core')->__("Store view doesn't exist"); $codeBase = Mage::helper('core')->__('Before modifying the store view code please make sure that it is not used in index.php.'); break; diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php index d86f3e6bc69..0411a7f8709 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/CustomerController.php @@ -138,7 +138,7 @@ public function deleteAction() $classModel->delete(); $session->addSuccess(Mage::helper('tax')->__('The tax class has been deleted.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return ; } catch (Mage_Core_Exception $e) { $session->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php index ffdada2720b..5ff6f509ea5 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/Class/ProductController.php @@ -137,7 +137,7 @@ public function deleteAction() $classModel->delete(); $session->addSuccess(Mage::helper('tax')->__('The tax class has been deleted.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return; } catch (Mage_Core_Exception $e) { $session->addError($e->getMessage()); diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php index 299e39c8932..fc07f93bdd5 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RateController.php @@ -99,7 +99,7 @@ public function saveAction() $rateModel->save(); Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('tax')->__('The tax rate has been saved.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return true; } catch (Mage_Core_Exception $e) { Mage::getSingleton('adminhtml/session')->setFormData($ratePost); @@ -131,7 +131,7 @@ public function editAction() } if (!$rateModel->getId()) { - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return; } @@ -139,7 +139,7 @@ public function editAction() $rateModel->setTaxPostcode($rateModel->getZipFrom() . '-' . $rateModel->getZipTo()); } - $this->_title(sprintf("%s", $rateModel->getCode())); + $this->_title(sprintf('%s', $rateModel->getCode())); /** @var Mage_Adminhtml_Block_Tax_Rate_Toolbar_Save $block */ $block = $this->getLayout()->createBlock('adminhtml/tax_rate_toolbar_save'); @@ -169,7 +169,7 @@ public function deleteAction() $rateModel->delete(); Mage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('tax')->__('The tax rate has been deleted.')); - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); return true; } catch (Mage_Core_Exception $e) { Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); @@ -179,7 +179,7 @@ public function deleteAction() if ($referer = $this->getRequest()->getServer('HTTP_REFERER')) { $this->getResponse()->setRedirect($referer); } else { - $this->getResponse()->setRedirect($this->getUrl("*/*/")); + $this->getResponse()->setRedirect($this->getUrl('*/*/')); } } else { Mage::getSingleton('adminhtml/session')->addError(Mage::helper('tax')->__('An error occurred while deleting this rate. Incorrect rate ID.')); diff --git a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php index 5362ec9663f..2740d0685a2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Tax/RuleController.php @@ -79,7 +79,7 @@ public function editAction() $ruleModel->setData($data); } - $this->_title($ruleModel->getId() ? sprintf("%s", $ruleModel->getCode()) : $this->__('New Rule')); + $this->_title($ruleModel->getId() ? sprintf('%s', $ruleModel->getCode()) : $this->__('New Rule')); Mage::register('tax_rule', $ruleModel); @@ -157,7 +157,7 @@ protected function _isValidRuleRequest($ruleModel) //Verify if a Rule already exists. If not throw an error if (count($existingRules) > 0) { - $ruleCodes = implode(",", $existingRules); + $ruleCodes = implode(',', $existingRules); $session->addError( $this->_getHelperModel('tax')->__('Rules (%s) already exist for the specified Tax Rate, Customer Tax Class and Product Tax Class combinations', $ruleCodes) ); diff --git a/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php b/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php index f8ff652c5a2..66074b75dd4 100644 --- a/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Roles/User/Collection.php @@ -39,7 +39,7 @@ protected function _initSelect() { parent::_initSelect(); - $this->getSelect()->where("user_id > 0"); + $this->getSelect()->where('user_id > 0'); return $this; } diff --git a/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php b/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php index d75ce75b774..ed564251cff 100644 --- a/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php +++ b/app/code/core/Mage/Api/Model/Resource/Rules/Collection.php @@ -38,7 +38,7 @@ protected function _construct() */ public function getByRoles($id) { - $this->getSelect()->where("role_id = ?", (int)$id); + $this->getSelect()->where('role_id = ?', (int)$id); return $this; } diff --git a/app/code/core/Mage/Api/Model/Roles.php b/app/code/core/Mage/Api/Model/Roles.php index d73dd218a3e..026564883ae 100644 --- a/app/code/core/Mage/Api/Model/Roles.php +++ b/app/code/core/Mage/Api/Model/Roles.php @@ -134,7 +134,7 @@ protected function _buildResourcesArray( } if ($rawNodes) { - $resource->addAttribute("aclpath", $resourceName); + $resource->addAttribute('aclpath', $resourceName); } $resource->title = Mage::helper($module)->__((string)$resource->title); diff --git a/app/code/core/Mage/Api/Model/Server.php b/app/code/core/Mage/Api/Model/Server.php index 6d319bbadb5..b7444712fa4 100644 --- a/app/code/core/Mage/Api/Model/Server.php +++ b/app/code/core/Mage/Api/Model/Server.php @@ -25,7 +25,7 @@ class Mage_Api_Model_Server * Api Name by Adapter * @var string */ - protected $_api = ""; + protected $_api = ''; /** * Web service adapter diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php index a0821aadd5d..36cafcc06e4 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Soap.php @@ -123,7 +123,7 @@ public function getController() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); + $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); if ($this->getController()->getRequest()->getParam('wsdl') !== null) { // Generating wsdl content from template @@ -226,7 +226,7 @@ protected function getWsdlUrl($params = null, $withAuth = true) if ($phpAuthUser && $phpAuthPw) { $wsdlUrl = sprintf( - "%s://%s:%s@%s", + '%s://%s:%s@%s', $scheme, $phpAuthUser, $phpAuthPw, @@ -260,7 +260,7 @@ protected function _instantiateServer() $retry = false; try { $this->_soap = new Zend_Soap_Server( - $this->getWsdlUrl(["wsdl" => 1]), + $this->getWsdlUrl(['wsdl' => 1]), ['encoding' => $apiConfigCharset] ); } catch (SoapFault $e) { diff --git a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php index 92895b1d6d4..9ed16c81f41 100644 --- a/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php +++ b/app/code/core/Mage/Api/Model/Server/Adapter/Xmlrpc.php @@ -88,7 +88,7 @@ public function getController() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); + $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); $this->_xmlRpc = new Zend_XmlRpc_Server(); $this->_xmlRpc->setEncoding($apiConfigCharset) diff --git a/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php index f7785e3bb2f..292f1741200 100644 --- a/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/V2/Adapter/Soap.php @@ -39,7 +39,7 @@ protected function _getWsdlConfig() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); + $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); if ($this->getController()->getRequest()->getParam('wsdl') !== null) { $this->wsdlConfig->setHandler($this->getHandler()) diff --git a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php index 7557cca522c..3a6796a80b7 100644 --- a/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php +++ b/app/code/core/Mage/Api/Model/Server/Wsi/Adapter/Soap.php @@ -42,7 +42,7 @@ protected function _getWsdlConfig() */ public function run() { - $apiConfigCharset = Mage::getStoreConfig("api/config/charset"); + $apiConfigCharset = Mage::getStoreConfig('api/config/charset'); if ($this->getController()->getRequest()->getParam('wsdl') !== null) { $this->getController()->getResponse() diff --git a/app/code/core/Mage/Api/Model/Wsdl/Config.php b/app/code/core/Mage/Api/Model/Wsdl/Config.php index 1cf684c10e6..0ff9b2903f8 100644 --- a/app/code/core/Mage/Api/Model/Wsdl/Config.php +++ b/app/code/core/Mage/Api/Model/Wsdl/Config.php @@ -120,9 +120,9 @@ public function init() * Exclude Mage_Api wsdl xml file because it used for previous version * of API wsdl declaration */ - $mergeWsdl->addLoadedFile(Mage::getConfig()->getModuleDir('etc', "Mage_Api") . DS . 'wsi.xml'); + $mergeWsdl->addLoadedFile(Mage::getConfig()->getModuleDir('etc', 'Mage_Api') . DS . 'wsi.xml'); - $baseWsdlFile = Mage::getConfig()->getModuleDir('etc', "Mage_Api") . DS . 'wsi.xml'; + $baseWsdlFile = Mage::getConfig()->getModuleDir('etc', 'Mage_Api') . DS . 'wsi.xml'; $this->loadFile($baseWsdlFile); Mage::getConfig()->loadModulesConfiguration('wsi.xml', $this, $mergeWsdl); } else { @@ -130,9 +130,9 @@ public function init() * Exclude Mage_Api wsdl xml file because it used for previous version * of API wsdl declaration */ - $mergeWsdl->addLoadedFile(Mage::getConfig()->getModuleDir('etc', "Mage_Api") . DS . 'wsdl.xml'); + $mergeWsdl->addLoadedFile(Mage::getConfig()->getModuleDir('etc', 'Mage_Api') . DS . 'wsdl.xml'); - $baseWsdlFile = Mage::getConfig()->getModuleDir('etc', "Mage_Api") . DS . 'wsdl2.xml'; + $baseWsdlFile = Mage::getConfig()->getModuleDir('etc', 'Mage_Api') . DS . 'wsdl2.xml'; $this->loadFile($baseWsdlFile); Mage::getConfig()->loadModulesConfiguration('wsdl.xml', $this, $mergeWsdl); } diff --git a/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php b/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php index c6583ef1b79..8d5b3aee797 100644 --- a/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php +++ b/app/code/core/Mage/Api2/Model/Resource/Validator/Eav.php @@ -96,7 +96,7 @@ public function __construct($options) } $this->_entity = Mage::getModel($validationConfig[$userType]['entity_model']); if (empty($this->_entity) || !$this->_entity instanceof Mage_Core_Model_Abstract) { - throw new Exception("Entity is not model."); + throw new Exception('Entity is not model.'); } $this->_eavForm = Mage::getModel($this->_formPath); diff --git a/app/code/core/Mage/Api2/Model/Server.php b/app/code/core/Mage/Api2/Model/Server.php index 1847e81260f..4f414a4b176 100644 --- a/app/code/core/Mage/Api2/Model/Server.php +++ b/app/code/core/Mage/Api2/Model/Server.php @@ -161,8 +161,8 @@ protected function _setAuthUser(Mage_Api2_Model_Auth_User_Abstract $authUser) protected function _getAuthUser() { if (!$this->_authUser) { - throw new Exception("Mage_Api2_Model_Server::internalCall() seems to be executed " - . "before Mage_Api2_Model_Server::run()"); + throw new Exception('Mage_Api2_Model_Server::internalCall() seems to be executed ' + . 'before Mage_Api2_Model_Server::run()'); } return $this->_authUser; } diff --git a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php index 7c0771ade6c..c1ef897571d 100644 --- a/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php +++ b/app/code/core/Mage/Api2/controllers/Adminhtml/Api2/RoleController.php @@ -272,7 +272,7 @@ public function deleteAction() try { /** @var Mage_Api2_Model_Acl_Global_Role $model */ - $model = Mage::getModel("api2/acl_global_role"); + $model = Mage::getModel('api2/acl_global_role'); $model->load($id)->delete(); $this->_getSession()->addSuccess($this->__('Role has been deleted.')); } catch (Mage_Core_Exception $e) { @@ -281,7 +281,7 @@ public function deleteAction() $this->_getSession()->addException($e, $this->__('An error occurred while deleting the role.')); } - $this->_redirect("*/*/"); + $this->_redirect('*/*/'); } /** @@ -316,7 +316,7 @@ public function rolesGridAction() */ protected function _getUsers($id) { - if ($this->getRequest()->getParam('in_role_users') != "") { + if ($this->getRequest()->getParam('in_role_users') != '') { return $this->getRequest()->getParam('in_role_users'); } diff --git a/app/code/core/Mage/Authorizenet/Helper/Admin.php b/app/code/core/Mage/Authorizenet/Helper/Admin.php index 32b239b3fc3..77dcbfb1abe 100644 --- a/app/code/core/Mage/Authorizenet/Helper/Admin.php +++ b/app/code/core/Mage/Authorizenet/Helper/Admin.php @@ -53,7 +53,7 @@ public function getSaveOrderUrlParams($controller) { $route = parent::getSaveOrderUrlParams($controller); - if ($controller === "sales_order_create" || $controller === "sales_order_edit") { + if ($controller === 'sales_order_create' || $controller === 'sales_order_edit') { $route['action'] = 'save'; $route['controller'] = 'sales_order_create'; $route['module'] = 'admin'; diff --git a/app/code/core/Mage/Authorizenet/Helper/Data.php b/app/code/core/Mage/Authorizenet/Helper/Data.php index 73b77315c39..aaf36ee138f 100644 --- a/app/code/core/Mage/Authorizenet/Helper/Data.php +++ b/app/code/core/Mage/Authorizenet/Helper/Data.php @@ -62,7 +62,7 @@ protected function _getUrl($route, $params = []) public function getSaveOrderUrlParams($controller) { $route = []; - if ($controller === "onepage") { + if ($controller === 'onepage') { $route['action'] = 'saveOrder'; $route['controller'] = 'onepage'; $route['module'] = 'checkout'; diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php b/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php index 444e4df7ffd..7c2de8885f6 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost/Request.php @@ -67,7 +67,7 @@ protected function _setTransactionKey($transKey) public function generateRequestSign($merchantApiLoginId, $merchantTransactionKey, $amount, $currencyCode, $fpSequence, $fpTimestamp) { return hash_hmac( - "md5", + 'md5', $merchantApiLoginId . '^' . $fpSequence . '^' . $fpTimestamp . '^' . diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index ef3def6fa2e..1dd2fb4eddd 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -71,8 +71,8 @@ public function getElementHtml() $html .= '' . $elementHtml . ''; } if ($this->getDisableChild() && !$this->getElement()->getReadonly()) { - $html .= ""; + $html .= $switchAttributeCode . '_change(); + '; } return $html; } diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php index 65e49b59c28..22ae9d96f4b 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/Items/Renderer.php @@ -201,7 +201,7 @@ public function getValueHtml($item) } if (!$this->isChildCalculated($item)) { if ($attributes = $this->getSelectionAttributes($item)) { - $result .= " " . $this->getOrderItem()->getOrder()->formatPrice($attributes['price']); + $result .= ' ' . $this->getOrderItem()->getOrder()->formatPrice($attributes['price']); } } return $result; diff --git a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php index 58f8390e5c0..6da0573e4a7 100644 --- a/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Adminhtml/Sales/Order/View/Items/Renderer.php @@ -152,7 +152,7 @@ public function getValueHtml($item) } if (!$this->isChildCalculated($item)) { if ($attributes = $this->getSelectionAttributes($item)) { - $result .= " " . $this->getItem()->getOrder()->formatPrice($attributes['price']); + $result .= ' ' . $this->getItem()->getOrder()->formatPrice($attributes['price']); } } return $result; diff --git a/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php b/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php index 40f501cd4b4..94bcd32ccf8 100644 --- a/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php +++ b/app/code/core/Mage/Bundle/Block/Sales/Order/Items/Renderer.php @@ -133,7 +133,7 @@ public function getValueHtml($item) if ($attributes = $this->getSelectionAttributes($item)) { return sprintf('%d', $attributes['qty']) . ' x ' . $this->escapeHtml($item->getName()) . - " " . $this->getOrder()->formatPrice($attributes['price']); + ' ' . $this->getOrder()->formatPrice($attributes['price']); } else { return $this->escapeHtml($item->getName()); } diff --git a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php index 38e9562613d..db383b6f25d 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Bundle.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Bundle.php @@ -32,13 +32,13 @@ class Mage_Bundle_Model_Resource_Bundle extends Mage_CatalogIndex_Model_Resource protected function _getSelect($productId, $columns = []) { return $this->_getReadAdapter()->select() - ->from(["bundle_option" => $this->getTable('bundle/option')], ['type', 'option_id']) - ->where("bundle_option.parent_id = ?", $productId) - ->where("bundle_option.required = 1") + ->from(['bundle_option' => $this->getTable('bundle/option')], ['type', 'option_id']) + ->where('bundle_option.parent_id = ?', $productId) + ->where('bundle_option.required = 1') ->joinLeft( [ - "bundle_selection" => $this->getTable('bundle/selection')], - "bundle_selection.option_id = bundle_option.option_id", + 'bundle_selection' => $this->getTable('bundle/selection')], + 'bundle_selection.option_id = bundle_option.option_id', $columns ); } @@ -53,7 +53,7 @@ public function getSelectionsData($productId) { return $this->_getReadAdapter()->fetchAll($this->_getSelect( $productId, - ["*"] + ['*'] )); } diff --git a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php index d194e27bb42..9b149f29ef9 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php @@ -203,7 +203,7 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) '1', '0' ) - ) . " > 0 AND " . + ) . ' > 0 AND ' . $write->getCheckSql( $specialTo . ' IS NULL', '1', @@ -224,7 +224,7 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) '0' ); - $tierExpr = new Zend_Db_Expr("tp.min_price"); + $tierExpr = new Zend_Db_Expr('tp.min_price'); if ($priceType == Mage_Bundle_Model_Product_Price::PRICE_TYPE_FIXED) { $finalPrice = $write->getCheckSql( @@ -248,7 +248,7 @@ protected function _prepareBundlePriceByType($priceType, $entityIds = null) $finalPrice ); } else { - $finalPrice = new Zend_Db_Expr("0"); + $finalPrice = new Zend_Db_Expr('0'); $tierPrice = $write->getCheckSql($tierExpr . ' IS NOT NULL', '0', 'NULL'); $groupPrice = $write->getCheckSql($groupPriceExpr . ' > 0', $groupPriceExpr, 'NULL'); } @@ -329,7 +329,7 @@ protected function _calculateBundleOptionPrice() 'MIN(io.alt_price)', 'SUM(io.min_price)' ) . ' + i.price'); - $maxPrice = new Zend_Db_Expr("SUM(io.max_price) + i.price"); + $maxPrice = new Zend_Db_Expr('SUM(io.max_price) + i.price'); $tierPrice = $write->getCheckSql( 'MIN(i.tier_percent) IS NOT NULL', $write->getCheckSql( diff --git a/app/code/core/Mage/Bundle/Model/Resource/Selection.php b/app/code/core/Mage/Bundle/Model/Resource/Selection.php index 3d00b64258e..c1dd98ca4fe 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Selection.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Selection.php @@ -48,7 +48,7 @@ public function getPriceFromIndex($productId, $qty, $storeId, $groupId) $websiteId = Mage::app()->getStore($storeId)->getWebsiteId(); - $select->from(["price_index" => $this->getTable('catalogindex/price')], ['price' => 'SUM(value)']) + $select->from(['price_index' => $this->getTable('catalogindex/price')], ['price' => 'SUM(value)']) ->where('entity_id = :product_id') ->where('website_id = :website_id') ->where('customer_group_id = :customer_group') diff --git a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php index 62cb3dfa7fc..e5fc2e4cf09 100644 --- a/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Bundle/Model/Sales/Order/Pdf/Items/Abstract.php @@ -243,7 +243,7 @@ public function getValueHtml($item) if (!$this->isChildCalculated($item)) { $attributes = $this->getSelectionAttributes($item); if ($attributes) { - $result .= " " . strip_tags($this->getOrderItem()->getOrder()->formatPrice($attributes['price'])); + $result .= ' ' . strip_tags($this->getOrderItem()->getOrder()->formatPrice($attributes['price'])); } } return $result; diff --git a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php index d7a2178df37..cb2045b153f 100644 --- a/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php +++ b/app/code/core/Mage/Bundle/sql/bundle_setup/mysql4-data-upgrade-0.1.13-0.1.14.php @@ -20,8 +20,8 @@ $taxClassAttribute = $installer->getAttribute('catalog_product', 'tax_class_id'); $productTable = $installer->getTable('catalog/product'); -$priceTypeTable = $productTable . "_" . $priceTypeAttribute['backend_type']; -$taxClassTable = $productTable . "_" . $taxClassAttribute['backend_type']; +$priceTypeTable = $productTable . '_' . $priceTypeAttribute['backend_type']; +$taxClassTable = $productTable . '_' . $taxClassAttribute['backend_type']; $db = $installer->getConnection(); $db->beginTransaction(); diff --git a/app/code/core/Mage/Catalog/Block/Widget/Link.php b/app/code/core/Mage/Catalog/Block/Widget/Link.php index 393f2a7bdf6..658bdc1829a 100644 --- a/app/code/core/Mage/Catalog/Block/Widget/Link.php +++ b/app/code/core/Mage/Catalog/Block/Widget/Link.php @@ -80,9 +80,9 @@ public function getHref() } if ($this->_href) { - if (strpos($this->_href, "___store") === false) { - $symbol = (strpos($this->_href, "?") === false) ? "?" : "&"; - $this->_href = $this->_href . $symbol . "___store=" . $store->getCode(); + if (strpos($this->_href, '___store') === false) { + $symbol = (strpos($this->_href, '?') === false) ? '?' : '&'; + $this->_href = $this->_href . $symbol . '___store=' . $store->getCode(); } } else { return false; diff --git a/app/code/core/Mage/Catalog/Helper/Category/Url/Rewrite.php b/app/code/core/Mage/Catalog/Helper/Category/Url/Rewrite.php index c38648923e4..c15d83e9609 100644 --- a/app/code/core/Mage/Catalog/Helper/Category/Url/Rewrite.php +++ b/app/code/core/Mage/Catalog/Helper/Category/Url/Rewrite.php @@ -60,9 +60,9 @@ public function joinTableToEavCollection(Mage_Eav_Model_Entity_Collection_Abstra 'core/url_rewrite', 'category_id=entity_id', ['request_path'], - "{{table}}.is_system=1 AND " . + '{{table}}.is_system=1 AND ' . "{{table}}.store_id='{$storeId}' AND " . - "{{table}}.category_id IS NOT NULL AND " . + '{{table}}.category_id IS NOT NULL AND ' . "{{table}}.id_path LIKE 'category/%'", 'left' ); diff --git a/app/code/core/Mage/Catalog/Helper/Data.php b/app/code/core/Mage/Catalog/Helper/Data.php index 79b39545d28..24ada49f41b 100644 --- a/app/code/core/Mage/Catalog/Helper/Data.php +++ b/app/code/core/Mage/Catalog/Helper/Data.php @@ -424,7 +424,7 @@ public function canApplyMsrpToProductType($product) */ public function getMsrpPriceMessage($product) { - $message = ""; + $message = ''; if ($this->canApplyMsrp($product, Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_IN_CART)) { $message = $this->__('To see product price, add this item to your cart. You can always remove it later.'); } elseif ($this->canApplyMsrp($product, Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_BEFORE_ORDER_CONFIRM)) { diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php index 245222cf695..c334c99052b 100644 --- a/app/code/core/Mage/Catalog/Helper/Product.php +++ b/app/code/core/Mage/Catalog/Helper/Product.php @@ -450,7 +450,7 @@ public function getProduct($productId, $store, $identifierType = null) $expectedIdType = false; if ($identifierType === null) { - if (is_string($productId) && !preg_match("/^[+-]?[1-9][0-9]*$|^0$/", $productId)) { + if (is_string($productId) && !preg_match('/^[+-]?[1-9][0-9]*$|^0$/', $productId)) { $expectedIdType = 'sku'; } } diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index 7ed9cb27d50..8fb3120484b 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api.php @@ -265,7 +265,7 @@ public function create($parentId, $categoryData, $store = null) * Proceed with $useConfig set into category model for processing through validation */ if (count($useConfig) > 0) { - $category->setData("use_post_data_config", $useConfig); + $category->setData('use_post_data_config', $useConfig); } try { @@ -355,7 +355,7 @@ public function move($categoryId, $parentId, $afterId = null) } if (str_starts_with($parent_category->getPath(), $category->getPath())) { - $this->_fault('not_moved', "Operation do not allow to move a parent category to any of children category"); + $this->_fault('not_moved', 'Operation do not allow to move a parent category to any of children category'); } try { diff --git a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php index 14fc7752f9d..08f3277bfc1 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php +++ b/app/code/core/Mage/Catalog/Model/Category/Attribute/Backend/Sortby.php @@ -63,7 +63,7 @@ public function validate($object) $available = explode(',', $available); } $data = (!in_array('default_sort_by', $postDataConfig)) ? $object->getData($attributeCode) : - Mage::getStoreConfig("catalog/frontend/default_sort_by"); + Mage::getStoreConfig('catalog/frontend/default_sort_by'); if (!in_array($data, $available)) { Mage::throwException(Mage::helper('eav')->__('Default Product Listing Sort by does not exist in Available Product Listing Sort By.')); } diff --git a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php index 9dab4c052c0..c3ab65a4e3a 100644 --- a/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php +++ b/app/code/core/Mage/Catalog/Model/Convert/Adapter/Product.php @@ -575,7 +575,7 @@ public function save() unset($model); $i++; } - $this->addException(Mage::helper('catalog')->__("Saved %d record(s)", $i)); + $this->addException(Mage::helper('catalog')->__('Saved %d record(s)', $i)); } catch (Exception $e) { if (!$e instanceof Mage_Dataflow_Model_Convert_Exception) { $this->addException( diff --git a/app/code/core/Mage/Catalog/Model/Design.php b/app/code/core/Mage/Catalog/Model/Design.php index 990db6a020d..49007b18f80 100644 --- a/app/code/core/Mage/Catalog/Model/Design.php +++ b/app/code/core/Mage/Catalog/Model/Design.php @@ -162,7 +162,7 @@ protected function _isApplyDesign($design, array $date) return false; } - $designInfo = explode("/", $design); + $designInfo = explode('/', $design); if (count($designInfo) != 2) { return false; } diff --git a/app/code/core/Mage/Catalog/Model/Product.php b/app/code/core/Mage/Catalog/Model/Product.php index 799a44cbe2b..0f72908b9ce 100644 --- a/app/code/core/Mage/Catalog/Model/Product.php +++ b/app/code/core/Mage/Catalog/Model/Product.php @@ -2069,7 +2069,7 @@ public function getReservedAttributes() foreach ($methods as $method) { if (preg_match('/^get([A-Z]{1}.+)/', $method, $matches)) { $method = $matches[1]; - $tmp = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $method)); + $tmp = strtolower(preg_replace('/(.)([A-Z])/', '$1_$2', $method)); $_reserved[] = $tmp; } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php index 7e5b29466a2..142faed3128 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php @@ -243,14 +243,14 @@ public function afterSave($object) } if ($storeId === 0) { - $image["label_use_default"] = false; - $image["position_use_default"] = false; + $image['label_use_default'] = false; + $image['position_use_default'] = false; } else { - if (!isset($image["label_use_default"])) { - $image["label_use_default"] = null; + if (!isset($image['label_use_default'])) { + $image['label_use_default'] = null; } - if (!isset($image["position_use_default"])) { - $image["position_use_default"] = null; + if (!isset($image['position_use_default'])) { + $image['position_use_default'] = null; } } @@ -259,8 +259,8 @@ public function afterSave($object) // Add per store labels, position, disabled $data = []; $data['value_id'] = $image['value_id']; - $data['label'] = ($image['label'] === null || $image["label_use_default"]) ? null : $image['label']; - $data['position'] = ($image['position'] === null || $image["position_use_default"]) ? null : (int) $image['position']; + $data['label'] = ($image['label'] === null || $image['label_use_default']) ? null : $image['label']; + $data['position'] = ($image['position'] === null || $image['position_use_default']) ? null : (int) $image['position']; $data['disabled'] = (int) $image['disabled']; $data['store_id'] = (int) $object->getStoreId(); diff --git a/app/code/core/Mage/Catalog/Model/Product/Image.php b/app/code/core/Mage/Catalog/Model/Product/Image.php index bbd30f55fe2..112d1827231 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Image.php +++ b/app/code/core/Mage/Catalog/Model/Product/Image.php @@ -248,7 +248,7 @@ protected function _getMemoryLimit() $memoryLimit = trim(strtoupper(ini_get('memory_limit'))); if (!isset($memoryLimit[0])) { - $memoryLimit = "128M"; + $memoryLimit = '128M'; } return ini_parse_quantity($memoryLimit); @@ -566,7 +566,7 @@ public function saveFile() public function getUrl() { $baseDir = Mage::getBaseDir('media'); - $path = str_replace($baseDir . DS, "", $this->_newFile); + $path = str_replace($baseDir . DS, '', $this->_newFile); return Mage::getBaseUrl('media') . str_replace(DS, '/', $path); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php index 5b08b5ca993..364b8c9a7c2 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Type/File.php @@ -180,7 +180,7 @@ protected function _validateUploadedFile() $this->setIsValid(false); $value = $this->_bytesToMbytes($this->_getUploadMaxFilesize()); Mage::throwException( - Mage::helper('catalog')->__("The file you uploaded is larger than %s Megabytes allowed by server", $value) + Mage::helper('catalog')->__('The file you uploaded is larger than %s Megabytes allowed by server', $value) ); } else { switch ($this->getProcessMode()) { @@ -434,7 +434,7 @@ public function prepareForCart() try { Mage::helper('core/unserializeArray')->unserialize($result); } catch (Exception $e) { - Mage::throwException(Mage::helper('catalog')->__("File options format is not valid.")); + Mage::throwException(Mage::helper('catalog')->__('File options format is not valid.')); } } else { /* @@ -515,7 +515,7 @@ protected function _getOptionHtml($optionValue) $sizes ); } catch (Exception $e) { - Mage::throwException(Mage::helper('catalog')->__("File options format is not valid.")); + Mage::throwException(Mage::helper('catalog')->__('File options format is not valid.')); } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php index 5773d9f4cf0..69b72222482 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php @@ -449,7 +449,7 @@ public function processFileQueue() if (isset($queueOptions['option'])) { $queueOptions['option']->setIsValid(false); } - Mage::throwException(Mage::helper('catalog')->__("File upload failed")); + Mage::throwException(Mage::helper('catalog')->__('File upload failed')); } Mage::helper('core/file_storage_database')->saveFile($dst); break; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category.php b/app/code/core/Mage/Catalog/Model/Resource/Category.php index c3201921c2f..658fa1dccbd 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category.php @@ -459,7 +459,7 @@ public function getChildrenAmount($category, $isActiveFlag = true) ) ->joinLeft( ['c' => $table], - "c.attribute_id = :attribute_id AND c.store_id = :store_id AND c.entity_id = m.entity_id", + 'c.attribute_id = :attribute_id AND c.store_id = :store_id AND c.entity_id = m.entity_id', [] ) ->where('m.path LIKE :c_path') @@ -480,7 +480,7 @@ protected function _getIsActiveAttributeId() ->getAttribute(Mage_Catalog_Model_Category::ENTITY, 'is_active') ->getId(); if (!is_int($attributeId)) { - Mage::throwException("Failed to find category attribute is_active"); + Mage::throwException('Failed to find category attribute is_active'); } $this->_isActiveAttributeId = $attributeId; } @@ -704,7 +704,7 @@ public function getChildren($category, $recursive = true) [] ) ->where($checkSql . ' = :scope') - ->order("m.position ASC"); + ->order('m.position ASC'); return $adapter->fetchCol($select, $bind); } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php index 3a03e409ef5..c2c193f010d 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -285,7 +285,7 @@ protected function _loadNodes($parentNode = null, $recursionLevel = 0, $storeId $urlRewrite->joinTableToSelect($select, $storeId); if ($parentPath) { - $select->where($_conn->quoteInto("main_table.path like ?", "$parentPath/%")); + $select->where($_conn->quoteInto('main_table.path like ?', "$parentPath/%")); } if ($recursionLevel != 0) { $levelField = $_conn->quoteIdentifier('level'); @@ -1120,7 +1120,7 @@ public function moveold($categoryId, $prevParentId, $parentId) $update = "UPDATE {$mainStoreTable}, {$catalogCategoryTable} SET"; foreach ($_staticFields as $field) { - $update .= " {$mainStoreTable}." . $field . "={$catalogCategoryTable}." . $field . ","; + $update .= " {$mainStoreTable}." . $field . "={$catalogCategoryTable}." . $field . ','; } $update = substr($update, 0, -1); $update .= " WHERE {$mainStoreTable}.entity_id = {$catalogCategoryTable}.entity_id AND " . @@ -1335,7 +1335,7 @@ public function getChildren($category, $recursive = true, $isActive = true) $select = $this->_getReadAdapter()->select() ->from($maintable, 'entity_id') ->where('path LIKE ?', "{$category->getPath()}/%") - ->order($maintable . ".position ASC"); + ->order($maintable . '.position ASC'); if (!$recursive) { $select->where('level <= ?', $category->getLevel() + 1); } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php index 286e83a1be5..cc6cd8b9fb1 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Indexer/Product.php @@ -269,7 +269,7 @@ public function catalogCategorySave(Mage_Index_Model_Event $event) ->from(['ce' => $this->_categoryTable], ['entity_id']) ->joinInner( ['dca' => $anchorInfo['table']], - "dca.entity_id=ce.entity_id AND dca.attribute_id=:attribute_id AND dca.store_id=:store_id", + 'dca.entity_id=ce.entity_id AND dca.attribute_id=:attribute_id AND dca.store_id=:store_id', [] ) ->where('dca.value=:e_value') @@ -385,7 +385,7 @@ protected function _refreshNotAnchorRootCategories(?array $categoryIds = null) ->joinLeft( ['sv' => $visibilityInfo['table']], "sv.entity_id = pw.product_id AND sv.attribute_id = {$visibilityInfo['id']}" - . " AND sv.store_id = " . (int)$storeId, + . ' AND sv.store_id = ' . (int)$storeId, [] ) ->join( @@ -396,7 +396,7 @@ protected function _refreshNotAnchorRootCategories(?array $categoryIds = null) ->joinLeft( ['ss' => $statusInfo['table']], "ss.entity_id = pw.product_id AND ss.attribute_id = {$statusInfo['id']}" - . " AND ss.store_id = " . (int)$storeId, + . ' AND ss.store_id = ' . (int)$storeId, [] ) ->where('i.product_id IS NULL') @@ -463,7 +463,7 @@ protected function _refreshDirectRelations($categoryIds = null, $productIds = nu ->joinLeft( ['dv' => $visibilityInfo['table']], $adapter->quoteInto( - "dv.entity_id=cp.product_id AND dv.attribute_id=? AND dv.store_id=0", + 'dv.entity_id=cp.product_id AND dv.attribute_id=? AND dv.store_id=0', $visibilityInfo['id'] ), [] @@ -471,7 +471,7 @@ protected function _refreshDirectRelations($categoryIds = null, $productIds = nu ->joinLeft( ['sv' => $visibilityInfo['table']], $adapter->quoteInto( - "sv.entity_id=cp.product_id AND sv.attribute_id=? AND sv.store_id=s.store_id", + 'sv.entity_id=cp.product_id AND sv.attribute_id=? AND sv.store_id=s.store_id', $visibilityInfo['id'] ), ['visibility' => $adapter->getCheckSql( @@ -713,7 +713,7 @@ protected function _refreshRootRelations($productIds) ->joinLeft( ['sv' => $visibilityInfo['table']], "sv.entity_id = pw.product_id AND sv.attribute_id = {$visibilityInfo['id']}" - . " AND sv.store_id = s.store_id", + . ' AND sv.store_id = s.store_id', [] ) ->join( @@ -1121,14 +1121,14 @@ protected function _prepareAnchorCategories($storeId, $rootPath) ->joinLeft( ['cad' => $anchorTable], $adapter->quoteInto( - "cad.entity_id=ce.entity_id AND cad.attribute_id=? AND cad.store_id=0", + 'cad.entity_id=ce.entity_id AND cad.attribute_id=? AND cad.store_id=0', $anchorAttributeId ), [] ) ->joinLeft( ['cas' => $anchorTable], - $adapter->quoteInto("cas.entity_id=ce.entity_id AND cas.attribute_id=? AND ", $anchorAttributeId) + $adapter->quoteInto('cas.entity_id=ce.entity_id AND cas.attribute_id=? AND ', $anchorAttributeId) . $adapter->quoteInto('cas.store_id=?', $storeId), [] ) diff --git a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php index 2656a117d98..eef89b9b8ad 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Collection/Abstract.php @@ -181,7 +181,7 @@ protected function _joinAttributeToSelect($method, $attribute, $tableAlias, $con $defCondition = str_replace($tableAlias, $defAlias, $defCondition); $defCondition .= $adapter->quoteInto( - " AND " . $adapter->quoteColumnAs("$defAlias.store_id", null) . " = ?", + ' AND ' . $adapter->quoteColumnAs("$defAlias.store_id", null) . ' = ?', $this->getDefaultStoreId() ); diff --git a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php index 06d4aa1a8d1..fd0a48f2f39 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Layer/Filter/Decimal.php @@ -125,7 +125,7 @@ public function getCount($filter, $range) $select = $this->_getSelect($filter); $adapter = $this->_getReadAdapter(); - $countExpr = new Zend_Db_Expr("COUNT(*)"); + $countExpr = new Zend_Db_Expr('COUNT(*)'); $rangeExpr = new Zend_Db_Expr("FLOOR(decimal_index.value / {$range}) + 1"); $select->columns([ diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php index d9d7df5b4a5..1eedf9b2469 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Collection.php @@ -1528,7 +1528,7 @@ public function addAttributeToSort($attribute, $dir = self::SORT_ORDER_ASC) return $this; } elseif ($attribute == 'is_saleable') { - $this->getSelect()->order("is_saleable " . $dir); + $this->getSelect()->order('is_saleable ' . $dir); return $this; } diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php index 751bca62d8c..08aad3aceac 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Flat/Indexer.php @@ -623,7 +623,7 @@ public function prepareFlatTable($storeId) $maxIndex = Mage::getConfig()->getNode(self::XML_NODE_MAX_INDEX_COUNT); if (count($indexesNeed) > $maxIndex) { - Mage::throwException(Mage::helper('catalog')->__("The Flat Catalog module has a limit of %2\$d filterable and/or sortable attributes. Currently there are %1\$d of them. Please reduce the number of filterable/sortable attributes in order to use this module", count($indexesNeed), $maxIndex)); + Mage::throwException(Mage::helper('catalog')->__('The Flat Catalog module has a limit of %2$d filterable and/or sortable attributes. Currently there are %1$d of them. Please reduce the number of filterable/sortable attributes in order to use this module', count($indexesNeed), $maxIndex)); } // Process indexes to create names for them in MMDB-style and reformat to common index definition diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php index 7823a08ff35..34d4ee12d57 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Configurable.php @@ -172,12 +172,12 @@ protected function _applyConfigurableOption() $tierPrice = $priceExpression; $tierRoundPriceExp = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $tierPrice); $tierPriceExp = $write->getCheckSql("{$tierPrice} IS NULL", '0', $tierRoundPriceExp); - $tierPriceColumn = $write->getCheckSql("MIN(i.tier_price) IS NOT NULL", "SUM({$tierPriceExp})", 'NULL'); + $tierPriceColumn = $write->getCheckSql('MIN(i.tier_price) IS NOT NULL', "SUM({$tierPriceExp})", 'NULL'); $groupPrice = $priceExpression; $groupRoundPriceExp = $write->getCheckSql("{$percentExpr} = 1", $roundExpr, $groupPrice); $groupPriceExp = $write->getCheckSql("{$groupPrice} IS NULL", '0', $groupRoundPriceExp); - $groupPriceColumn = $write->getCheckSql("MIN(i.group_price) IS NOT NULL", "SUM({$groupPriceExp})", 'NULL'); + $groupPriceColumn = $write->getCheckSql('MIN(i.group_price) IS NOT NULL', "SUM({$groupPriceExp})", 'NULL'); $select->columns([ 'price' => $priceColumn, diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php index 8c3e2b5f56d..eed78fc54a3 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Default.php @@ -403,19 +403,19 @@ protected function _applyCustomOption() $minPriceRound = new Zend_Db_Expr("ROUND(i.price * ({$optPriceValue} / 100), 4)"); $minPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $minPriceRound); $minPriceMin = new Zend_Db_Expr("MIN({$minPriceExpr})"); - $minPrice = $write->getCheckSql("MIN(o.is_require) = 1", $minPriceMin, '0'); + $minPrice = $write->getCheckSql('MIN(o.is_require) = 1', $minPriceMin, '0'); $tierPriceRound = new Zend_Db_Expr("ROUND(i.base_tier * ({$optPriceValue} / 100), 4)"); $tierPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $tierPriceRound); $tierPriceMin = new Zend_Db_Expr("MIN($tierPriceExpr)"); - $tierPriceValue = $write->getCheckSql("MIN(o.is_require) > 0", $tierPriceMin, 0); - $tierPrice = $write->getCheckSql("MIN(i.base_tier) IS NOT NULL", $tierPriceValue, "NULL"); + $tierPriceValue = $write->getCheckSql('MIN(o.is_require) > 0', $tierPriceMin, 0); + $tierPrice = $write->getCheckSql('MIN(i.base_tier) IS NOT NULL', $tierPriceValue, 'NULL'); $groupPriceRound = new Zend_Db_Expr("ROUND(i.base_group_price * ({$optPriceValue} / 100), 4)"); $groupPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $groupPriceRound); $groupPriceMin = new Zend_Db_Expr("MIN($groupPriceExpr)"); - $groupPriceValue = $write->getCheckSql("MIN(o.is_require) > 0", $groupPriceMin, 0); - $groupPrice = $write->getCheckSql("MIN(i.base_group_price) IS NOT NULL", $groupPriceValue, "NULL"); + $groupPriceValue = $write->getCheckSql('MIN(o.is_require) > 0', $groupPriceMin, 0); + $groupPrice = $write->getCheckSql('MIN(i.base_group_price) IS NOT NULL', $groupPriceValue, 'NULL'); $maxPriceRound = new Zend_Db_Expr("ROUND(i.price * ({$optPriceValue} / 100), 4)"); $maxPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $maxPriceRound); @@ -478,12 +478,12 @@ protected function _applyCustomOption() $tierPriceRound = new Zend_Db_Expr("ROUND(i.base_tier * ({$optPriceValue} / 100), 4)"); $tierPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $tierPriceRound); $tierPriceValue = $write->getCheckSql("{$tierPriceExpr} > 0 AND o.is_require > 0", $tierPriceExpr, 0); - $tierPrice = $write->getCheckSql("i.base_tier IS NOT NULL", $tierPriceValue, "NULL"); + $tierPrice = $write->getCheckSql('i.base_tier IS NOT NULL', $tierPriceValue, 'NULL'); $groupPriceRound = new Zend_Db_Expr("ROUND(i.base_group_price * ({$optPriceValue} / 100), 4)"); $groupPriceExpr = $write->getCheckSql("{$optPriceType} = 'fixed'", $optPriceValue, $groupPriceRound); $groupPriceValue = $write->getCheckSql("{$groupPriceExpr} > 0 AND o.is_require > 0", $groupPriceExpr, 0); - $groupPrice = $write->getCheckSql("i.base_group_price IS NOT NULL", $groupPriceValue, "NULL"); + $groupPrice = $write->getCheckSql('i.base_group_price IS NOT NULL', $groupPriceValue, 'NULL'); $select->columns([ 'min_price' => $minPrice, diff --git a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php index 31054cd3e33..a8716e73bbb 100644 --- a/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php +++ b/app/code/core/Mage/Catalog/data/catalog_setup/data-upgrade-1.6.0.0.4-1.6.0.0.5.php @@ -28,7 +28,7 @@ $attributeTable = $installer->getAttributeTable('catalog_product', $attributeCode); $select = $installer->getConnection()->select() ->from(['e' => $attributeTable]) - ->where("e.attribute_id=?", $attribute['attribute_id']) + ->where('e.attribute_id=?', $attribute['attribute_id']) ->where('e.value LIKE "%,,%"'); $result = $installer->getConnection()->fetchAll($select); @@ -40,7 +40,7 @@ if ($replaceCnt) { $installer->getConnection() - ->update($attributeTable, ['value' => $row['value']], "value_id=" . $row['value_id']); + ->update($attributeTable, ['value' => $row['value']], 'value_id=' . $row['value_id']); } } } diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php index 59bee154ffe..f1ad75bdbbe 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.13-0.7.14.php @@ -18,7 +18,7 @@ $mediaAttributeId = (int) $installer->getAttributeId('catalog_product', 'media_gallery'); -$imagesAttributesIds = implode(",", [ +$imagesAttributesIds = implode(',', [ (int) $installer->getAttributeId('catalog_product', 'small_image'), (int) $installer->getAttributeId('catalog_product', 'image'), (int) $installer->getAttributeId('catalog_product', 'thumbnail') diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php index f6c712f58fa..78ad1ea7f92 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.46-0.7.47.php @@ -111,8 +111,8 @@ ON (t_s.entity_id = t_v_default.entity_id) AND (t_s.attribute_id='{$statusAttributeId}') AND (t_s.store_id='{$storeId}') WHERE t_v_default.attribute_id='{$visibilityAttributeId}' AND t_v_default.store_id=0 - AND (IFNULL(t_s.value, t_s_default.value)=" . Mage_Catalog_Model_Product_Status::STATUS_ENABLED . ") - "); + AND (IFNULL(t_s.value, t_s_default.value)=" . Mage_Catalog_Model_Product_Status::STATUS_ENABLED . ') + '); } } diff --git a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php index 9a07d5e20ff..803ab65522c 100644 --- a/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php +++ b/app/code/core/Mage/Catalog/sql/catalog_setup/mysql4-upgrade-0.7.51-0.7.52.php @@ -17,7 +17,7 @@ $this->startSetup(); $table = $this->getTable('catalog/category'); -$tableTmp = $table . "_tmp"; +$tableTmp = $table . '_tmp'; $this->run("DROP TABLE IF EXISTS `{$tableTmp}`"); $this->run("CREATE TABLE `{$tableTmp}` ( diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer.php b/app/code/core/Mage/CatalogIndex/Model/Indexer.php index 9023af6f262..fa015083699 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer.php @@ -714,14 +714,14 @@ public function buildEntityFilter($attributes, $values, &$filteredAttributes, $p $values[$code]['from'] = $_date; } - $filter[$code]->where("value >= ?", $values[$code]['from']); + $filter[$code]->where('value >= ?', $values[$code]['from']); } if ($values[$code]['to']) { if (!is_numeric($values[$code]['to'])) { $values[$code]['to'] = date(Varien_Db_Adapter_Pdo_Mysql::TIMESTAMP_FORMAT, strtotime($values[$code]['to'])); } - $filter[$code]->where("value <= ?", $values[$code]['to']); + $filter[$code]->where('value <= ?', $values[$code]['to']); } } else { $filter[$code]->where('value in (?)', $values[$code]); diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php index 5ecdabcf3e9..56a8f89cdd3 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Aggregation.php @@ -213,7 +213,7 @@ protected function _addTags($tags) foreach ($tags as $index => $tag) { $tags[$index] = $this->_getWriteAdapter()->quote($tag); } - $query = "INSERT INTO `{$this->_tagTable}` (tag_code) VALUES (" . implode('),(', $tags) . ")"; + $query = "INSERT INTO `{$this->_tagTable}` (tag_code) VALUES (" . implode('),(', $tags) . ')'; $this->_getWriteAdapter()->query($query); } else { $this->_getWriteAdapter()->insert($this->_tagTable, [ diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php index 53dbfb59cd8..d230138cc6a 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Data/Abstract.php @@ -84,7 +84,7 @@ public function getAttributeData($products, $attributes, $store) foreach ($suffixes as $suffix) { $tableName = "{$this->getTable('catalog/product')}_{$suffix}"; $condition = "product.entity_id = c.entity_id AND c.store_id = {$store} AND c.attribute_id = d.attribute_id"; - $defaultCondition = "product.entity_id = d.entity_id AND d.store_id = 0"; + $defaultCondition = 'product.entity_id = d.entity_id AND d.store_id = 0'; $fields = [ 'entity_id', 'type_id', @@ -121,9 +121,9 @@ public function getAttributeData($products, $attributes, $store) */ public function fetchLinkInformation($store, $table, $idField, $whereField, $id, $additionalWheres = []) { - $idsConditionSymbol = "= ?"; + $idsConditionSymbol = '= ?'; if (is_array($id)) { - $idsConditionSymbol = "in (?)"; + $idsConditionSymbol = 'in (?)'; } $select = $this->_getReadAdapter()->select(); @@ -210,7 +210,7 @@ public function getTierPrices($products, $website) 'c.value', 'c.all_groups', ]; - $condition = "product.entity_id = c.entity_id"; + $condition = 'product.entity_id = c.entity_id'; $select = $this->_getReadAdapter()->select() ->from(['product' => $this->getTable('catalog/product')], $fields) diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php index 47cbb6a4a2a..3d7ccd361f8 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer.php @@ -150,7 +150,7 @@ public function clear( $this->_getWriteAdapter()->query($query); } elseif (is_array($variable) && count($variable)) { $query = "DELETE FROM {$this->getTable($table)} WHERE "; - $query .= $this->_getWriteAdapter()->quoteInto("attribute_id in (?)", $variable); + $query .= $this->_getWriteAdapter()->quoteInto('attribute_id in (?)', $variable); if ($suffixToInsert) { $query .= " AND {$suffixToInsert}"; } @@ -638,7 +638,7 @@ public function updateCatalogProductFlat($storeId, $productIds = null, $tableNam $select = $this->_getWriteAdapter()->select() ->join( ['p' => $this->getTable('catalogindex/price')], - "`e`.`entity_id`=`p`.`entity_id`" + '`e`.`entity_id`=`p`.`entity_id`' . " AND `p`.`attribute_id`={$priceAttribute}" . " AND `p`.`customer_group_id`={$group->getId()}" . " AND `p`.`website_id`={$websiteId}", @@ -651,7 +651,7 @@ public function updateCatalogProductFlat($storeId, $productIds = null, $tableNam if ($productIds instanceof Mage_Catalog_Model_Product_Condition_Interface) { $select->where('e.entity_id IN (' . $productIds->getIdsSelect($this->_getWriteAdapter())->__toString() . ')'); } elseif (!is_null($productIds)) { - $select->where("e.entity_id IN(?)", $productIds); + $select->where('e.entity_id IN(?)', $productIds); } $sql = $select->crossUpdateFromSelect(['e' => $tableName]); @@ -664,7 +664,7 @@ public function updateCatalogProductFlat($storeId, $productIds = null, $tableNam $select = $this->_getWriteAdapter()->select() ->join( ['p' => $this->getTable('catalogindex/price')], - "`e`.`child_id`=`p`.`entity_id`" + '`e`.`child_id`=`p`.`entity_id`' . " AND `p`.`attribute_id`={$priceAttribute}" . " AND `p`.`customer_group_id`={$group->getId()}" . " AND `p`.`website_id`={$websiteId}", @@ -675,7 +675,7 @@ public function updateCatalogProductFlat($storeId, $productIds = null, $tableNam if ($productIds instanceof Mage_Catalog_Model_Product_Condition_Interface) { $select->where('e.child_id IN (' . $productIds->getIdsSelect($this->_getWriteAdapter())->__toString() . ')'); } elseif (!is_null($productIds)) { - $select->where("e.child_id IN(?)", $productIds); + $select->where('e.child_id IN(?)', $productIds); } $sql = $select->crossUpdateFromSelect(['e' => $tableName]); diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php index a09414b0d19..21ce51840e3 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Price.php @@ -106,7 +106,7 @@ public function getMaxValue($attribute, $entitySelect) } $select - ->columns("MAX(price_table.value" . implode('', $response->getAdditionalCalculations()) . ")") + ->columns('MAX(price_table.value' . implode('', $response->getAdditionalCalculations()) . ')') ->where('price_table.website_id = ?', $this->getWebsiteId()) ->where('price_table.attribute_id = ?', $attribute->getId()); @@ -142,7 +142,7 @@ public function getCount($range, $attribute, $entitySelect) Mage::dispatchEvent('catalogindex_prepare_price_select', $args); } - $fields = ['count' => 'COUNT(DISTINCT price_table.entity_id)', 'range' => "FLOOR(((price_table.value" . implode('', $response->getAdditionalCalculations()) . ")*{$this->getRate()})/{$range})+1"]; + $fields = ['count' => 'COUNT(DISTINCT price_table.entity_id)', 'range' => 'FLOOR(((price_table.value' . implode('', $response->getAdditionalCalculations()) . ")*{$this->getRate()})/{$range})+1"]; $select->columns($fields) ->group('range') @@ -257,7 +257,7 @@ public function getMinimalPrices($ids) $select = $this->_getReadAdapter()->select(); $select->from( ['price_table' => $this->getTable('catalogindex/minimal_price')], - ['price_table.entity_id', 'value' => "(price_table.value)", 'tax_class_id' => '(price_table.tax_class_id)'] + ['price_table.entity_id', 'value' => '(price_table.value)', 'tax_class_id' => '(price_table.tax_class_id)'] ) ->where('price_table.entity_id in (?)', $ids) ->where('price_table.website_id = ?', $this->getWebsiteId()) diff --git a/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php b/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php index 8503c2f906b..5172a163e60 100644 --- a/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php +++ b/app/code/core/Mage/CatalogRule/Model/Action/Index/Refresh.php @@ -540,12 +540,12 @@ protected function _prepareIndexSelect(Mage_Core_Model_Website $website, $time) 'earliest_end_date' => 'earliest_end_date', ] ) - ->where(new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . " >= from_time")) + ->where(new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . ' >= from_time')) ->where( $this->_connection->getCheckSql( new Zend_Db_Expr('to_time = 0'), new Zend_Db_Expr(1), - new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . " <= to_time") + new Zend_Db_Expr($this->_connection->getUnixTimestamp('dates.rule_date') . ' <= to_time') ) ) ->group(['customer_group_id', 'product_id', 'dates.rule_date', 'website_id']); diff --git a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php index 532382b0c11..6bec3f765ec 100644 --- a/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php +++ b/app/code/core/Mage/CatalogRule/sql/catalogrule_setup/mysql4-upgrade-0.7.1-0.7.2.php @@ -35,7 +35,7 @@ } } - $conn->update($ruleTable, ['website_ids' => implode(',', array_keys($websiteIds))], "rule_id=" . $r['rule_id']); + $conn->update($ruleTable, ['website_ids' => implode(',', array_keys($websiteIds))], 'rule_id=' . $r['rule_id']); } $conn->dropColumn($ruleTable, 'store_ids'); } @@ -55,9 +55,9 @@ $websiteId = $websites[$r['store_id']]; $key = $r['from_time'] . '|' . $r['to_time'] . '|' . $websiteId . '|' . $r['customer_group_id'] . '|' . $r['product_id'] . '|' . $r['sort_order']; if (isset($unique[$key])) { - $conn->delete($ruleProductTable, $conn->quoteInto("rule_product_id=?", $r['rule_product_id'])); + $conn->delete($ruleProductTable, $conn->quoteInto('rule_product_id=?', $r['rule_product_id'])); } else { - $conn->update($ruleProductTable, ['website_id' => $websiteId], "rule_product_id=" . $r['rule_product_id']); + $conn->update($ruleProductTable, ['website_id' => $websiteId], 'rule_product_id=' . $r['rule_product_id']); $unique[$key] = true; } } diff --git a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php index 2e0619b5121..a501404c9af 100644 --- a/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php +++ b/app/code/core/Mage/CatalogSearch/Block/Advanced/Form.php @@ -224,7 +224,7 @@ public function getAttributeYesNoElement($attribute) ->setName($name) ->setId($attribute->getAttributeCode()) ->setTitle($this->getAttributeLabel($attribute)) - ->setExtraParams("") + ->setExtraParams('') ->setValue($this->getAttributeValue($attribute)) ->setOptions($options) ->getHtml(); diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php index 6c78488d870..c958c6874d9 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Fulltext.php @@ -359,7 +359,7 @@ public function prepareResult($object, $queryText, $query) ) ->where($mainTableAlias . '.store_id = ?', (int)$query->getStoreId()); - $where = ""; + $where = ''; if ($searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_FULLTEXT || $searchType == Mage_CatalogSearch_Model_Fulltext::SEARCH_TYPE_COMBINE ) { diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php index 4a37b43b2b2..3e98281efd7 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Helper/Mysql4.php @@ -58,7 +58,7 @@ public function prepareTerms($str, $maxWordLength = 0) '(' => '(', ')' => ')' ]; - $words = [0 => ""]; + $words = [0 => '']; $terms = []; preg_match_all('/([\(\)]|[\"\'][^"\']*[\"\']|[^\s\"\(\)]*)/uis', $str, $matches); $isOpenBracket = 0; @@ -85,9 +85,9 @@ public function prepareTerms($str, $maxWordLength = 0) } } if ($isOpenBracket > 0) { - $words[] = sprintf("%')" . $isOpenBracket . "s", ''); + $words[] = sprintf("%')" . $isOpenBracket . 's', ''); } elseif ($isOpenBracket < 0) { - $words[0] = sprintf("%'(" . $isOpenBracket . "s", ''); + $words[0] = sprintf("%'(" . $isOpenBracket . 's', ''); } if ($maxWordLength && count($terms) > $maxWordLength) { $terms = array_slice($terms, 0, $maxWordLength); diff --git a/app/code/core/Mage/Centinel/Model/Api/Client.php b/app/code/core/Mage/Centinel/Model/Api/Client.php index 408bd64c24b..b173b4a8d91 100644 --- a/app/code/core/Mage/Centinel/Model/Api/Client.php +++ b/app/code/core/Mage/Centinel/Model/Api/Client.php @@ -29,7 +29,7 @@ class Mage_Centinel_Model_Api_Client extends CentinelClient public function sendHttp($url, $connectTimeout, $timeout) { // verify that the URL uses a supported protocol. - if ((strpos($url, "http://") === 0) || (strpos($url, "https://") === 0)) { + if ((strpos($url, 'http://') === 0) || (strpos($url, 'https://') === 0)) { //Construct the payload to POST to the url. $data = $this->getRequestXml(); @@ -57,7 +57,7 @@ public function sendHttp($url, $connectTimeout, $timeout) } // Assert that we received an expected Centinel Message in reponse. - if (strpos($result, "") === false) { + if (strpos($result, '') === false) { $result = $this->setErrorResponse(CENTINEL_ERROR_CODE_8010, CENTINEL_ERROR_CODE_8010_DESC); } } else { diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource.php b/app/code/core/Mage/Checkout/Model/Api/Resource.php index 510c821ae51..92751f397f2 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource.php @@ -103,7 +103,7 @@ protected function _getStoreId($store = null) protected function _getQuote($quoteId, $store = null) { /** @var Mage_Sales_Model_Quote $quote */ - $quote = Mage::getModel("sales/quote"); + $quote = Mage::getModel('sales/quote'); if (!(is_string($store) || is_int($store))) { $quote->loadByIdWithoutStore($quoteId); diff --git a/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php b/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php index e8648f848db..52491f42581 100644 --- a/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php +++ b/app/code/core/Mage/Checkout/Model/Api/Resource/Product.php @@ -114,7 +114,7 @@ protected function _getQuoteItemByProduct( } if (is_null($item)) { - $item = Mage::getModel("sales/quote_item"); + $item = Mage::getModel('sales/quote_item'); } return $item; diff --git a/app/code/core/Mage/Checkout/Model/Cart/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Api.php index 8a59d5114f7..4cb3d233f71 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Api.php @@ -23,7 +23,7 @@ class Mage_Checkout_Model_Cart_Api extends Mage_Checkout_Model_Api_Resource { public function __construct() { - $this->_storeIdSessionField = "cart_store_id"; + $this->_storeIdSessionField = 'cart_store_id'; $this->_attributesMap['quote'] = ['quote_id' => 'entity_id']; $this->_attributesMap['quote_customer'] = ['customer_id' => 'entity_id']; $this->_attributesMap['quote_address'] = ['address_id' => 'entity_id']; @@ -104,8 +104,8 @@ public function totals($quoteId, $store = null) $totalsResult = []; foreach ($totals as $total) { $totalsResult[] = [ - "title" => $total->getTitle(), - "amount" => $total->getValue() + 'title' => $total->getTitle(), + 'amount' => $total->getValue() ]; } return $totalsResult; @@ -140,7 +140,7 @@ public function createOrder($quoteId, $store = null, $agreements = null) } /** @var Mage_Checkout_Model_Api_Resource_Customer $customerResource */ - $customerResource = Mage::getModel("checkout/api_resource_customer"); + $customerResource = Mage::getModel('checkout/api_resource_customer'); $isNewCustomer = $customerResource->prepareCustomerForQuote($quote); try { @@ -200,7 +200,7 @@ public function licenseAgreement($quoteId, $store = null) foreach ($agreementsCollection as $_a) { /** @var Mage_Checkout_Model_Agreement $_a */ - $agreements[] = $this->_getAttributes($_a, "quote_agreement"); + $agreements[] = $this->_getAttributes($_a, 'quote_agreement'); } } diff --git a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php index 839ed8a4446..b181a09a1c9 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php @@ -80,7 +80,7 @@ protected function _applyCoupon($quoteId, $couponCode, $store = null) ->collectTotals() ->save(); } catch (Exception $e) { - $this->_fault("cannot_apply_coupon_code", $e->getMessage()); + $this->_fault('cannot_apply_coupon_code', $e->getMessage()); } if ($couponCode) { diff --git a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php index 86c85cdf01d..2c97e11d13e 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php @@ -23,7 +23,7 @@ class Mage_Checkout_Model_Cart_Customer_Api extends Mage_Checkout_Model_Api_Reso { public function __construct() { - $this->_storeIdSessionField = "cart_store_id"; + $this->_storeIdSessionField = 'cart_store_id'; $this->_attributesMap['quote'] = ['quote_id' => 'entity_id']; $this->_attributesMap['quote_customer'] = ['customer_id' => 'entity_id']; @@ -103,7 +103,7 @@ public function setAddresses($quoteId, $customerAddressData, $store = null) foreach ($customerAddressData as $addressItem) { /** @var Mage_Sales_Model_Quote_Address $address */ - $address = Mage::getModel("sales/quote_address"); + $address = Mage::getModel('sales/quote_address'); $addressMode = $addressItem['mode']; unset($addressItem['mode']); diff --git a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php index d858dee6246..8e51bf40f7d 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php @@ -136,7 +136,7 @@ public function setPaymentMethod($quoteId, $paymentData, $store = null) $paymentData = $this->_preparePaymentData($paymentData); if (empty($paymentData)) { - $this->_fault("payment_method_empty"); + $this->_fault('payment_method_empty'); } if ($quote->isVirtual()) { @@ -171,7 +171,7 @@ public function setPaymentMethod($quoteId, $paymentData, $store = null) || $method->getCode() == 'free' || ($quote->hasRecurringItems() && $method->canManageRecurringProfiles()))) ) { - $this->_fault("method_not_allowed"); + $this->_fault('method_not_allowed'); } } } diff --git a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php index dfd589b6c05..58f67f790b3 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php @@ -53,11 +53,11 @@ public function add($quoteId, $productsData, $store = null) $errors = []; foreach ($productsData as $productItem) { if (isset($productItem['product_id'])) { - $productByItem = $this->_getProduct($productItem['product_id'], $store, "id"); + $productByItem = $this->_getProduct($productItem['product_id'], $store, 'id'); } elseif (isset($productItem['sku'])) { - $productByItem = $this->_getProduct($productItem['sku'], $store, "sku"); + $productByItem = $this->_getProduct($productItem['sku'], $store, 'sku'); } else { - $errors[] = Mage::helper('checkout')->__("One item of products do not have identifier or sku"); + $errors[] = Mage::helper('checkout')->__('One item of products do not have identifier or sku'); continue; } @@ -73,13 +73,13 @@ public function add($quoteId, $productsData, $store = null) } if (!empty($errors)) { - $this->_fault("add_product_fault", implode(PHP_EOL, $errors)); + $this->_fault('add_product_fault', implode(PHP_EOL, $errors)); } try { $quote->collectTotals()->save(); } catch (Exception $e) { - $this->_fault("add_product_quote_save_fault", $e->getMessage()); + $this->_fault('add_product_quote_save_fault', $e->getMessage()); } return true; @@ -106,11 +106,11 @@ public function update($quoteId, $productsData, $store = null) $errors = []; foreach ($productsData as $productItem) { if (isset($productItem['product_id'])) { - $productByItem = $this->_getProduct($productItem['product_id'], $store, "id"); + $productByItem = $this->_getProduct($productItem['product_id'], $store, 'id'); } elseif (isset($productItem['sku'])) { - $productByItem = $this->_getProduct($productItem['sku'], $store, "sku"); + $productByItem = $this->_getProduct($productItem['sku'], $store, 'sku'); } else { - $errors[] = Mage::helper('checkout')->__("One item of products do not have identifier or sku"); + $errors[] = Mage::helper('checkout')->__('One item of products do not have identifier or sku'); continue; } @@ -120,7 +120,7 @@ public function update($quoteId, $productsData, $store = null) $this->_getProductRequest($productItem) ); if (is_null($quoteItem->getId())) { - $errors[] = Mage::helper('checkout')->__("One item of products is not belong any of quote item"); + $errors[] = Mage::helper('checkout')->__('One item of products is not belong any of quote item'); continue; } @@ -130,13 +130,13 @@ public function update($quoteId, $productsData, $store = null) } if (!empty($errors)) { - $this->_fault("update_product_fault", implode(PHP_EOL, $errors)); + $this->_fault('update_product_fault', implode(PHP_EOL, $errors)); } try { $quote->collectTotals()->save(); } catch (Exception $e) { - $this->_fault("update_product_quote_save_fault", $e->getMessage()); + $this->_fault('update_product_quote_save_fault', $e->getMessage()); } return true; @@ -163,11 +163,11 @@ public function remove($quoteId, $productsData, $store = null) $errors = []; foreach ($productsData as $productItem) { if (isset($productItem['product_id'])) { - $productByItem = $this->_getProduct($productItem['product_id'], $store, "id"); + $productByItem = $this->_getProduct($productItem['product_id'], $store, 'id'); } elseif (isset($productItem['sku'])) { - $productByItem = $this->_getProduct($productItem['sku'], $store, "sku"); + $productByItem = $this->_getProduct($productItem['sku'], $store, 'sku'); } else { - $errors[] = Mage::helper('checkout')->__("One item of products do not have identifier or sku"); + $errors[] = Mage::helper('checkout')->__('One item of products do not have identifier or sku'); continue; } @@ -178,7 +178,7 @@ public function remove($quoteId, $productsData, $store = null) $this->_getProductRequest($productItem) ); if (is_null($quoteItem->getId())) { - $errors[] = Mage::helper('checkout')->__("One item of products is not belong any of quote item"); + $errors[] = Mage::helper('checkout')->__('One item of products is not belong any of quote item'); continue; } $quote->removeItem($quoteItem->getId()); @@ -188,13 +188,13 @@ public function remove($quoteId, $productsData, $store = null) } if (!empty($errors)) { - $this->_fault("remove_product_fault", implode(PHP_EOL, $errors)); + $this->_fault('remove_product_fault', implode(PHP_EOL, $errors)); } try { $quote->collectTotals()->save(); } catch (Exception $e) { - $this->_fault("remove_product_quote_save_fault", $e->getMessage()); + $this->_fault('remove_product_quote_save_fault', $e->getMessage()); } return true; @@ -273,11 +273,11 @@ public function moveToCustomerQuote($quoteId, $productsData, $store = null) $errors = []; foreach ($productsData as $key => $productItem) { if (isset($productItem['product_id'])) { - $productByItem = $this->_getProduct($productItem['product_id'], $store, "id"); + $productByItem = $this->_getProduct($productItem['product_id'], $store, 'id'); } elseif (isset($productItem['sku'])) { - $productByItem = $this->_getProduct($productItem['sku'], $store, "sku"); + $productByItem = $this->_getProduct($productItem['sku'], $store, 'sku'); } else { - $errors[] = Mage::helper('checkout')->__("One item of products do not have identifier or sku"); + $errors[] = Mage::helper('checkout')->__('One item of products do not have identifier or sku'); continue; } @@ -294,7 +294,7 @@ public function moveToCustomerQuote($quoteId, $productsData, $store = null) $quote->removeItem($quoteItem->getId()); unset($productsData[$key]); } else { - $errors[] = Mage::helper('checkout')->__("One item of products is not belong any of quote item"); + $errors[] = Mage::helper('checkout')->__('One item of products is not belong any of quote item'); } } catch (Mage_Core_Exception $e) { $errors[] = $e->getMessage(); @@ -314,7 +314,7 @@ public function moveToCustomerQuote($quoteId, $productsData, $store = null) ->collectTotals() ->save(); } catch (Exception $e) { - $this->_fault("product_move_quote_save_fault", $e->getMessage()); + $this->_fault('product_move_quote_save_fault', $e->getMessage()); } return true; diff --git a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php index ecc43b506e1..877228a7b1e 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php @@ -40,7 +40,7 @@ public function setShippingMethod($quoteId, $shippingMethod, $store = null) $quoteShippingAddress = $quote->getShippingAddress(); if (is_null($quoteShippingAddress->getId())) { - $this->_fault("shipping_address_is_not_set"); + $this->_fault('shipping_address_is_not_set'); } $rate = $quote->getShippingAddress()->collectShippingRates()->getShippingRateByCode($shippingMethod); @@ -71,7 +71,7 @@ public function getShippingMethodsList($quoteId, $store = null) $quoteShippingAddress = $quote->getShippingAddress(); if (is_null($quoteShippingAddress->getId())) { - $this->_fault("shipping_address_is_not_set"); + $this->_fault('shipping_address_is_not_set'); } try { @@ -86,7 +86,7 @@ public function getShippingMethodsList($quoteId, $store = null) } foreach ($rates as $rate) { - $rateItem = $this->_getAttributes($rate, "quote_shipping_rate"); + $rateItem = $this->_getAttributes($rate, 'quote_shipping_rate'); $rateItem['carrierName'] = $carrierName; $ratesResult[] = $rateItem; unset($rateItem); diff --git a/app/code/core/Mage/Checkout/controllers/OnepageController.php b/app/code/core/Mage/Checkout/controllers/OnepageController.php index 68af5285672..50fd294b5c5 100644 --- a/app/code/core/Mage/Checkout/controllers/OnepageController.php +++ b/app/code/core/Mage/Checkout/controllers/OnepageController.php @@ -521,7 +521,7 @@ protected function _getOrder() if (is_null($this->_order)) { $this->_order = Mage::getModel('sales/order')->load($this->getOnepage()->getQuote()->getId(), 'quote_id'); if (!$this->_order->getId()) { - throw new Mage_Payment_Model_Info_Exception(Mage::helper('core')->__("Can not create invoice. Order was not found.")); + throw new Mage_Payment_Model_Info_Exception(Mage::helper('core')->__('Can not create invoice. Order was not found.')); } } return $this->_order; diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php b/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php index 033bd3ae90d..d3b6a989cd4 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-install-1.6.0.0.php @@ -17,11 +17,11 @@ [ 'title' => 'Footer Links', 'identifier' => 'footer_links', - 'content' => " + 'content' => ' ", +
  • About Us
  • +
  • Customer Service
  • +', 'is_active' => 1, 'stores' => 0 ] @@ -35,12 +35,12 @@ 'meta_description' => 'Page description', 'identifier' => 'no-route', - 'content' => " -

    Whoops, our bad...

    + 'content' => ' +

    Whoops, our bad...

    The page you requested was not found, and we have a fine guess why.
    -
      +
      • If you typed the URL directly, please make sure the spelling is correct.
      • If you clicked on a link to get here, the link is outdated.
      @@ -50,15 +50,15 @@
      What can you do?
      Have no fear, help is near! There are many ways you can get back on track with Magento Store.
      -
        -
      • Go back to the previous page.
      • +
          +
        • Go back to the previous page.
        • Use the search bar at the top of the page to search for your products.
        • -
        • Follow these links to get you back on track!
          Store Home - | My Account
        • +
        • Follow these links to get you back on track!
          Store Home + | My Account
    -", +', 'is_active' => 1, 'stores' => [0], 'sort_order' => 0 @@ -67,7 +67,7 @@ 'title' => 'Home page', 'root_template' => 'two_columns_right', 'identifier' => 'home', - 'content' => "

    Home Page

    ", + 'content' => '

    Home Page

    ', 'is_active' => 1, 'stores' => [0], 'sort_order' => 0 @@ -76,19 +76,19 @@ 'title' => 'About Us', 'root_template' => 'two_columns_right', 'identifier' => 'about-magento-demo-store', - 'content' => " -
    + 'content' => ' +

    About Magento Store

    -
    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +

    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede.

    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta.

    -
    -

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. +

    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit.

    Vivamus tortor nisl, lobortis in, faucibus et, tempus at, dui. Nunc risus. Proin scelerisque augue. Nam ullamcorper. Phasellus id massa. Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada @@ -99,19 +99,19 @@ Vestibulum sapien dolor, aliquet nec, porta ac, malesuada a, libero. Praesent feugiat purus eget est. Nulla facilisi. Vestibulum tincidunt sapien eu velit. Mauris purus. Maecenas eget mauris eu orci accumsan feugiat. Pellentesque eget velit. Nunc tincidunt.

    -
    +

    Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, faucibus et, tempus at, dui. Nunc risus. Proin scelerisque augue. Nam ullamcorper

    -

    Maecenas ullamcorper, odio vel tempus egestas, dui orci faucibus orci, +

    Maecenas ullamcorper, odio vel tempus egestas, dui orci faucibus orci, sit amet aliquet lectus dolor et quam. Pellentesque consequat luctus purus.

    Nunc et risus. Etiam a nibh. Phasellus dignissim metus eget nisi.

    -
    +

    To all of you, from all of us at Magento Store - Thank you and Happy eCommerce!

    -

    John Doe
    +

    John Doe
    Some important guy

    -
    ", +
    ', 'is_active' => 1, 'stores' => [0], 'sort_order' => 0 @@ -120,20 +120,20 @@ 'title' => 'Customer Service', 'root_template' => 'three_columns', 'identifier' => 'customer-service', - 'content' => "
    + 'content' => '

    Customer Service

    -
      -
    • Shipping & Delivery
    • -
    • Privacy & Security
    • -
    • Returns & Replacements
    • -
    • Ordering
    • -
    • Payment, Pricing & Promotions
    • -
    • Viewing Orders
    • -
    • Updating Account Information
    • +
      -
      Shipping & Delivery
      +
      Shipping & Delivery
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -141,7 +141,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Privacy & Security
      +
      Privacy & Security
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -149,7 +149,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Returns & Replacements
      +
      Returns & Replacements
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -157,7 +157,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Ordering
      +
      Ordering
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -165,7 +165,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Payment, Pricing & Promotions
      +
      Payment, Pricing & Promotions
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -173,7 +173,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Viewing Orders
      +
      Viewing Orders
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -181,7 +181,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      Updating Account Information
      +
      Updating Account Information
      Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi luctus. Duis lobortis. Nulla nec velit. Mauris pulvinar erat non massa. Suspendisse tortor turpis, porta nec, tempus vitae, iaculis semper, pede. Cras vel libero id lectus rhoncus porta. Suspendisse convallis felis ac enim. Vivamus tortor nisl, lobortis in, @@ -189,7 +189,7 @@ Pellentesque nisl. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Nunc augue. Aenean sed justo non leo vehicula laoreet. Praesent ipsum libero, auctor ac, tempus nec, tempor nec, justo.
      -
      ", +', 'is_active' => 1, 'stores' => [0], 'sort_order' => 0 @@ -198,16 +198,16 @@ 'title' => 'Enable Cookies', 'root_template' => 'one_column', 'identifier' => 'enable-cookies', - 'content' => "
      -
        -
      • + 'content' => '
        +
          +
          • Please enable cookies in your web browser to continue.
        -
        -

        What are Cookies?

        +
        +

        What are Cookies?

        Cookies are short pieces of data that are sent to your computer when you visit a website. On later visits, this data is then returned to that website. Cookies allow us to recognize you automatically @@ -217,53 +217,53 @@ or take advantage of certain features of our website, such as storing items in your Shopping Cart or receiving personalized recommendations. As a result, we strongly encourage you to configure your web browser to accept cookies from our website.

        -

        Enabling Cookies

        -
          -
        • Internet Explorer 7.x
        • -
        • Internet Explorer 6.x
        • -
        • Mozilla/Firefox
        • -
        • Opera 7.x
        • +

          Enabling Cookies

          + -

          Internet Explorer 7.x

          +

          Internet Explorer 7.x

          1. Start Internet Explorer

          2. Under the Tools menu, click Internet Options

            -

            \"\"

            +

          3. Click the Privacy tab

            -

            \"\"

            +

          4. Click the Advanced button

            -

            \"\"

            +

          5. Put a check mark in the box for Override Automatic Cookie Handling, put another check mark in the Always accept session cookies box

            -

            \"\"

            +

          6. Click OK

            -

            \"\"

            +

          7. Click OK

            -

            \"\"

            +

          8. Restart Internet Explore

          -

          Back to Top

          -

          Internet Explorer 6.x

          +

          Back to Top

          +

          Internet Explorer 6.x

          1. Select Internet Options from the Tools menu

            -

            \"\"

            +

          2. Click on the Privacy tab

            @@ -271,11 +271,11 @@
          3. Click the Default button (or manually slide the bar down to Medium) under Settings. Click OK

            -

            \"\"

            +

          -

          Back to Top

          -

          Mozilla/Firefox

          +

          Back to Top

          +

          Mozilla/Firefox

          1. Click on the Tools-menu in Mozilla

            @@ -285,7 +285,7 @@
          2. Click on the Privacy selection in the left part of the window. (See image below)

            -

            \"\"

            +

          3. Expand the Cookies section

            @@ -297,8 +297,8 @@

            Save changes by clicking Ok.

          -

          Back to Top

          -

          Opera 7.x

          +

          Back to Top

          +

          Opera 7.x

          1. Click on the Tools menu in Opera

            @@ -308,7 +308,7 @@
          2. Click on the Privacy selection near the bottom left of the window. (See image below)

            -

            \"\"

            +

          3. The Enable cookies checkbox must be checked, and Accept all cookies @@ -318,9 +318,9 @@

            Save changes by clicking Ok

          -

          Back to Top

          +

          Back to Top

        -", +', 'is_active' => 1, 'stores' => [0] ] diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php index c3e4a763dfb..bcc473e9ca4 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.0-1.6.0.0.1.php @@ -252,7 +252,7 @@ if (preg_match('/
          (.*?)<\\/ul>/ims', $content, $matches)) { $content = preg_replace('/
        • /ims', '
        • ', $content); $replacment = '
        • ' - . "" + . '' . "Privacy Policy
        • \r\n
        "; $content = preg_replace('/<\\/ul>/ims', $replacment, $content); $footerLinksBlock->setContent($content)->save(); diff --git a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.1-1.6.0.0.2.php b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.1-1.6.0.0.2.php index 53511bf431e..5139e277156 100644 --- a/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.1-1.6.0.0.2.php +++ b/app/code/core/Mage/Cms/data/cms_setup/data-upgrade-1.6.0.0.1-1.6.0.0.2.php @@ -13,10 +13,10 @@ * @license https://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -$content = "

        This website requires cookies to provide all of its features. For more " . - "information on what data is contained in the cookies, please see our " . - "Privacy Policy page. " . - "To accept cookies from this site, please click the Allow button below.

        "; +$content = '

        This website requires cookies to provide all of its features. For more ' . + 'information on what data is contained in the cookies, please see our ' . + 'Privacy Policy page. ' . + 'To accept cookies from this site, please click the Allow button below.

        '; $cmsBlock = [ 'title' => 'Cookie restriction notice', diff --git a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php index 2f4f1619d45..f210de677cb 100644 --- a/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php +++ b/app/code/core/Mage/ConfigurableSwatches/Helper/Productimg.php @@ -299,7 +299,7 @@ public function createSwatchImage($value, $width, $height) } $newImage = imagecreatetruecolor($width, $height); - list($r, $g, $b) = sscanf($optionSwatch->getValue(), "#%02x%02x%02x"); + list($r, $g, $b) = sscanf($optionSwatch->getValue(), '#%02x%02x%02x'); $backgroundColor = imagecolorallocate($newImage, (int)$r, (int)$g, (int)$b); imagefill($newImage, 0, 0, $backgroundColor); imagepng($newImage, Mage::getBaseDir(Mage_Core_Model_Store::URL_TYPE_MEDIA) . DS . $destPath); @@ -382,7 +382,7 @@ public function filterImageInGallery($product, $image) } if (!isset($this->_productImageFilters[$product->getId()])) { - $mapping = call_user_func_array("array_merge_recursive", array_values($product->getChildAttributeLabelMapping())); + $mapping = call_user_func_array('array_merge_recursive', array_values($product->getChildAttributeLabelMapping())); $filters = array_unique($mapping['labels']); $filters = array_merge($filters, array_map(function ($label) { return $label . Mage_ConfigurableSwatches_Helper_Productimg::SWATCH_LABEL_SUFFIX; diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index 73029d7952c..07ab738c9e9 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -1014,7 +1014,7 @@ public function isRateLimitExceeded(bool $setErrorMessage = true, bool $recordRa $cacheTag = 'rate_limit_' . $remoteAddr; if (Mage::app()->testCache($cacheTag)) { if ($setErrorMessage) { - $errorMessage = $this->__("Too Soon: You are trying to perform this operation too frequently. Please wait a few seconds and try again."); + $errorMessage = $this->__('Too Soon: You are trying to perform this operation too frequently. Please wait a few seconds and try again.'); Mage::getSingleton('core/session')->addError($errorMessage); } return true; diff --git a/app/code/core/Mage/Core/Helper/Http.php b/app/code/core/Mage/Core/Helper/Http.php index 09157240db6..89e95379092 100644 --- a/app/code/core/Mage/Core/Helper/Http.php +++ b/app/code/core/Mage/Core/Helper/Http.php @@ -62,10 +62,10 @@ public function authValidate($headers = null) // IIS Note:: For HTTP Authentication to work with IIS, // the PHP directive cgi.rfc2616_headers must be set to 0 (the default value). $auth = $_SERVER['HTTP_AUTHORIZATION']; - list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, " ") + 1))); + list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, ' ') + 1))); } elseif (!empty($_SERVER['Authorization'])) { $auth = $_SERVER['Authorization']; - list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, " ") + 1))); + list($user, $pass) = explode(':', base64_decode(substr($auth, strpos($auth, ' ') + 1))); } if (!$user || !$pass) { diff --git a/app/code/core/Mage/Core/Helper/Js.php b/app/code/core/Mage/Core/Helper/Js.php index 9dda64d13be..7bbca238395 100644 --- a/app/code/core/Mage/Core/Helper/Js.php +++ b/app/code/core/Mage/Core/Helper/Js.php @@ -138,7 +138,7 @@ protected function _getTranslateData() if (!empty($messages)) { foreach ($messages as $message) { $messageText = (string)$message; - $module = $message->getParent()->getAttribute("module"); + $module = $message->getParent()->getAttribute('module'); $this->_translateData[$messageText] = Mage::helper(empty($module) ? 'core' : $module)->__($messageText); } } diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 74b8aca84a5..49544a73856 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -307,7 +307,7 @@ public function ksortMultibyte(array &$sort) if (empty($sort)) { return false; } - $oldLocale = setlocale(LC_COLLATE, "0"); + $oldLocale = setlocale(LC_COLLATE, '0'); $localeCode = Mage::app()->getLocale()->getLocaleCode(); // use fallback locale if $localeCode is not available setlocale(LC_COLLATE, $localeCode . '.UTF8', 'C.UTF-8', 'en_US.utf8'); diff --git a/app/code/core/Mage/Core/Helper/Translate.php b/app/code/core/Mage/Core/Helper/Translate.php index 87c9259cbc7..57b0c1f8c42 100644 --- a/app/code/core/Mage/Core/Helper/Translate.php +++ b/app/code/core/Mage/Core/Helper/Translate.php @@ -38,7 +38,7 @@ public function apply($translate, $area, $returnType = 'json') Mage::getDesign()->setArea($area); } Mage::getModel('core/translate_inline')->processAjaxPost($translate); - return $returnType == 'json' ? "{success:true}" : true; + return $returnType == 'json' ? '{success:true}' : true; } catch (Exception $e) { return $returnType == 'json' ? "{error:true,message:'" . $e->getMessage() . "'}" : false; } diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index 9989bd21744..8149769fa65 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -1338,7 +1338,7 @@ public function getResponse() if (empty($this->_response)) { $this->_response = new Mage_Core_Controller_Response_Http(); $this->_response->headersSentThrowsException = Mage::$headersSentThrowsException; - $this->_response->setHeader("Content-Type", "text/html; charset=UTF-8"); + $this->_response->setHeader('Content-Type', 'text/html; charset=UTF-8'); } return $this->_response; } diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index 9cc7b792e67..b921c35fe42 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -1785,7 +1785,7 @@ public function getResourceModelClassName($modelClass) */ protected function _makeEventsLowerCase($area, Varien_Simplexml_Config $mergeModel) { - $events = $mergeModel->getNode($area . "/" . Mage_Core_Model_App_Area::PART_EVENTS); + $events = $mergeModel->getNode($area . '/' . Mage_Core_Model_App_Area::PART_EVENTS); if ($events !== false) { $children = clone $events->children(); /** @var Mage_Core_Model_Config_Element $event */ diff --git a/app/code/core/Mage/Core/Model/Email/Queue.php b/app/code/core/Mage/Core/Model/Email/Queue.php index 04b54b385c9..0607026739a 100644 --- a/app/code/core/Mage/Core/Model/Email/Queue.php +++ b/app/code/core/Mage/Core/Model/Email/Queue.php @@ -193,7 +193,7 @@ public function send() if ($message->getId()) { $parameters = new Varien_Object($message->getMessageParameters()); if ($parameters->getReturnPathEmail() !== null) { - $mailTransport = new Zend_Mail_Transport_Sendmail("-f" . $parameters->getReturnPathEmail()); + $mailTransport = new Zend_Mail_Transport_Sendmail('-f' . $parameters->getReturnPathEmail()); Zend_Mail::setDefaultTransport($mailTransport); } diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index d57cf4b9dbe..623b9e2ab5a 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -434,7 +434,7 @@ public function send($email, $name = null, array $variables = []) $mail = $this->getMail(); if ($returnPathEmail !== null) { - $mailTransport = new Zend_Mail_Transport_Sendmail("-f" . $returnPathEmail); + $mailTransport = new Zend_Mail_Transport_Sendmail('-f' . $returnPathEmail); Zend_Mail::setDefaultTransport($mailTransport); } diff --git a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php index d11ec8cf843..4ced0c25206 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php @@ -155,12 +155,12 @@ protected function _addEmailVariables($variables, $storeId) } $defaultValuesMap = [ - "logo_width" => self::XML_PATH_DESIGN_EMAIL_LOGO_WIDTH, - "logo_height" => self::XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT, - "phone" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, - "store_phone" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, - "store_hours" => Mage_Core_Model_Store::XML_PATH_STORE_STORE_HOURS, - "store_email" => Mage_Customer_Helper_Data::XML_PATH_SUPPORT_EMAIL, + 'logo_width' => self::XML_PATH_DESIGN_EMAIL_LOGO_WIDTH, + 'logo_height' => self::XML_PATH_DESIGN_EMAIL_LOGO_HEIGHT, + 'phone' => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, + 'store_phone' => Mage_Core_Model_Store::XML_PATH_STORE_STORE_PHONE, + 'store_hours' => Mage_Core_Model_Store::XML_PATH_STORE_STORE_HOURS, + 'store_email' => Mage_Customer_Helper_Data::XML_PATH_SUPPORT_EMAIL, ]; foreach ($defaultValuesMap as $variableName => $configValue) { @@ -252,7 +252,7 @@ protected function _getCssByConfig($configPath) if (!$filesToLoad) { return ''; } - $files = array_map('trim', explode(",", $filesToLoad)); + $files = array_map('trim', explode(',', $filesToLoad)); $css = ''; foreach ($files as $fileName) { diff --git a/app/code/core/Mage/Core/Model/File/Uploader.php b/app/code/core/Mage/Core/Model/File/Uploader.php index 3b7316b79b8..ecbb8828d1d 100644 --- a/app/code/core/Mage/Core/Model/File/Uploader.php +++ b/app/code/core/Mage/Core/Model/File/Uploader.php @@ -109,7 +109,7 @@ public function save($destinationFolder, $newFileName = null) $fileName = $newFileName ?? $this->_file['name']; if (strlen($fileName) > $this->_fileNameMaxLength) { throw new Exception( - Mage::helper('core')->__("File name is too long. Maximum length is %s.", $this->_fileNameMaxLength) + Mage::helper('core')->__('File name is too long. Maximum length is %s.', $this->_fileNameMaxLength) ); } return parent::save($destinationFolder, $newFileName); diff --git a/app/code/core/Mage/Core/Model/File/Validator/Image.php b/app/code/core/Mage/Core/Model/File/Validator/Image.php index bac27129500..d7957a1ed0e 100644 --- a/app/code/core/Mage/Core/Model/File/Validator/Image.php +++ b/app/code/core/Mage/Core/Model/File/Validator/Image.php @@ -21,7 +21,7 @@ */ class Mage_Core_Model_File_Validator_Image { - public const NAME = "isImage"; + public const NAME = 'isImage'; protected $_allowedImageTypes = [ IMAGETYPE_WEBP, diff --git a/app/code/core/Mage/Core/Model/Input/Filter.php b/app/code/core/Mage/Core/Model/Input/Filter.php index 0fa3e22411b..01b0d27f0be 100644 --- a/app/code/core/Mage/Core/Model/Input/Filter.php +++ b/app/code/core/Mage/Core/Model/Input/Filter.php @@ -250,7 +250,7 @@ protected function _filter(array $data, &$filters = null, $isFilterListSimple = protected function _applyFiltrationWithHelper($value, Mage_Core_Helper_Abstract $helper, array $filterData) { if (!isset($filterData['method']) || empty($filterData['method'])) { - throw new Exception("Helper filtration method is not set"); + throw new Exception('Helper filtration method is not set'); } if (!isset($filterData['args']) || empty($filterData['args'])) { $filterData['args'] = []; diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php index b71d87ce8d0..33243ff947f 100644 --- a/app/code/core/Mage/Core/Model/Layout.php +++ b/app/code/core/Mage/Core/Model/Layout.php @@ -146,7 +146,7 @@ public function getDirectOutput() public function generateXml() { $xml = $this->getUpdate()->asSimplexml(); - $removeInstructions = $xml->xpath("//remove"); + $removeInstructions = $xml->xpath('//remove'); if (is_array($removeInstructions)) { foreach ($removeInstructions as $infoNode) { $attributes = $infoNode->attributes(); diff --git a/app/code/core/Mage/Core/Model/Layout/Validator.php b/app/code/core/Mage/Core/Model/Layout/Validator.php index 9bedeaf8621..0b6960ecb50 100644 --- a/app/code/core/Mage/Core/Model/Layout/Validator.php +++ b/app/code/core/Mage/Core/Model/Layout/Validator.php @@ -188,7 +188,7 @@ public function getProtectedExpressions() */ public function getXpathValidationExpression() { - return implode(" | ", $this->_disallowedXPathExpressions); + return implode(' | ', $this->_disallowedXPathExpressions); } /** @@ -209,7 +209,7 @@ public function getXpathBlockValidationExpression() if (!$this->_xpathBlockValidationExpression) { if (count($this->_disallowedBlock)) { foreach ($this->_disallowedBlock as $key => $value) { - $this->_xpathBlockValidationExpression .= $key > 0 ? " | " : ''; + $this->_xpathBlockValidationExpression .= $key > 0 ? ' | ' : ''; $this->_xpathBlockValidationExpression .= "//block[translate(@type, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz') = "; $this->_xpathBlockValidationExpression .= diff --git a/app/code/core/Mage/Core/Model/Locale.php b/app/code/core/Mage/Core/Model/Locale.php index d3b70a7c1cd..0b0b29b8a51 100644 --- a/app/code/core/Mage/Core/Model/Locale.php +++ b/app/code/core/Mage/Core/Model/Locale.php @@ -695,7 +695,7 @@ public function getJsPriceFormat() if ($pos !== false) { $format = substr($format, 0, $pos); } - $format = preg_replace("/[^0\#\.,]/", "", $format); + $format = preg_replace("/[^0\#\.,]/", '', $format); $totalPrecision = 0; $decimalPoint = strpos($format, '.'); if ($decimalPoint !== false) { diff --git a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php index 373d04b1c11..ae359a25a01 100644 --- a/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php +++ b/app/code/core/Mage/Core/Model/Resource/Url/Rewrite/Collection.php @@ -97,7 +97,7 @@ public function filterAllByProductId($productId) public function filterAllByCategory() { $this->getSelect() - ->where('id_path LIKE ?', "category/%"); + ->where('id_path LIKE ?', 'category/%'); return $this; } } diff --git a/app/code/core/Mage/Core/Model/Url.php b/app/code/core/Mage/Core/Model/Url.php index 0ee085048eb..c3b01d16ffb 100644 --- a/app/code/core/Mage/Core/Model/Url.php +++ b/app/code/core/Mage/Core/Model/Url.php @@ -1143,7 +1143,7 @@ public function sessionUrlVar($html) } else { return preg_replace_callback( '#(\?|&|&)___SID=([SU])(&|&)?#', - [$this, "sessionVarCallback"], + [$this, 'sessionVarCallback'], $html ); } diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index 517f2c2512f..de853bee9c5 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -133,46 +133,46 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) switch ($errno) { case E_ERROR: - $errorMessage .= "Error"; + $errorMessage .= 'Error'; break; case E_WARNING: - $errorMessage .= "Warning"; + $errorMessage .= 'Warning'; break; case E_PARSE: - $errorMessage .= "Parse Error"; + $errorMessage .= 'Parse Error'; break; case E_NOTICE: - $errorMessage .= "Notice"; + $errorMessage .= 'Notice'; break; case E_CORE_ERROR: - $errorMessage .= "Core Error"; + $errorMessage .= 'Core Error'; break; case E_CORE_WARNING: - $errorMessage .= "Core Warning"; + $errorMessage .= 'Core Warning'; break; case E_COMPILE_ERROR: - $errorMessage .= "Compile Error"; + $errorMessage .= 'Compile Error'; break; case E_COMPILE_WARNING: - $errorMessage .= "Compile Warning"; + $errorMessage .= 'Compile Warning'; break; case E_USER_ERROR: - $errorMessage .= "User Error"; + $errorMessage .= 'User Error'; break; case E_USER_WARNING: - $errorMessage .= "User Warning"; + $errorMessage .= 'User Warning'; break; case E_USER_NOTICE: - $errorMessage .= "User Notice"; + $errorMessage .= 'User Notice'; break; case E_STRICT: - $errorMessage .= "Strict Notice"; + $errorMessage .= 'Strict Notice'; break; case E_RECOVERABLE_ERROR: - $errorMessage .= "Recoverable Error"; + $errorMessage .= 'Recoverable Error'; break; case E_DEPRECATED: - $errorMessage .= "Deprecated functionality"; + $errorMessage .= 'Deprecated functionality'; break; default: $errorMessage .= "Unknown error ($errno)"; @@ -200,7 +200,7 @@ function mageDebugBacktrace($return = false, $html = true, $showFirst = false) $d = debug_backtrace(); $out = ''; if ($html) { - $out .= "
        ";
        +        $out .= '
        ';
             }
             foreach ($d as $i => $r) {
                 if (!$showFirst && $i == 0) {
        @@ -210,7 +210,7 @@ function mageDebugBacktrace($return = false, $html = true, $showFirst = false)
                 @$out .= "[$i] {$r['file']}:{$r['line']}\n";
             }
             if ($html) {
        -        $out .= "
        "; + $out .= '
        '; } if ($return) { return $out; @@ -256,7 +256,7 @@ function mageDelTree($path) * @param string $escape * @return array */ -function mageParseCsv($string, $delimiter = ",", $enclosure = '"', $escape = '\\') +function mageParseCsv($string, $delimiter = ',', $enclosure = '"', $escape = '\\') { $elements = explode($delimiter, $string); for ($i = 0; $i < count($elements); $i++) { diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php index f8d5a7742df..0e3ae3d17e7 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.14-0.8.15.php @@ -16,5 +16,5 @@ /** @var Mage_Core_Model_Resource_Setup $installer */ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_code', "VARCHAR(200) DEFAULT NULL"); +$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_code', 'VARCHAR(200) DEFAULT NULL'); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php index ca2ff9c4989..4f57a05f12c 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.15-0.8.16.php @@ -20,7 +20,7 @@ $installer->getConnection()->addColumn( $installer->getTable('core_email_template'), 'template_styles', - "text AFTER `template_text`" + 'text AFTER `template_text`' ); $installer->endSetup(); diff --git a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php index 41216e6067f..c96ad411d03 100644 --- a/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php +++ b/app/code/core/Mage/Core/sql/core_setup/mysql4-upgrade-0.8.16-0.8.17.php @@ -39,6 +39,6 @@ CONSTRAINT `FK_CORE_EMAIL_VARIABLE_VALUE_VARIABLE_ID` FOREIGN KEY (`variable_id`) REFERENCES `{$installer->getTable('core_email_variable')}` (`variable_id`) ON DELETE CASCADE ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8 "); -$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_variables', "text NOT NULL"); +$installer->getConnection()->addColumn($installer->getTable('core/email_template'), 'orig_template_variables', 'text NOT NULL'); $installer->endSetup(); diff --git a/app/code/core/Mage/Cron/Model/Schedule.php b/app/code/core/Mage/Cron/Model/Schedule.php index eb014331b6f..36d2ae69867 100644 --- a/app/code/core/Mage/Cron/Model/Schedule.php +++ b/app/code/core/Mage/Cron/Model/Schedule.php @@ -145,7 +145,7 @@ public function matchCronExpression($expr, $num) throw Mage::exception('Mage_Cron', "Invalid cron expression, expecting 'match/modulus': " . $expr); } if (!is_numeric($e[1])) { - throw Mage::exception('Mage_Cron', "Invalid cron expression, expecting numeric modulus: " . $expr); + throw Mage::exception('Mage_Cron', 'Invalid cron expression, expecting numeric modulus: ' . $expr); } $expr = $e[0]; $mod = $e[1]; @@ -171,7 +171,7 @@ public function matchCronExpression($expr, $num) } if ($from === false || $to === false) { - throw Mage::exception('Mage_Cron', "Invalid cron expression: " . $expr); + throw Mage::exception('Mage_Cron', 'Invalid cron expression: ' . $expr); } return ($num >= $from) && ($num <= $to) && ($num % $mod === 0); diff --git a/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php b/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php index 76aa0047fae..30bfffb45d2 100644 --- a/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php +++ b/app/code/core/Mage/Customer/Block/Account/Dashboard/Sidebar.php @@ -116,7 +116,7 @@ public function getCompareItems() */ public function getCompareJsObjectName() { - return "dashboardSidebarCompareJsObject"; + return 'dashboardSidebarCompareJsObject'; } /** diff --git a/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php b/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php index 173725a4acd..e105bf6dfd7 100644 --- a/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php +++ b/app/code/core/Mage/Customer/Model/Convert/Adapter/Customer.php @@ -403,7 +403,7 @@ public function save() } $i++; } - $this->addException(Mage::helper('customer')->__("Saved %d record(s)", $i)); + $this->addException(Mage::helper('customer')->__('Saved %d record(s)', $i)); } catch (Exception $e) { if (!$e instanceof Mage_Dataflow_Model_Convert_Exception) { $this->addException( diff --git a/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php b/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php index 64113720af9..a6a5ab6b317 100644 --- a/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php +++ b/app/code/core/Mage/Customer/Model/Convert/Parser/Customer.php @@ -258,7 +258,7 @@ public function unparse() if ($attribute->usesSource()) { $option = $attribute->getSource()->getOptionText($value); if ($value && empty($option)) { - $message = Mage::helper('catalog')->__("An invalid option ID is specified for %s (%s), skipping the record.", $field, $value); + $message = Mage::helper('catalog')->__('An invalid option ID is specified for %s (%s), skipping the record.', $field, $value); $this->addException($message, Mage_Dataflow_Model_Convert_Exception::ERROR); continue; } @@ -329,7 +329,7 @@ public function unparse() $groupCode = $this->_getCustomerGroupCode($customer); if (is_null($groupCode)) { $this->addException( - Mage::helper('catalog')->__("An invalid group ID is specified, skipping the record."), + Mage::helper('catalog')->__('An invalid group ID is specified, skipping the record.'), Mage_Dataflow_Model_Convert_Exception::ERROR ); continue; @@ -467,7 +467,7 @@ public function parse() // get attribute_set_id, if not throw error $row['attribute_set_id'] = $this->getAttributeSetId($entityTypeId, $row['attribute_set']); if (!$row['attribute_set_id']) { - $this->addException(Mage::helper('customer')->__("Invalid attribute set specified, skipping the record."), Varien_Convert_Exception::ERROR); + $this->addException(Mage::helper('customer')->__('Invalid attribute set specified, skipping the record.'), Varien_Convert_Exception::ERROR); continue; } @@ -488,7 +488,7 @@ public function parse() // get store ids $storeIds = $this->getStoreIds($row['store'] ?? $this->getVar('store')); if (!$storeIds) { - $this->addException(Mage::helper('customer')->__("Invalid store specified, skipping the record."), Varien_Convert_Exception::ERROR); + $this->addException(Mage::helper('customer')->__('Invalid store specified, skipping the record.'), Varien_Convert_Exception::ERROR); continue; } @@ -517,7 +517,7 @@ public function parse() $rowError = true; $this->addException( Mage::helper('customer')->__( - "Invalid attribute option specified for attribute %s (%s), skipping the record.", + 'Invalid attribute option specified for attribute %s (%s), skipping the record.', $field, $value ), diff --git a/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php b/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php index 13becdf1752..7dbba37bdac 100644 --- a/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php +++ b/app/code/core/Mage/Customer/Model/Resource/Group/Collection.php @@ -75,7 +75,7 @@ public function addTaxClass() { $this->getSelect()->joinLeft( ['tax_class_table' => $this->getTable('tax/tax_class')], - "main_table.tax_class_id = tax_class_table.class_id" + 'main_table.tax_class_id = tax_class_table.class_id' ); return $this; } diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php index df89ba23189..8cf9e7399a9 100644 --- a/app/code/core/Mage/Customer/controllers/AccountController.php +++ b/app/code/core/Mage/Customer/controllers/AccountController.php @@ -23,8 +23,8 @@ */ class Mage_Customer_AccountController extends Mage_Core_Controller_Front_Action { - public const CUSTOMER_ID_SESSION_NAME = "customerId"; - public const TOKEN_SESSION_NAME = "token"; + public const CUSTOMER_ID_SESSION_NAME = 'customerId'; + public const TOKEN_SESSION_NAME = 'token'; /** * Action list where need check enabled cookie @@ -895,7 +895,7 @@ public function resetPasswordPostAction() */ protected function getCustomerId() { - $customerId = $this->getRequest()->getQuery("id"); + $customerId = $this->getRequest()->getQuery('id'); if (strlen($customerId) > 12) { $customerCollection = Mage::getModel('customer/customer') ->getCollection() diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php index 7382de11ff5..19860511fb1 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Container/Abstract.php @@ -129,7 +129,7 @@ public function validateDataSerialized($data = null) } catch (Exception $e) { $result = false; $this->addException( - "Invalid data, expecting serialized array.", + 'Invalid data, expecting serialized array.', Mage_Dataflow_Model_Convert_Exception::FATAL ); } @@ -144,7 +144,7 @@ public function validateDataString($data = null) $data = $this->getData(); } if (!is_string($data)) { - $this->addException("Invalid data type, expecting string.", Mage_Dataflow_Model_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting string.', Mage_Dataflow_Model_Convert_Exception::FATAL); } return true; } @@ -155,7 +155,7 @@ public function validateDataArray($data = null) $data = $this->getData(); } if (!is_array($data)) { - $this->addException("Invalid data type, expecting array.", Mage_Dataflow_Model_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting array.', Mage_Dataflow_Model_Convert_Exception::FATAL); } return true; } @@ -170,7 +170,7 @@ public function validateDataGrid($data = null) return true; } $this->addException( - "Invalid data type, expecting 2D grid array.", + 'Invalid data type, expecting 2D grid array.', Mage_Dataflow_Model_Convert_Exception::FATAL ); } diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php index a118510405e..23458115e99 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Parser/Csv.php @@ -162,7 +162,7 @@ public function unparse() $io->open(); if (!$batchExportIds) { - $io->write(""); + $io->write(''); $io->close(); return $this; } @@ -234,7 +234,7 @@ public function getCsvString($fields = []) $str = ''; foreach ($fields as $value) { - $escapedValue = Mage::helper("core")->getEscapedCSVData([$value]); + $escapedValue = Mage::helper('core')->getEscapedCSVData([$value]); $value = $escapedValue[0]; if (str_contains($value, $delimiter) || diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php index cc4d6325ad4..95b73e75b17 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Profile/Abstract.php @@ -108,7 +108,7 @@ public function importXml(Varien_Simplexml_Element $profileNode) public function run() { if (!$this->_actions) { - $e = new Mage_Dataflow_Model_Convert_Exception("Could not find any actions for this profile"); + $e = new Mage_Dataflow_Model_Convert_Exception('Could not find any actions for this profile'); $e->setLevel(Mage_Dataflow_Model_Convert_Exception::FATAL); $this->addException($e); return; diff --git a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php index 84d50adadd5..da7e6d3d0e3 100644 --- a/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php +++ b/app/code/core/Mage/Dataflow/Model/Convert/Validator/Dryrun.php @@ -26,7 +26,7 @@ class Mage_Dataflow_Model_Convert_Validator_Dryrun extends Mage_Dataflow_Model_C public function validate() { if ($this->getVar('dry_run') || $this->getProfile()->getDryRun()) { - $this->addException(Mage::helper('dataflow')->__("Dry run set, stopping execution."), Mage_Dataflow_Model_Convert_Exception::FATAL); + $this->addException(Mage::helper('dataflow')->__('Dry run set, stopping execution.'), Mage_Dataflow_Model_Convert_Exception::FATAL); } return $this; } diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php index 31e53808426..c74eaef3c48 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php @@ -76,8 +76,8 @@ public function addProductToStore($productId, $storeId) $write = $this->getConnection(); $table = $this->getTable('catalog/product_store'); try { - if (!$write->fetchOne("select * from $table where product_id=" . (int)$productId . " and store_id=" . (int)$storeId)) { - $write->query("insert into $table (product_id, store_id) values (" . (int)$productId . "," . (int)$storeId . ")"); + if (!$write->fetchOne("select * from $table where product_id=" . (int)$productId . ' and store_id=' . (int)$storeId)) { + $write->query("insert into $table (product_id, store_id) values (" . (int)$productId . ',' . (int)$storeId . ')'); } } catch (Exception $e) { throw $e; diff --git a/app/code/core/Mage/Dataflow/Model/Profile.php b/app/code/core/Mage/Dataflow/Model/Profile.php index 215937e35be..8ab3d17216d 100644 --- a/app/code/core/Mage/Dataflow/Model/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Profile.php @@ -90,7 +90,7 @@ protected function _beforeSave() if ($actionsXML !== null && strlen($actionsXML) < 0 && @simplexml_load_string('' . $actionsXML . '', null, LIBXML_NOERROR) === false ) { - Mage::throwException(Mage::helper('dataflow')->__("Actions XML is not valid.")); + Mage::throwException(Mage::helper('dataflow')->__('Actions XML is not valid.')); } if (is_array($this->getGuiData())) { @@ -131,7 +131,7 @@ protected function _beforeSave() } if ($this->_getResource()->isProfileExists($this->getName(), $this->getId())) { - Mage::throwException(Mage::helper('dataflow')->__("Profile with the same name already exists.")); + Mage::throwException(Mage::helper('dataflow')->__('Profile with the same name already exists.')); } return $this; } @@ -178,8 +178,8 @@ protected function _afterSave() $uploader->save($path); $uploadFile = $uploader->getUploadedFileName(); - if ($_FILES['file_' . ($index + 1)]['type'] == "text/csv" - || $_FILES['file_' . ($index + 1)]['type'] == "application/vnd.ms-excel" + if ($_FILES['file_' . ($index + 1)]['type'] == 'text/csv' + || $_FILES['file_' . ($index + 1)]['type'] == 'application/vnd.ms-excel' ) { $fileData = $csvParser->getData($path . $uploadFile); $fileData = array_shift($fileData); diff --git a/app/code/core/Mage/Directory/Model/Country.php b/app/code/core/Mage/Directory/Model/Country.php index 8c35648c8da..ed07bcc194f 100644 --- a/app/code/core/Mage/Directory/Model/Country.php +++ b/app/code/core/Mage/Directory/Model/Country.php @@ -94,16 +94,16 @@ public function formatAddress(Varien_Object $address, $html = false) if (!$this->getId()) { $template = '{{firstname}} {{lastname}}'; } elseif (!$html) { - $template = "{{firstname}} {{lastname}} + $template = '{{firstname}} {{lastname}} {{company}} {{street1}} {{street2}} -{{city}}, {{region}} {{postcode}}"; +{{city}}, {{region}} {{postcode}}'; } else { - $template = "{{firstname}} {{lastname}}
        + $template = '{{firstname}} {{lastname}}
        {{street}}
        {{city}}, {{region}} {{postcode}}
        -T: {{telephone}}"; +T: {{telephone}}'; } } diff --git a/app/code/core/Mage/Directory/Model/Currency.php b/app/code/core/Mage/Directory/Model/Currency.php index 8fd5df33432..1363a76498d 100644 --- a/app/code/core/Mage/Directory/Model/Currency.php +++ b/app/code/core/Mage/Directory/Model/Currency.php @@ -260,7 +260,7 @@ public function formatTxt($price, $options = []) * %f - the argument is treated as a float, and presented as a floating-point number (locale aware). * %F - the argument is treated as a float, and presented as a floating-point number (non-locale aware). */ - $price = sprintf("%F", $price); + $price = sprintf('%F', $price); if ($price == -0) { $price = 0; } diff --git a/app/code/core/Mage/Directory/Model/Currency/Filter.php b/app/code/core/Mage/Directory/Model/Currency/Filter.php index ed481822601..51c6bf0a7db 100644 --- a/app/code/core/Mage/Directory/Model/Currency/Filter.php +++ b/app/code/core/Mage/Directory/Model/Currency/Filter.php @@ -67,7 +67,7 @@ public function filter($value) $value = Mage::app()->getLocale()->getNumber($value); $value = Mage::app()->getStore()->roundPrice($this->_rate * $value); //$value = round($value, 2); - $value = sprintf("%F", $value); + $value = sprintf('%F', $value); return $this->_currency->toCurrency($value); } } diff --git a/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php index 92c210c8f33..97db11c2565 100644 --- a/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Country/Collection.php @@ -50,7 +50,7 @@ public function loadByStore($store = null) { $allowCountries = explode(',', (string)$this->_getStoreConfig('general/country/allow', $store)); if (!empty($allowCountries)) { - $this->addFieldToFilter("country_id", ['in' => $allowCountries]); + $this->addFieldToFilter('country_id', ['in' => $allowCountries]); } return $this; } @@ -119,9 +119,9 @@ public function addCountryIdFilter($countryId) { if (!empty($countryId)) { if (is_array($countryId)) { - $this->addFieldToFilter("country_id", ['in' => $countryId]); + $this->addFieldToFilter('country_id', ['in' => $countryId]); } else { - $this->addFieldToFilter("country_id", $countryId); + $this->addFieldToFilter('country_id', $countryId); } } return $this; diff --git a/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php index 8a203b48a22..3dab8301334 100644 --- a/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Currency/Collection.php @@ -90,9 +90,9 @@ public function addLanguageFilter($lang = null) public function addCodeFilter($code) { if (is_array($code)) { - $this->addFieldToFilter("main_table.currency_code", ['in' => $code]); + $this->addFieldToFilter('main_table.currency_code', ['in' => $code]); } else { - $this->addFieldToFilter("main_table.currency_code", $code); + $this->addFieldToFilter('main_table.currency_code', $code); } return $this; diff --git a/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php b/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php index 09fbdf6d1f0..c262b214cc1 100644 --- a/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php +++ b/app/code/core/Mage/Directory/Model/Resource/Region/Collection.php @@ -168,7 +168,7 @@ public function toOptionArray() if (count($options) > 0) { array_unshift($options, [ 'title ' => null, - 'value' => "", + 'value' => '', 'label' => Mage::helper('directory')->__('-- Please select --') ]); } diff --git a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php index 35355af3a06..ccfcc59749e 100644 --- a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php @@ -109,7 +109,7 @@ protected function _applyDownloadableLink() ->join( ['dl' => $dlType->getBackend()->getTable()], "dl.entity_id = i.entity_id AND dl.attribute_id = {$dlType->getAttributeId()}" - . " AND dl.store_id = 0", + . ' AND dl.store_id = 0', [] ) ->join( diff --git a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php index 49e224f2701..dd05a7658ad 100644 --- a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php +++ b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php @@ -51,8 +51,8 @@ public function uploadAction() /** * Workaround for prototype 1.7 methods "isJSON", "evalJSON" on Windows OS */ - $result['tmp_name'] = str_replace(DS, "/", $result['tmp_name']); - $result['path'] = str_replace(DS, "/", $result['path']); + $result['tmp_name'] = str_replace(DS, '/', $result['tmp_name']); + $result['path'] = str_replace(DS, '/', $result['path']); if (isset($result['file'])) { $fullPath = rtrim($tmpPath, DS) . DS . ltrim($result['file'], DS); diff --git a/app/code/core/Mage/Downloadable/controllers/DownloadController.php b/app/code/core/Mage/Downloadable/controllers/DownloadController.php index c46b4059e9d..8bac8cf7078 100644 --- a/app/code/core/Mage/Downloadable/controllers/DownloadController.php +++ b/app/code/core/Mage/Downloadable/controllers/DownloadController.php @@ -157,7 +157,7 @@ public function linkAction() $id = $this->getRequest()->getParam('id', 0); $linkPurchasedItem = Mage::getModel('downloadable/link_purchased_item')->load($id, 'link_hash'); if (!$linkPurchasedItem->getId()) { - $this->_getCustomerSession()->addNotice(Mage::helper('downloadable')->__("Requested link does not exist.")); + $this->_getCustomerSession()->addNotice(Mage::helper('downloadable')->__('Requested link does not exist.')); return $this->_redirect('*/customer/products'); } if (!Mage::helper('downloadable')->getIsShareable($linkPurchasedItem)) { @@ -179,7 +179,7 @@ public function linkAction() } $linkPurchased = Mage::getModel('downloadable/link_purchased')->load($linkPurchasedItem->getPurchasedId()); if ($linkPurchased->getCustomerId() != $customerId) { - $this->_getCustomerSession()->addNotice(Mage::helper('downloadable')->__("Requested link does not exist.")); + $this->_getCustomerSession()->addNotice(Mage::helper('downloadable')->__('Requested link does not exist.')); return $this->_redirect('*/customer/products'); } } diff --git a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php index 6a80e7c4c3b..98110ec1004 100644 --- a/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php +++ b/app/code/core/Mage/Eav/Model/Attribute/Data/Multiline.php @@ -130,10 +130,10 @@ public function outputValue($format = Mage_Eav_Model_Attribute_Data::OUTPUT_FORM $output = $values; break; case Mage_Eav_Model_Attribute_Data::OUTPUT_FORMAT_HTML: - $output = implode("
        ", $values); + $output = implode('
        ', $values); break; case Mage_Eav_Model_Attribute_Data::OUTPUT_FORMAT_ONELINE: - $output = implode(" ", $values); + $output = implode(' ', $values); break; default: $output = implode("\n", $values); diff --git a/app/code/core/Mage/Eav/Model/Config.php b/app/code/core/Mage/Eav/Model/Config.php index ac23acf4ab3..2e04f7c9ce8 100644 --- a/app/code/core/Mage/Eav/Model/Config.php +++ b/app/code/core/Mage/Eav/Model/Config.php @@ -505,7 +505,7 @@ public function getAttribute($entityType, $code, $storeId = null) // return an empty model to avoid breaking compatibility if (!$attribute) { - $attribute = $this->_hydrateAttribute(["entity_type_id" => $entityType->getId()]); + $attribute = $this->_hydrateAttribute(['entity_type_id' => $entityType->getId()]); } return $attribute; diff --git a/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php b/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php index 6439f24f5bf..736294a5844 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php +++ b/app/code/core/Mage/Eav/Model/Convert/Adapter/Entity.php @@ -302,7 +302,7 @@ public function load() */ $entityIds = $collection->getAllIds(); - $message = Mage::helper('eav')->__("Loaded %d records", count($entityIds)); + $message = Mage::helper('eav')->__('Loaded %d records', count($entityIds)); $this->addException($message); } catch (Varien_Convert_Exception $e) { throw $e; @@ -351,7 +351,7 @@ public function save() $model->save(); $i++; } - $this->addException(Mage::helper('eav')->__("Saved %d record(s).", $i)); + $this->addException(Mage::helper('eav')->__('Saved %d record(s).', $i)); } catch (Varien_Convert_Exception $e) { throw $e; } catch (Exception $e) { diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php index dc83e413615..efa6c2ac6fc 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php @@ -760,7 +760,7 @@ protected function _getFlatColumnsOldDefinition() if (isset($prop['PRECISION'], $prop['SCALE'])) { $type .= "({$prop['PRECISION']},{$prop['SCALE']})"; } else { - $type .= (isset($prop['LENGTH']) && $prop['LENGTH']) ? "({$prop['LENGTH']})" : ""; + $type .= (isset($prop['LENGTH']) && $prop['LENGTH']) ? "({$prop['LENGTH']})" : ''; } $columns[$this->getAttributeCode()] = [ 'type' => $type, diff --git a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php index ee17d9c6b3c..faf00f6602d 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Attribute/Backend/Abstract.php @@ -210,7 +210,7 @@ public function getDefaultValue() if ($this->getAttribute()->getDefaultValue()) { $this->_defaultValue = $this->getAttribute()->getDefaultValue(); } else { - $this->_defaultValue = ""; + $this->_defaultValue = ''; } } diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php index 809c33ffc0c..41f603795d3 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute.php @@ -107,7 +107,7 @@ private function _getMaxSortOrder(Mage_Core_Model_Abstract $object) ':attribute_group_id' => $object->getAttributeGroupId() ]; $select = $adapter->select() - ->from($this->getTable('eav/entity_attribute'), new Zend_Db_Expr("MAX(sort_order)")) + ->from($this->getTable('eav/entity_attribute'), new Zend_Db_Expr('MAX(sort_order)')) ->where('attribute_set_id = :attribute_set_id') ->where('attribute_group_id = :attribute_group_id'); @@ -338,7 +338,7 @@ protected function _saveOption(Mage_Core_Model_Abstract $object) foreach ($stores as $store) { if (isset($values[$store->getId()]) && (!empty($values[$store->getId()]) - || $values[$store->getId()] == "0") + || $values[$store->getId()] == '0') ) { $data = [ 'option_id' => $intOptionId, @@ -429,10 +429,10 @@ public function getAttributeCodesByFrontendType($frontendType) public function getFlatUpdateSelect(Mage_Eav_Model_Entity_Attribute_Abstract $attribute, $storeId) { $adapter = $this->_getReadAdapter(); - $joinConditionTemplate = "%s.entity_id = %s.entity_id" - . " AND %s.entity_type_id = " . $attribute->getEntityTypeId() - . " AND %s.attribute_id = " . $attribute->getId() - . " AND %s.store_id = %d"; + $joinConditionTemplate = '%s.entity_id = %s.entity_id' + . ' AND %s.entity_type_id = ' . $attribute->getEntityTypeId() + . ' AND %s.attribute_id = ' . $attribute->getId() + . ' AND %s.store_id = %d'; $joinCondition = sprintf( $joinConditionTemplate, 'e', @@ -460,7 +460,7 @@ public function getFlatUpdateSelect(Mage_Eav_Model_Entity_Attribute_Abstract $at [$attribute->getAttributeCode() => $valueExpr] ); if ($attribute->getFlatAddChildData()) { - $select->where("e.is_child = ?", 0); + $select->where('e.is_child = ?', 0); } return $select; diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php index eb890ed1032..19f6fa8d631 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Group.php @@ -90,7 +90,7 @@ protected function _getMaxSortOrder($object) $adapter = $this->_getReadAdapter(); $bind = [':attribute_set_id' => $object->getAttributeSetId()]; $select = $adapter->select() - ->from($this->getMainTable(), new Zend_Db_Expr("MAX(sort_order)")) + ->from($this->getMainTable(), new Zend_Db_Expr('MAX(sort_order)')) ->where('attribute_set_id = :attribute_set_id'); return $adapter->fetchOne($select, $bind); diff --git a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php index 22b62d2a5b4..9d913c2f6e2 100644 --- a/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php +++ b/app/code/core/Mage/Eav/Model/Resource/Entity/Attribute/Option.php @@ -84,10 +84,10 @@ public function getFlatUpdateSelect( $attributeTable = $attribute->getBackend()->getTable(); $attributeCode = $attribute->getAttributeCode(); - $joinConditionTemplate = "%s.entity_id = %s.entity_id" - . " AND %s.entity_type_id = " . $attribute->getEntityTypeId() - . " AND %s.attribute_id = " . $attribute->getId() - . " AND %s.store_id = %d"; + $joinConditionTemplate = '%s.entity_id = %s.entity_id' + . ' AND %s.entity_type_id = ' . $attribute->getEntityTypeId() + . ' AND %s.attribute_id = ' . $attribute->getId() + . ' AND %s.store_id = %d'; $joinCondition = sprintf( $joinConditionTemplate, 'e', @@ -126,7 +126,7 @@ public function getFlatUpdateSelect( } if ($attribute->getFlatAddChildData()) { - $select->where("e.is_child = ?", 0); + $select->where('e.is_child = ?', 0); } return $select; diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php index eb1de5771e1..798de10a2ca 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.10-0.7.11.php @@ -20,7 +20,7 @@ $table = $installer->getTable('eav/attribute'); $installer->getConnection()->addColumn( $table, - "is_filterable_in_search", + 'is_filterable_in_search', "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'" ); $installer->run(" diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php index 1d2fa81f573..237b25a7f6e 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -17,6 +17,6 @@ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), "is_visible_in_advanced_search", "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'"); +$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), 'is_visible_in_advanced_search', "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '0'"); $installer->endSetup(); diff --git a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php index 7cf31cddb4a..a91e5b4f716 100644 --- a/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Eav/sql/eav_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -16,5 +16,5 @@ /** @var Mage_Eav_Model_Entity_Setup $installer */ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), "is_used_for_price_rules", "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'"); +$installer->getConnection()->addColumn($installer->getTable('eav/attribute'), 'is_used_for_price_rules', "TINYINT( 1 ) UNSIGNED NOT NULL DEFAULT '1'"); $installer->endSetup(); diff --git a/app/code/core/Mage/GiftMessage/Model/Api.php b/app/code/core/Mage/GiftMessage/Model/Api.php index 9ac15e8ff6b..edeb794eb00 100644 --- a/app/code/core/Mage/GiftMessage/Model/Api.php +++ b/app/code/core/Mage/GiftMessage/Model/Api.php @@ -81,7 +81,7 @@ public function setForQuote($quoteId, $giftMessage, $store = null) $giftMessage['type'] = 'quote'; $giftMessages = [$quoteId => $giftMessage]; $request = new Mage_Core_Controller_Request_Http(); - $request->setParam("giftmessage", $giftMessages); + $request->setParam('giftmessage', $giftMessages); return $this->_setGiftMessage($quote->getId(), $request, $quote); } @@ -123,9 +123,9 @@ public function setForQuoteProduct($quoteId, $productsAndMessages, $store = null } if (isset($product['product_id'])) { - $productByItem = $this->_getProduct($product['product_id'], $store, "id"); + $productByItem = $this->_getProduct($product['product_id'], $store, 'id'); } elseif (isset($product['sku'])) { - $productByItem = $this->_getProduct($product['sku'], $store, "sku"); + $productByItem = $this->_getProduct($product['sku'], $store, 'sku'); } else { continue; } @@ -152,7 +152,7 @@ public function setForQuoteItem($quoteItemId, $giftMessage, $store = null) /** @var Mage_Sales_Model_Quote_Item $quoteItem */ $quoteItem = Mage::getModel('sales/quote_item')->load($quoteItemId); if (is_null($quoteItem->getId())) { - $this->_fault("quote_item_not_exists"); + $this->_fault('quote_item_not_exists'); } $quote = $this->_getQuote($quoteItem->getQuoteId(), $store); @@ -163,7 +163,7 @@ public function setForQuoteItem($quoteItemId, $giftMessage, $store = null) $giftMessages = [$quoteItem->getId() => $giftMessage]; $request = new Mage_Core_Controller_Request_Http(); - $request->setParam("giftmessage", $giftMessages); + $request->setParam('giftmessage', $giftMessages); return $this->_setGiftMessage($quoteItemId, $request, $quote); } diff --git a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php index 751c65770d6..5b62f716095 100644 --- a/app/code/core/Mage/GoogleAnalytics/Block/Ga.php +++ b/app/code/core/Mage/GoogleAnalytics/Block/Ga.php @@ -21,8 +21,8 @@ */ class Mage_GoogleAnalytics_Block_Ga extends Mage_Core_Block_Template { - protected const CHECKOUT_MODULE_NAME = "checkout"; - protected const CHECKOUT_CONTROLLER_NAME = "onepage"; + protected const CHECKOUT_MODULE_NAME = 'checkout'; + protected const CHECKOUT_CONTROLLER_NAME = 'onepage'; /** * Render regular page tracking javascript code @@ -368,7 +368,7 @@ protected function _getEnhancedEcommerceDataForAnalytics4() } foreach ($result as $k => $ga4Event) { - $result[$k] = "gtag('event', '{$ga4Event[0]}', " . json_encode($ga4Event[1], JSON_THROW_ON_ERROR) . ");"; + $result[$k] = "gtag('event', '{$ga4Event[0]}', " . json_encode($ga4Event[1], JSON_THROW_ON_ERROR) . ');'; } return implode("\n", $result); } diff --git a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php index c2b9686d77d..b1e98e19f17 100644 --- a/app/code/core/Mage/GoogleAnalytics/Helper/Data.php +++ b/app/code/core/Mage/GoogleAnalytics/Helper/Data.php @@ -182,7 +182,7 @@ public function getLastCategoryName($product): string ->addAttributeToSelect('name') ->addIdFilter($product->getCategoryIds()) ->addIsActiveFilter() - ->addFieldToFilter('path', ['like' => $storeRootCategory->getPath() . "/%"]) + ->addFieldToFilter('path', ['like' => $storeRootCategory->getPath() . '/%']) ->addOrder('level') ->getFirstItem(); return $lastCategory->getName() ?: ''; diff --git a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php index f8d904de9e0..32c28990f63 100644 --- a/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php +++ b/app/code/core/Mage/ImportExport/Model/Export/Adapter/Csv.php @@ -104,7 +104,7 @@ public function writeRow(array $rowData) * @see https://bugzilla.mozilla.org/show_bug.cgi?id=1054702 */ $data = array_merge($this->_headerCols, array_intersect_key($rowData, $this->_headerCols)); - $data = Mage::helper("core")->getEscapedCSVData($data); + $data = Mage::helper('core')->getEscapedCSVData($data); fputcsv( $this->_fileHandler, diff --git a/app/code/core/Mage/ImportExport/Model/Import.php b/app/code/core/Mage/ImportExport/Model/Import.php index 89527a1e637..2644486fa14 100644 --- a/app/code/core/Mage/ImportExport/Model/Import.php +++ b/app/code/core/Mage/ImportExport/Model/Import.php @@ -335,7 +335,7 @@ public function isImportAllowed() */ public function expandSource() { - $writer = Mage::getModel('importexport/export_adapter_csv', self::getWorkingDir() . "big0.csv"); + $writer = Mage::getModel('importexport/export_adapter_csv', self::getWorkingDir() . 'big0.csv'); $regExps = ['last' => '/(.*?)(\d+)$/', 'middle' => '/(.*?)(\d+)(.*)$/']; $colReg = [ 'sku' => 'last', 'name' => 'last', 'description' => 'last', 'short_description' => 'last', diff --git a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php index 9808582d3d3..5e51c4e3e72 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Adapter/Abstract.php @@ -70,7 +70,7 @@ final public function __construct($source) Mage::throwException(Mage::helper('importexport')->__('Source file path must be a string')); } if (!is_readable($source)) { - Mage::throwException(Mage::helper('importexport')->__("%s file does not exists or is not readable", $source)); + Mage::throwException(Mage::helper('importexport')->__('%s file does not exists or is not readable', $source)); } $this->_source = $source; diff --git a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php index 572535fd856..6b1b8221b83 100644 --- a/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php +++ b/app/code/core/Mage/ImportExport/Model/Import/Entity/Abstract.php @@ -263,7 +263,7 @@ protected function _saveValidatedBunches() $bunchSize = Mage::helper('importexport')->getBunchSize(); /** @var Mage_Core_Helper_Data $coreHelper */ - $coreHelper = Mage::helper("core"); + $coreHelper = Mage::helper('core'); $source->rewind(); $this->_dataSourceModel->cleanBunches(); @@ -658,7 +658,7 @@ public function validateData() if (!$this->_dataValidated) { // does all permanent columns exists? if (($colsAbsent = array_diff($this->_permanentAttributes, $this->_getSource()->getColNames()))) { - file_put_contents($this->_getSource()->getSource(), ""); + file_put_contents($this->_getSource()->getSource(), ''); Mage::throwException( Mage::helper('importexport')->__('Can not find required columns: %s', implode(', ', $colsAbsent)) ); diff --git a/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php b/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php index ff55e533815..0521f99f784 100644 --- a/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php +++ b/app/code/core/Mage/Index/Model/Resource/Helper/Mysql4.php @@ -44,7 +44,7 @@ public function insertData($object, $select, $destTable, $columns, $readToIndex) */ public function setLock($name) { - return (bool) $this->_getWriteAdapter()->query("SELECT GET_LOCK(?, ?);", [$name, self::LOCK_GET_TIMEOUT]) + return (bool) $this->_getWriteAdapter()->query('SELECT GET_LOCK(?, ?);', [$name, self::LOCK_GET_TIMEOUT]) ->fetchColumn(); } @@ -56,7 +56,7 @@ public function setLock($name) */ public function releaseLock($name) { - return (bool) $this->_getWriteAdapter()->query("SELECT RELEASE_LOCK(?);", [$name])->fetchColumn(); + return (bool) $this->_getWriteAdapter()->query('SELECT RELEASE_LOCK(?);', [$name])->fetchColumn(); } /** @@ -67,7 +67,7 @@ public function releaseLock($name) */ public function isLocked($name) { - return (bool) $this->_getWriteAdapter()->query("SELECT IS_USED_LOCK(?);", [$name])->fetchColumn(); + return (bool) $this->_getWriteAdapter()->query('SELECT IS_USED_LOCK(?);', [$name])->fetchColumn(); } /** diff --git a/app/code/core/Mage/Install/Model/Observer.php b/app/code/core/Mage/Install/Model/Observer.php index 1eb968fa929..2b679c6cf66 100644 --- a/app/code/core/Mage/Install/Model/Observer.php +++ b/app/code/core/Mage/Install/Model/Observer.php @@ -33,8 +33,8 @@ public function bindLocale($observer) public function installFailure($observer) { - echo "

        There was a problem proceeding with Magento installation.

        "; - echo "

        Please contact developers with error messages on this page.

        "; + echo '

        There was a problem proceeding with Magento installation.

        '; + echo '

        Please contact developers with error messages on this page.

        '; echo Mage::printException($observer->getEvent()->getException()); } } diff --git a/app/code/core/Mage/Log/Model/Aggregation.php b/app/code/core/Mage/Log/Model/Aggregation.php index 7ab2efa3bf8..6fcaf7de95d 100644 --- a/app/code/core/Mage/Log/Model/Aggregation.php +++ b/app/code/core/Mage/Log/Model/Aggregation.php @@ -185,6 +185,6 @@ private function _timestamp($in, $offset = null) */ private function _round($in) { - return date("Y-m-d H:00:00", $this->_timestamp($in)); + return date('Y-m-d H:00:00', $this->_timestamp($in)); } } diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php index 9faf330354b..b0045d91f2e 100644 --- a/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Problem/Collection.php @@ -107,7 +107,7 @@ protected function _addCustomersData() $customers = Mage::getResourceModel('customer/customer_collection') ->addNameToSelect() - ->addAttributeToFilter('entity_id', ["in" => $customersIds]); + ->addAttributeToFilter('entity_id', ['in' => $customersIds]); $customers->load(); diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php index 05de12c54c9..511961f0a73 100644 --- a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php @@ -83,8 +83,8 @@ protected function _construct() public function useQueue(Mage_Newsletter_Model_Queue $queue) { $this->getSelect() - ->join(['link' => $this->_queueLinkTable], "link.subscriber_id = main_table.subscriber_id", []) - ->where("link.queue_id = ? ", $queue->getId()); + ->join(['link' => $this->_queueLinkTable], 'link.subscriber_id = main_table.subscriber_id', []) + ->where('link.queue_id = ? ', $queue->getId()); $this->_queueJoinedFlag = true; return $this; } diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php index c27907eca52..2fedc172842 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.1-0.8.2.php @@ -20,7 +20,7 @@ $installer->getConnection()->addColumn( $installer->getTable('newsletter_template'), 'template_styles', - "text AFTER `template_text_preprocessed`" + 'text AFTER `template_text_preprocessed`' ); $installer->endSetup(); diff --git a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php index fa3aff72940..3b185d5e6f8 100644 --- a/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php +++ b/app/code/core/Mage/Newsletter/sql/newsletter_setup/mysql4-upgrade-0.8.2-0.8.3.php @@ -20,15 +20,15 @@ $templateTable = $installer->getTable('newsletter_template'); $conn = $installer->getConnection(); -$conn->addColumn($queueTable, 'newsletter_type', "int(3) default NULL AFTER `template_id`"); -$conn->addColumn($queueTable, 'newsletter_text', "text AFTER `newsletter_type`"); -$conn->addColumn($queueTable, 'newsletter_styles', "text AFTER `newsletter_text`"); -$conn->addColumn($queueTable, 'newsletter_subject', "varchar(200) default NULL AFTER `newsletter_styles`"); -$conn->addColumn($queueTable, 'newsletter_sender_name', "varchar(200) default NULL AFTER `newsletter_subject`"); +$conn->addColumn($queueTable, 'newsletter_type', 'int(3) default NULL AFTER `template_id`'); +$conn->addColumn($queueTable, 'newsletter_text', 'text AFTER `newsletter_type`'); +$conn->addColumn($queueTable, 'newsletter_styles', 'text AFTER `newsletter_text`'); +$conn->addColumn($queueTable, 'newsletter_subject', 'varchar(200) default NULL AFTER `newsletter_styles`'); +$conn->addColumn($queueTable, 'newsletter_sender_name', 'varchar(200) default NULL AFTER `newsletter_subject`'); $conn->addColumn( $queueTable, 'newsletter_sender_email', - "varchar(200) character set latin1 collate latin1_general_ci default NULL AFTER `newsletter_sender_name`" + 'varchar(200) character set latin1 collate latin1_general_ci default NULL AFTER `newsletter_sender_name`' ); $conn->modifyColumn($templateTable, 'template_text_preprocessed', "text comment 'deprecated since 1.4.0.1'"); diff --git a/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php index 473e006ea2f..0a28788248a 100644 --- a/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php +++ b/app/code/core/Mage/Oauth/Block/Adminhtml/Oauth/Consumer/Edit.php @@ -57,7 +57,7 @@ public function __construct() 'class' => 'save' ], 100); - $this->_formScripts[] = "function saveAndContinueEdit()" . + $this->_formScripts[] = 'function saveAndContinueEdit()' . "{editForm.submit($('edit_form').action + 'back/edit/')}"; $this->_updateButton('save', 'label', $this->__('Save')); diff --git a/app/code/core/Mage/Page/Block/Html/Head.php b/app/code/core/Mage/Page/Block/Html/Head.php index b90c735aa0f..ca02a259ce5 100644 --- a/app/code/core/Mage/Page/Block/Html/Head.php +++ b/app/code/core/Mage/Page/Block/Html/Head.php @@ -44,7 +44,7 @@ protected function _construct() * @param bool $before * @return $this */ - public function addCss($name, $params = "", $referenceName = "*", $before = null) + public function addCss($name, $params = '', $referenceName = '*', $before = null) { $this->addItem('skin_css', $name, $params, null, null, $referenceName, $before); return $this; @@ -59,7 +59,7 @@ public function addCss($name, $params = "", $referenceName = "*", $before = null * @param bool $before * @return $this */ - public function addJs($name, $params = "", $referenceName = "*", $before = null) + public function addJs($name, $params = '', $referenceName = '*', $before = null) { $this->addItem('js', $name, $params, null, null, $referenceName, $before); return $this; @@ -75,7 +75,7 @@ public function addJs($name, $params = "", $referenceName = "*", $before = null) * @return $this * @deprecated */ - public function addCssIe($name, $params = "", $referenceName = "*", $before = null) + public function addCssIe($name, $params = '', $referenceName = '*', $before = null) { return $this; } @@ -90,7 +90,7 @@ public function addCssIe($name, $params = "", $referenceName = "*", $before = nu * @return $this * @deprecated */ - public function addJsIe($name, $params = "", $referenceName = "*", $before = null) + public function addJsIe($name, $params = '', $referenceName = '*', $before = null) { return $this; } @@ -127,7 +127,7 @@ public function addLinkRel($rel, $href) * @param string|bool $before If true insert before the $referenceName instead of after * @return $this */ - public function addItem($type, $name, $params = null, $if = null, $cond = null, $referenceName = "*", $before = false) + public function addItem($type, $name, $params = null, $if = null, $cond = null, $referenceName = '*', $before = false) { // allow skipping of parameters in the layout XML files via empty-string if ($params === '') { diff --git a/app/code/core/Mage/Payment/Block/Form/Cc.php b/app/code/core/Mage/Payment/Block/Form/Cc.php index 5435e7f4a75..e0c9e1cb58e 100644 --- a/app/code/core/Mage/Payment/Block/Form/Cc.php +++ b/app/code/core/Mage/Payment/Block/Form/Cc.php @@ -132,7 +132,7 @@ public function hasSsCardType() public function getSsStartYears() { $years = []; - $first = date("Y"); + $first = date('Y'); for ($index = 5; $index >= 0; $index--) { $year = $first - $index; diff --git a/app/code/core/Mage/Payment/Model/Config.php b/app/code/core/Mage/Payment/Model/Config.php index 44a1a96d422..85ba523dd0f 100644 --- a/app/code/core/Mage/Payment/Model/Config.php +++ b/app/code/core/Mage/Payment/Model/Config.php @@ -134,7 +134,7 @@ public function getMonths() public function getYears() { $years = []; - $first = date("Y"); + $first = date('Y'); for ($index = 0; $index <= 10; $index++) { $year = $first + $index; diff --git a/app/code/core/Mage/Paypal/Model/Config.php b/app/code/core/Mage/Paypal/Model/Config.php index af3cb556d9c..d7c558f4bad 100644 --- a/app/code/core/Mage/Paypal/Model/Config.php +++ b/app/code/core/Mage/Paypal/Model/Config.php @@ -784,7 +784,7 @@ public function __get($key) return $this->_config[$key]; } - $underscored = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $key)); + $underscored = strtolower(preg_replace('/(.)([A-Z])/', '$1_$2', $key)); if (array_key_exists($underscored, $this->_config)) { return $this->_config[$underscored]; } @@ -1305,7 +1305,7 @@ public function getAdditionalOptionsLogoUrl($localeCode, $type = false) */ public function getBuildNotationCode() { - return Mage::getStoreConfig("paypal/bncode", $this->_storeId); + return Mage::getStoreConfig('paypal/bncode', $this->_storeId); } /** @@ -1745,7 +1745,7 @@ protected function _mapBmlFieldset($fieldName) { switch ($fieldName) { case 'allow_ba_signup': - return "payment/" . self::METHOD_WPP_EXPRESS . "/{$fieldName}"; + return 'payment/' . self::METHOD_WPP_EXPRESS . "/{$fieldName}"; default: return $this->_mapExpressFieldset($fieldName); } @@ -1761,7 +1761,7 @@ protected function _mapBmlUkFieldset($fieldName) { switch ($fieldName) { case 'allow_ba_signup': - return "payment/" . self::METHOD_WPP_PE_EXPRESS . "/{$fieldName}"; + return 'payment/' . self::METHOD_WPP_PE_EXPRESS . "/{$fieldName}"; default: return $this->_mapExpressFieldset($fieldName); } diff --git a/app/code/core/Mage/Paypal/Model/Hostedpro.php b/app/code/core/Mage/Paypal/Model/Hostedpro.php index 2cf89676411..23ea50542fd 100644 --- a/app/code/core/Mage/Paypal/Model/Hostedpro.php +++ b/app/code/core/Mage/Paypal/Model/Hostedpro.php @@ -248,8 +248,8 @@ protected function _getUrl($path, $storeId, $secure = null) { $store = Mage::app()->getStore($storeId); return Mage::getUrl($path, [ - "_store" => $store, - "_secure" => is_null($secure) ? $store->isCurrentlySecure() : $secure + '_store' => $store, + '_secure' => is_null($secure) ? $store->isCurrentlySecure() : $secure ]); } } diff --git a/app/code/core/Mage/Paypal/Model/Payflow/Request.php b/app/code/core/Mage/Paypal/Model/Payflow/Request.php index b7a8494abc3..56b8f9cf305 100644 --- a/app/code/core/Mage/Paypal/Model/Payflow/Request.php +++ b/app/code/core/Mage/Paypal/Model/Payflow/Request.php @@ -48,6 +48,6 @@ public function __call($method, $args) case 'has': return isset($this->_data[$key]); } - throw new Varien_Exception("Invalid method " . get_class($this) . "::" . $method . "(" . print_r($args, 1) . ")"); + throw new Varien_Exception('Invalid method ' . get_class($this) . '::' . $method . '(' . print_r($args, 1) . ')'); } } diff --git a/app/code/core/Mage/Paypal/Model/Report/Settlement.php b/app/code/core/Mage/Paypal/Model/Report/Settlement.php index 250df5dfa48..fca1da12888 100644 --- a/app/code/core/Mage/Paypal/Model/Report/Settlement.php +++ b/app/code/core/Mage/Paypal/Model/Report/Settlement.php @@ -39,31 +39,31 @@ class Mage_Paypal_Model_Report_Settlement extends Mage_Core_Model_Abstract * Default PayPal SFTP host * @var string */ - public const REPORTS_HOSTNAME = "reports.paypal.com"; + public const REPORTS_HOSTNAME = 'reports.paypal.com'; /** * Default PayPal SFTP host for sandbox mode * @var string */ - public const SANDBOX_REPORTS_HOSTNAME = "reports.sandbox.paypal.com"; + public const SANDBOX_REPORTS_HOSTNAME = 'reports.sandbox.paypal.com'; /** * PayPal SFTP path * @var string */ - public const REPORTS_PATH = "/ppreports/outgoing"; + public const REPORTS_PATH = '/ppreports/outgoing'; /** * Original charset of old report files * @var string */ - public const FILES_IN_CHARSET = "UTF-16"; + public const FILES_IN_CHARSET = 'UTF-16'; /** * Target charset of report files to be parsed * @var string */ - public const FILES_OUT_CHARSET = "UTF-8"; + public const FILES_OUT_CHARSET = 'UTF-8'; /** * Reports rows storage diff --git a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php index 51d5a8fac62..d4bf134aba7 100644 --- a/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php +++ b/app/code/core/Mage/Paypal/Model/Resource/Payment/Transaction/Collection.php @@ -27,7 +27,7 @@ class Mage_Paypal_Model_Resource_Payment_Transaction_Collection extends Mage_Cor * * @var string */ - protected $_createdBefore = ""; + protected $_createdBefore = ''; /** * Initialize collection items factory class */ diff --git a/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php b/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php index e4079b0d7bd..f8591fb3f1f 100644 --- a/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php +++ b/app/code/core/Mage/Paypal/Model/System/Config/Source/FetchingSchedule.php @@ -24,13 +24,13 @@ class Mage_Paypal_Model_System_Config_Source_FetchingSchedule public function toOptionArray() { return [ - 1 => Mage::helper('paypal')->__("Daily"), - 3 => Mage::helper('paypal')->__("Every 3 days"), - 7 => Mage::helper('paypal')->__("Every 7 days"), - 10 => Mage::helper('paypal')->__("Every 10 days"), - 14 => Mage::helper('paypal')->__("Every 14 days"), - 30 => Mage::helper('paypal')->__("Every 30 days"), - 40 => Mage::helper('paypal')->__("Every 40 days"), + 1 => Mage::helper('paypal')->__('Daily'), + 3 => Mage::helper('paypal')->__('Every 3 days'), + 7 => Mage::helper('paypal')->__('Every 7 days'), + 10 => Mage::helper('paypal')->__('Every 10 days'), + 14 => Mage::helper('paypal')->__('Every 14 days'), + 30 => Mage::helper('paypal')->__('Every 30 days'), + 40 => Mage::helper('paypal')->__('Every 40 days'), ]; } } diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating.php b/app/code/core/Mage/Rating/Model/Resource/Rating.php index e62d8b650b3..04accb0f1ce 100644 --- a/app/code/core/Mage/Rating/Model/Resource/Rating.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating.php @@ -300,7 +300,7 @@ protected function _getEntitySummaryData($object) { $adapter = $this->_getReadAdapter(); $sumColumn = new Zend_Db_Expr("SUM(rating_vote.{$adapter->quoteIdentifier('percent')})"); - $countColumn = new Zend_Db_Expr("COUNT(*)"); + $countColumn = new Zend_Db_Expr('COUNT(*)'); $select = $adapter->select() ->from( diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php index 060ee5a37bd..8eb345ab13a 100644 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option/Vote/Collection.php @@ -41,7 +41,7 @@ protected function _construct() public function setReviewFilter($reviewId) { $this->getSelect() - ->where("main_table.review_id = ?", $reviewId); + ->where('main_table.review_id = ?', $reviewId); return $this; } @@ -54,7 +54,7 @@ public function setReviewFilter($reviewId) public function setEntityPkFilter($entityId) { $this->getSelect() - ->where("entity_pk_value = ?", $entityId); + ->where('entity_pk_value = ?', $entityId); return $this; } diff --git a/app/code/core/Mage/Reports/Helper/Data.php b/app/code/core/Mage/Reports/Helper/Data.php index 57ea227933b..9d3b969bb0e 100644 --- a/app/code/core/Mage/Reports/Helper/Data.php +++ b/app/code/core/Mage/Reports/Helper/Data.php @@ -60,11 +60,11 @@ public function getIntervals($from, $to, $period = self::REPORT_PERIOD_TYPE_DAY) } if ($period == self::REPORT_PERIOD_TYPE_MONTH) { - $dateStart = new Zend_Date(date("Y-m", $start->getTimestamp()), Varien_Date::DATE_INTERNAL_FORMAT); + $dateStart = new Zend_Date(date('Y-m', $start->getTimestamp()), Varien_Date::DATE_INTERNAL_FORMAT); } if ($period == self::REPORT_PERIOD_TYPE_YEAR) { - $dateStart = new Zend_Date(date("Y", $start->getTimestamp()), Varien_Date::DATE_INTERNAL_FORMAT); + $dateStart = new Zend_Date(date('Y', $start->getTimestamp()), Varien_Date::DATE_INTERNAL_FORMAT); } $dateEnd = new Zend_Date($to, Varien_Date::DATE_INTERNAL_FORMAT); diff --git a/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php index bf2cfb8cf57..9cf8ed63411 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Customer/Collection.php @@ -115,7 +115,7 @@ public function joinOrders($from = '', $to = '') $this->getSelect() ->joinLeft( ['orders' => $this->getTable('sales/order')], - "orders.customer_id = e.entity_id" . $dateFilter, + 'orders.customer_id = e.entity_id' . $dateFilter, [] ); @@ -130,9 +130,9 @@ public function joinOrders($from = '', $to = '') public function addOrdersCount() { $this->getSelect() - ->columns(["orders_count" => "COUNT(orders.entity_id)"]) + ->columns(['orders_count' => 'COUNT(orders.entity_id)']) ->where('orders.state <> ?', Mage_Sales_Model_Order::STATE_CANCELED) - ->group("e.entity_id"); + ->group('e.entity_id'); return $this; } @@ -158,8 +158,8 @@ public function addSumAvgTotals($storeId = 0) : "orders.base_subtotal - {$baseSubtotalCanceled} - {$baseSubtotalRefunded}"; $this->getSelect() - ->columns(["orders_avg_amount" => "AVG({$expr})"]) - ->columns(["orders_sum_amount" => "SUM({$expr})"]); + ->columns(['orders_avg_amount' => "AVG({$expr})"]) + ->columns(['orders_sum_amount' => "SUM({$expr})"]); return $this; } @@ -271,7 +271,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("count(DISTINCT e.entity_id)"); + $countSelect->columns('count(DISTINCT e.entity_id)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php index a74fcccafe3..252ca5549ef 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Entity/Summary/Collection/Abstract.php @@ -39,22 +39,22 @@ class Mage_Reports_Model_Resource_Entity_Summary_Collection_Abstract extends Var public function setSelectPeriod($periodType, $customStart = null, $customEnd = null) { switch ($periodType) { - case "24h": + case '24h': $customStart = Varien_Date::toTimestamp(true) - 86400; $customEnd = Varien_Date::toTimestamp(true); break; - case "7d": + case '7d': $customStart = Varien_Date::toTimestamp(true) - 604800; $customEnd = Varien_Date::toTimestamp(true); break; - case "30d": + case '30d': $customStart = Varien_Date::toTimestamp(true) - 2592000; $customEnd = Varien_Date::toTimestamp(true); break; - case "1y": + case '1y': $customStart = Varien_Date::toTimestamp(true) - 31536000; $customEnd = Varien_Date::toTimestamp(true); break; diff --git a/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php index 625fc7c76db..35d50f2f686 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Invoiced/Collection.php @@ -116,7 +116,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("COUNT(*)"); + $countSelect->columns('COUNT(*)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php index 19a497d3e06..3bc2d3d57b3 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Order/Collection.php @@ -772,7 +772,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("COUNT(DISTINCT main_table.entity_id)"); + $countSelect->columns('COUNT(DISTINCT main_table.entity_id)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php index c56128c2c79..c2da53b10d7 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Product/Collection.php @@ -185,7 +185,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("count(DISTINCT e.entity_id)"); + $countSelect->columns('count(DISTINCT e.entity_id)'); return $countSelect; } @@ -206,10 +206,10 @@ public function addCartsCount() 'quotes.entity_id = quote_items.quote_id AND quotes.is_active = 1', [] ) - ->where("quote_items.product_id = e.entity_id"); + ->where('quote_items.product_id = e.entity_id'); $this->getSelect() - ->columns(["carts" => "({$countSelect})"]) + ->columns(['carts' => "({$countSelect})"]) ->group("e.{$this->getProductEntityId()}") ->having('carts > ?', 0); @@ -361,7 +361,7 @@ public function addViewsCount($from = '', $to = '') ->join( ['e' => $this->getProductEntityTableName()], $this->getConnection()->quoteInto( - "e.entity_id = report_table_views.object_id AND e.entity_type_id = ?", + 'e.entity_id = report_table_views.object_id AND e.entity_type_id = ?', $this->getProductEntityTypeId() ) ) diff --git a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php index 8c28b459bed..2ac7a6c8289 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Quote/Collection.php @@ -288,9 +288,9 @@ public function getSelectCountSql() $countSelect->resetJoinLeft(); if ($this->_selectCountSqlType == self::SELECT_COUNT_SQL_TYPE_CART) { - $countSelect->columns("COUNT(DISTINCT e.entity_id)"); + $countSelect->columns('COUNT(DISTINCT e.entity_id)'); } else { - $countSelect->columns("COUNT(DISTINCT main_table.entity_id)"); + $countSelect->columns('COUNT(DISTINCT main_table.entity_id)'); } return $countSelect; diff --git a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php index 3ac56d8df51..92aa5cab177 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php @@ -371,7 +371,7 @@ public function getStoreTZOffsetQuery($table, $column, $from = null, $to = null, return $column; } - $query = ""; + $query = ''; $periodsCount = count($periods); $i = 0; @@ -384,7 +384,7 @@ public function getStoreTZOffsetQuery($table, $column, $from = null, $to = null, $then = $this->_getWriteAdapter() ->getDateAddSql($column, $offset, Varien_Db_Adapter_Interface::INTERVAL_SECOND); - $query .= (++$i == $periodsCount) ? $then : "CASE WHEN " . implode(" OR ", $subParts) . " THEN $then ELSE "; + $query .= (++$i == $periodsCount) ? $then : 'CASE WHEN ' . implode(' OR ', $subParts) . " THEN $then ELSE "; } return $query . str_repeat('END ', count($periods) - 1); diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php index cfa8baa3ca1..4b36f9ec023 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Collection.php @@ -61,7 +61,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::LIMIT_COUNT); $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET); $countSelect->reset(Zend_Db_Select::COLUMNS); - $countSelect->columns("COUNT(main_table.review_id)"); + $countSelect->columns('COUNT(main_table.review_id)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php index 3d572772377..bc3c522d55f 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Review/Product/Collection.php @@ -111,7 +111,7 @@ public function getSelectCountSql() $countSelect = clone $select; $countSelect->reset(); - $countSelect->from($select, "COUNT(*)"); + $countSelect->from($select, 'COUNT(*)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php index 2028bd551ba..18a52825887 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tag/Customer/Collection.php @@ -51,7 +51,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::LIMIT_COUNT); $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET); $countSelect->reset(Zend_Db_Select::COLUMNS); - $countSelect->columns("COUNT(DISTINCT tr.customer_id)"); + $countSelect->columns('COUNT(DISTINCT tr.customer_id)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php index 15f438aed82..1a0a59a76c4 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Tax/Collection.php @@ -96,7 +96,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::COLUMNS); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::HAVING); - $countSelect->columns("COUNT(DISTINCT e.entity_id)"); + $countSelect->columns('COUNT(DISTINCT e.entity_id)'); return $countSelect; } } diff --git a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php index fd6ca60dd34..36dd6c98241 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php +++ b/app/code/core/Mage/Reports/Model/Resource/Wishlist/Product/Collection.php @@ -83,7 +83,7 @@ public function getSelectCountSql() $countSelect->reset(Zend_Db_Select::LIMIT_OFFSET); $countSelect->reset(Zend_Db_Select::GROUP); $countSelect->reset(Zend_Db_Select::COLUMNS); - $countSelect->columns("COUNT(*)"); + $countSelect->columns('COUNT(*)'); return $countSelect; } diff --git a/app/code/core/Mage/Reports/Model/Test.php b/app/code/core/Mage/Reports/Model/Test.php index b5196abfceb..3148f231b21 100644 --- a/app/code/core/Mage/Reports/Model/Test.php +++ b/app/code/core/Mage/Reports/Model/Test.php @@ -83,11 +83,11 @@ public function getAllLinearExample() $allData = []; $countOfStartData = 12; for ($i = 1; $i <= $countOfStartData; $i++) { - $allData[] = ['time' => date("Y-m-d H:i", $startPoint), 'value' => rand(1, 100)]; + $allData[] = ['time' => date('Y-m-d H:i', $startPoint), 'value' => rand(1, 100)]; $startPoint += 30 * 60; } - $allData[] = ['time' => date("Y-m-d H:i", $startPoint + (90 * 60))]; + $allData[] = ['time' => date('Y-m-d H:i', $startPoint + (90 * 60))]; $session -> setData('startPoint', $startPoint); @@ -106,11 +106,11 @@ public function getNewLinearData() $reset = 12; $newData = [ - ['time' => date("Y-m-d H:i", $startPoint), 'value' => rand(1, 100)] + ['time' => date('Y-m-d H:i', $startPoint), 'value' => rand(1, 100)] ]; $startPoint += 30 * 60; - $newData[] = ['time' => date("Y-m-d H:i", $startPoint + (90 * 60))]; + $newData[] = ['time' => date('Y-m-d H:i', $startPoint + (90 * 60))]; $session->setData('startPoint', $startPoint); @@ -126,10 +126,10 @@ private function returnAsDataSource(&$array, $reset = 0) { $dom = new DOMDocument(); $dom -> preserveWhiteSpace = false; - $dom -> loadXML("<" . "?xml version=\"1.0\" encoding=\"UTF-8\"?" . ">\n"); + $dom -> loadXML('<' . '?xml version="1.0" encoding="UTF-8"?' . ">\n"); $root = $dom ->documentElement; if ($reset) { - $resetItem = $dom -> createElement("reset"); + $resetItem = $dom -> createElement('reset'); $resetItem -> nodeValue = $reset; $root->appendChild($resetItem); } diff --git a/app/code/core/Mage/Reports/Model/Totals.php b/app/code/core/Mage/Reports/Model/Totals.php index 33f899cc705..35460eb8834 100644 --- a/app/code/core/Mage/Reports/Model/Totals.php +++ b/app/code/core/Mage/Reports/Model/Totals.php @@ -36,7 +36,7 @@ public function countTotals($grid, $from, $to) if ($col->getTotal() === null) { continue; } - $columns[$col->getIndex()] = ["total" => $col->getTotal(), "value" => 0]; + $columns[$col->getIndex()] = ['total' => $col->getTotal(), 'value' => 0]; } $count = 0; diff --git a/app/code/core/Mage/Review/Model/Resource/Review.php b/app/code/core/Mage/Review/Model/Resource/Review.php index fae7c100218..f04dd65e16f 100644 --- a/app/code/core/Mage/Review/Model/Resource/Review.php +++ b/app/code/core/Mage/Review/Model/Resource/Review.php @@ -147,7 +147,7 @@ protected function _afterSave(Mage_Core_Model_Abstract $object) $detailId = $adapter->fetchOne($select, [':review_id' => $object->getId()]); if ($detailId) { - $condition = ["detail_id = ?" => $detailId]; + $condition = ['detail_id = ?' => $detailId]; $adapter->update($this->_reviewDetailTable, $detail, $condition); } else { $detail['store_id'] = $object->getStoreId(); @@ -242,8 +242,8 @@ public function afterDeleteCommit(Mage_Core_Model_Abstract $object) 'review_count' => new Zend_Db_Expr('COUNT(*)') ] ) - ->where("entity_id = ?", $object->getEntityId()) - ->where("entity_pk_value = ?", $object->getEntityPkValue()); + ->where('entity_id = ?', $object->getEntityId()) + ->where('entity_pk_value = ?', $object->getEntityPkValue()); $total_reviews = $read_adapter->fetchOne($select); if ($total_reviews == 0) { $this->_getWriteAdapter()->delete($this->_aggregateTable, [ diff --git a/app/code/core/Mage/Rule/Model/Action/Abstract.php b/app/code/core/Mage/Rule/Model/Action/Abstract.php index a810922d2f7..130ad7db318 100644 --- a/app/code/core/Mage/Rule/Model/Action/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Action/Abstract.php @@ -89,10 +89,10 @@ public function asArray(array $arrAttributes = []) */ public function asXml() { - return "" . $this->getType() . "" - . "" . $this->getAttribute() . "" - . "" . $this->getOperator() . "" - . "" . $this->getValue() . ""; + return '' . $this->getType() . '' + . '' . $this->getAttribute() . '' + . '' . $this->getOperator() . '' + . '' . $this->getValue() . ''; } /** @@ -313,7 +313,7 @@ public function getRemoveLinkHtml() */ public function asString($format = '') { - return ""; + return ''; } /** diff --git a/app/code/core/Mage/Rule/Model/Action/Collection.php b/app/code/core/Mage/Rule/Model/Action/Collection.php index 20ee2500c0f..5e0322669dd 100644 --- a/app/code/core/Mage/Rule/Model/Action/Collection.php +++ b/app/code/core/Mage/Rule/Model/Action/Collection.php @@ -136,7 +136,7 @@ public function asHtmlRecursive() */ public function asString($format = '') { - return Mage::helper('rule')->__("Perform following actions"); + return Mage::helper('rule')->__('Perform following actions'); } /** diff --git a/app/code/core/Mage/Rule/Model/Condition/Combine.php b/app/code/core/Mage/Rule/Model/Condition/Combine.php index 79d4e693c38..afe1d64b717 100644 --- a/app/code/core/Mage/Rule/Model/Condition/Combine.php +++ b/app/code/core/Mage/Rule/Model/Condition/Combine.php @@ -51,7 +51,7 @@ public function prepareConditionSql() if (empty($wheres)) { return ''; } - $delimiter = $this->getAggregator() == "all" ? ' AND ' : ' OR '; + $delimiter = $this->getAggregator() == 'all' ? ' AND ' : ' OR '; return ' (' . implode($delimiter, $wheres) . ') '; } @@ -232,8 +232,8 @@ public function asArray(array $arrAttributes = []) */ public function asXml($containerKey = 'conditions', $itemKey = 'condition') { - $xml = "" . $this->getAggregator() . "" - . "" . $this->getValue() . "" + $xml = '' . $this->getAggregator() . '' + . '' . $this->getValue() . '' . "<$containerKey>"; foreach ($this->getConditions() as $condition) { $xml .= "<$itemKey>" . $condition->asXml() . ""; @@ -329,7 +329,7 @@ public function asHtmlRecursive() */ public function asString($format = '') { - return Mage::helper('rule')->__("If %s of these conditions are %s:", $this->getAggregatorName(), $this->getValueName()); + return Mage::helper('rule')->__('If %s of these conditions are %s:', $this->getAggregatorName(), $this->getValueName()); } /** diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php index 91a17e15b7f..3588c522507 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Default.php @@ -59,7 +59,7 @@ public function getItemOptions() public function getValueHtml($value) { if (is_array($value)) { - return sprintf('%d', $value['qty']) . ' x ' . $this->escapeHtml($value['title']) . " " + return sprintf('%d', $value['qty']) . ' x ' . $this->escapeHtml($value['title']) . ' ' . $this->getItem()->getOrder()->formatPrice($value['price']); } else { return $this->escapeHtml($value); diff --git a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php index 2b52c125759..fc76f78481b 100644 --- a/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php +++ b/app/code/core/Mage/Sales/Block/Order/Email/Items/Order/Default.php @@ -59,7 +59,7 @@ public function getItemOptions() public function getValueHtml($value) { if (is_array($value)) { - return sprintf('%d', $value['qty']) . ' x ' . $this->escapeHtml($value['title']) . " " + return sprintf('%d', $value['qty']) . ' x ' . $this->escapeHtml($value['title']) . ' ' . $this->getItem()->getOrder()->formatPrice($value['price']); } else { return $this->escapeHtml($value); diff --git a/app/code/core/Mage/Sales/Model/Observer.php b/app/code/core/Mage/Sales/Model/Observer.php index 9fd3f68e2df..0be7dd2ac34 100644 --- a/app/code/core/Mage/Sales/Model/Observer.php +++ b/app/code/core/Mage/Sales/Model/Observer.php @@ -111,7 +111,7 @@ public function markQuotesRecollectOnCatalogRules(Varien_Event_Observer $observe $product = $observer->getEvent()->getProduct(); if (is_numeric($product)) { - $product = Mage::getModel("catalog/product")->load($product); + $product = Mage::getModel('catalog/product')->load($product); } if ($product instanceof Mage_Catalog_Model_Product) { $childrenProductList = Mage::getSingleton('catalog/product_type')->factory($product) diff --git a/app/code/core/Mage/Sales/Model/Order/Api.php b/app/code/core/Mage/Sales/Model/Order/Api.php index f8d97f13fdb..9bbf7d519c0 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Api.php @@ -68,7 +68,7 @@ public function items($filters = null) $billingAliasName = 'billing_o_a'; $shippingAliasName = 'shipping_o_a'; - $orderCollection = Mage::getModel("sales/order")->getCollection(); + $orderCollection = Mage::getModel('sales/order')->getCollection(); $billingFirstnameField = "$billingAliasName.firstname"; $billingLastnameField = "$billingAliasName.lastname"; $shippingFirstnameField = "$shippingAliasName.firstname"; @@ -77,22 +77,22 @@ public function items($filters = null) ->addAddressFields() ->addExpressionFieldToSelect( 'billing_firstname', - "{{billing_firstname}}", + '{{billing_firstname}}', ['billing_firstname' => $billingFirstnameField] ) ->addExpressionFieldToSelect( 'billing_lastname', - "{{billing_lastname}}", + '{{billing_lastname}}', ['billing_lastname' => $billingLastnameField] ) ->addExpressionFieldToSelect( 'shipping_firstname', - "{{shipping_firstname}}", + '{{shipping_firstname}}', ['shipping_firstname' => $shippingFirstnameField] ) ->addExpressionFieldToSelect( 'shipping_lastname', - "{{shipping_lastname}}", + '{{shipping_lastname}}', ['shipping_lastname' => $shippingLastnameField] ) ->addExpressionFieldToSelect( diff --git a/app/code/core/Mage/Sales/Model/Order/Config.php b/app/code/core/Mage/Sales/Model/Order/Config.php index e30b9714775..44f2076cc25 100644 --- a/app/code/core/Mage/Sales/Model/Order/Config.php +++ b/app/code/core/Mage/Sales/Model/Order/Config.php @@ -153,7 +153,7 @@ public function getStates() public function getStateStatuses($state, $addLabels = true) { if (is_array($state)) { - $key = implode("|", $state) . $addLabels; + $key = implode('|', $state) . $addLabels; } else { $key = $state . $addLabels; } diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php index f88b39f3d28..dccf8f37865 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Item.php @@ -190,8 +190,8 @@ public function setQty($qty) /** * Check qty availability */ - $qtyToInvoice = sprintf("%F", $this->getOrderItem()->getQtyToInvoice()); - $qty = sprintf("%F", $qty); + $qtyToInvoice = sprintf('%F', $this->getOrderItem()->getQtyToInvoice()); + $qty = sprintf('%F', $qty); if ($qty <= $qtyToInvoice || $this->getOrderItem()->isDummy()) { $this->setData('qty', $qty); } else { diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php index cc54947be8d..4561ae0b327 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Abstract.php @@ -438,8 +438,8 @@ protected function insertOrder(&$page, $obj, $putOrderId = true) } $yShipments = $this->y; - $totalShippingChargesText = "(" . Mage::helper('sales')->__('Total Shipping Charges') . " " - . $order->formatPriceTxt($order->getShippingAmount()) . ")"; + $totalShippingChargesText = '(' . Mage::helper('sales')->__('Total Shipping Charges') . ' ' + . $order->formatPriceTxt($order->getShippingAmount()) . ')'; $page->drawText($totalShippingChargesText, 285, $yShipments - $topMargin, 'UTF-8'); $yShipments -= $topMargin + 10; @@ -663,7 +663,7 @@ protected function _formatOptionValue($value, $order) $resultValue .= $value['title']; if (isset($value['price'])) { - $resultValue .= " " . $order->formatPrice($value['price']); + $resultValue .= ' ' . $order->formatPrice($value['price']); } return $resultValue; } else { diff --git a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php index 7f76f850a57..79dd95e47eb 100644 --- a/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php +++ b/app/code/core/Mage/Sales/Model/Order/Pdf/Items/Abstract.php @@ -211,7 +211,7 @@ protected function _formatOptionValue($value) $resultValue .= $value['title']; if (isset($value['price'])) { - $resultValue .= " " . $order->formatPrice($value['price']); + $resultValue .= ' ' . $order->formatPrice($value['price']); } return $resultValue; } else { diff --git a/app/code/core/Mage/Sales/Model/Recurring/Profile.php b/app/code/core/Mage/Sales/Model/Recurring/Profile.php index e6c8c5895cf..fa81c529470 100644 --- a/app/code/core/Mage/Sales/Model/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Model/Recurring/Profile.php @@ -639,7 +639,7 @@ protected function _getItem($itemInfo) { $paymentType = $itemInfo->getPaymentType(); if (!$paymentType) { - throw new Exception("Recurring profile payment type is not specified."); + throw new Exception('Recurring profile payment type is not specified.'); } switch ($paymentType) { diff --git a/app/code/core/Mage/Sales/Model/Resource/Order.php b/app/code/core/Mage/Sales/Model/Resource/Order.php index cb853aa8d38..9adad48e276 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order.php @@ -136,7 +136,7 @@ public function getIncrementId($orderId) $adapter = $this->getReadConnection(); $bind = [':entity_id' => $orderId]; $select = $adapter->select() - ->from($this->getMainTable(), ["increment_id"]) + ->from($this->getMainTable(), ['increment_id']) ->where('entity_id = :entity_id'); return $adapter->fetchOne($select, $bind); } diff --git a/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php index ddf9a89208a..98de0296819 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Order/Item/Collection.php @@ -129,7 +129,7 @@ public function filterByParent($parentId = null) public function addAvailableFilter() { $fieldExpression = '(qty_shipped - qty_returned)'; - $resultCondition = $this->_getConditionSql($fieldExpression, ["gt" => 0]); + $resultCondition = $this->_getConditionSql($fieldExpression, ['gt' => 0]); $this->getSelect()->where($resultCondition); return $this; } diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php index 43d089aa854..64cbd84da9c 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.8.13-0.8.14.php @@ -218,7 +218,7 @@ $installer->run("UPDATE {$this->getTable('sales_order_entity')} SET parent_id={$new_entity_id} WHERE parent_id={$old_entity_id}"); - $tables = ["varchar", "int", "datetime", "text", "decimal"]; + $tables = ['varchar', 'int', 'datetime', 'text', 'decimal']; foreach ($tables as $table) { $delete = []; $attrs = $installer->getConnection()->fetchAll("SELECT tt.* FROM {$this->getTable('sales_order_entity')}_{$table} tt JOIN eav_attribute on eav_attribute.attribute_id = tt.attribute_id WHERE entity_id={$old_entity_id}"); diff --git a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php index 17360573c36..1ea2f9a34fc 100644 --- a/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php +++ b/app/code/core/Mage/Sales/sql/sales_setup/mysql4-upgrade-0.9.46-0.9.47.php @@ -25,7 +25,7 @@ $installer->getAttribute($orderEntityTypeId, 'shipping_description') ]; -$installer->getConnection()->addColumn($this->getTable('sales_order'), $attributes[0]['attribute_code'], "tinyint(1) UNSIGNED NOT NULL DEFAULT 0"); +$installer->getConnection()->addColumn($this->getTable('sales_order'), $attributes[0]['attribute_code'], 'tinyint(1) UNSIGNED NOT NULL DEFAULT 0'); $installer->getConnection()->addColumn($this->getTable('sales_order'), $attributes[1]['attribute_code'], "varchar(255) NOT NULL DEFAULT ''"); try { diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php index 1733189d91c..aab91530b7e 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Found.php @@ -48,7 +48,7 @@ public function loadValueOptions() */ public function asHtml() { - $html = $this->getTypeElement()->getHtml() . Mage::helper('salesrule')->__("If an item is %s in the cart with %s of these conditions true:", $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); + $html = $this->getTypeElement()->getHtml() . Mage::helper('salesrule')->__('If an item is %s in the cart with %s of these conditions true:', $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); if ($this->getId() != '1') { $html .= $this->getRemoveLinkHtml(); } diff --git a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php index bd72f283463..02a0c54a9f2 100644 --- a/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php +++ b/app/code/core/Mage/SalesRule/Model/Rule/Condition/Product/Subselect.php @@ -108,7 +108,7 @@ public function getValueElementType() public function asHtml() { $html = $this->getTypeElement()->getHtml() . - Mage::helper('salesrule')->__("If %s %s %s for a subselection of items in cart matching %s of these conditions:", $this->getAttributeElement()->getHtml(), $this->getOperatorElement()->getHtml(), $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); + Mage::helper('salesrule')->__('If %s %s %s for a subselection of items in cart matching %s of these conditions:', $this->getAttributeElement()->getHtml(), $this->getOperatorElement()->getHtml(), $this->getValueElement()->getHtml(), $this->getAggregatorElement()->getHtml()); if ($this->getId() != '1') { $html .= $this->getRemoveLinkHtml(); } diff --git a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php index c1ceeb0afeb..3f9175e6147 100644 --- a/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/SalesRule/sql/salesrule_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -36,7 +36,7 @@ $conn->update( $this->getTable('salesrule'), ['website_ids' => implode(',', array_keys($websiteIds))], - "rule_id=" . $r['rule_id'] + 'rule_id=' . $r['rule_id'] ); } $conn->dropColumn($this->getTable('salesrule'), 'store_ids'); diff --git a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php index 912ee11617f..1e4854703f5 100644 --- a/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/core/Mage/Shipping/Model/Resource/Carrier/Tablerate.php @@ -112,7 +112,7 @@ public function getRate(Mage_Shipping_Model_Rate_Request $request) ->limit(1); $conditions = [ - "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode", + 'dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = :postcode', "dest_country_id = :country_id AND dest_region_id = :region_id AND dest_zip = ''", "dest_country_id = :country_id AND dest_region_id = '0' AND dest_zip = :postcode", "dest_country_id = '0' AND dest_region_id = :region_id AND dest_zip = :postcode", @@ -397,7 +397,7 @@ protected function _getImportRow($row, $rowNumber = 0) } // protect from duplicate - $hash = sprintf("%s-%d-%s-%F", $countryId, $regionId, $zipCode, $value); + $hash = sprintf('%s-%d-%s-%F', $countryId, $regionId, $zipCode, $value); if (isset($this->_importUniqueHash[$hash])) { $this->_importErrors[] = Mage::helper('shipping')->__('Duplicate Row #%s (Country "%s", Region/State "%s", Zip "%s" and Value "%s").', $rowNumber, $row[0], $row[1], $zipCode, $value); return false; diff --git a/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php b/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php index bf174bd0857..b551409dfc8 100644 --- a/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php +++ b/app/code/core/Mage/Tag/Model/Resource/Tag/Relation.php @@ -118,7 +118,7 @@ public function getRelatedTagIds($model) $productIds = (is_array($model->getProductId())) ? $model->getProductId() : [$model->getProductId()]; $select = $this->_getReadAdapter()->select() ->from($this->getMainTable(), 'tag_id') - ->where("product_id IN(?)", $productIds) + ->where('product_id IN(?)', $productIds) ->order('tag_id'); return $this->_getReadAdapter()->fetchCol($select); } diff --git a/app/code/core/Mage/Tax/Helper/Data.php b/app/code/core/Mage/Tax/Helper/Data.php index 82012c90f7e..88dbf246ad8 100644 --- a/app/code/core/Mage/Tax/Helper/Data.php +++ b/app/code/core/Mage/Tax/Helper/Data.php @@ -833,7 +833,7 @@ public function getPriceTaxSql($priceField, $taxClassField) $$rateVariable = ''; foreach ($$rateArray as $classId => $rate) { if ($rate) { - $$rateVariable .= sprintf("WHEN %d THEN %12.4f ", $classId, $rate / 100); + $$rateVariable .= sprintf('WHEN %d THEN %12.4f ', $classId, $rate / 100); } } if ($$rateVariable) { diff --git a/app/code/core/Mage/Tax/Model/Resource/Calculation.php b/app/code/core/Mage/Tax/Model/Resource/Calculation.php index 9c1cc5d7284..d73a7bcc559 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Calculation.php +++ b/app/code/core/Mage/Tax/Model/Resource/Calculation.php @@ -292,12 +292,12 @@ protected function _getRates($request) ) ->joinLeft( ['title_table' => $this->getTable('tax/tax_calculation_rate_title')], - "rate.tax_calculation_rate_id = title_table.tax_calculation_rate_id " + 'rate.tax_calculation_rate_id = title_table.tax_calculation_rate_id ' . "AND title_table.store_id = '{$storeId}'", ['title' => $ifnullTitleValue] ) ->where('rate.tax_country_id = ?', $countryId) - ->where("rate.tax_region_id IN(?)", [0, (int)$regionId]); + ->where('rate.tax_region_id IN(?)', [0, (int)$regionId]); $postcodeIsNumeric = is_numeric($postcode); $postcodeIsRange = false; if (preg_match('/^(.+)-(.+)$/', $postcode, $matches)) { @@ -371,7 +371,7 @@ public function getApplicableRateIds($request) $select = $this->_getReadAdapter()->select() ->from(['rate' => $this->getTable('tax/tax_calculation_rate')], ['tax_calculation_rate_id']) ->where('rate.tax_country_id = ?', $countryId) - ->where("rate.tax_region_id IN(?)", [0, (int)$regionId]); + ->where('rate.tax_region_id IN(?)', [0, (int)$regionId]); $expr = $this->_getWriteAdapter()->getCheckSql( 'zip_is_range is NULL', diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php index 1787bc436b7..2c32d013709 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.4-0.7.5.php @@ -27,7 +27,7 @@ $installer->run( "UPDATE {$installer->getTable('customer_group')} SET tax_class_id = {$customerTaxClassIds[0]} - WHERE tax_class_id NOT IN (" . implode(',', $customerTaxClassIds) . ")" + WHERE tax_class_id NOT IN (" . implode(',', $customerTaxClassIds) . ')' ); } diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php index 2ab25630bb3..279d5d8696d 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.7-0.7.8.php @@ -17,6 +17,6 @@ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('sales_order_tax'), 'hidden', "smallint (5) unsigned not null default 0"); +$installer->getConnection()->addColumn($installer->getTable('sales_order_tax'), 'hidden', 'smallint (5) unsigned not null default 0'); $installer->endSetup(); diff --git a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php index e93d93573b1..313641716bc 100644 --- a/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php +++ b/app/code/core/Mage/Tax/sql/tax_setup/mysql4-upgrade-0.7.9-0.7.10.php @@ -19,9 +19,9 @@ $table = $installer->getTable('tax_calculation_rate'); -$installer->getConnection()->addColumn($table, 'zip_is_range', "TINYINT(1) DEFAULT NULL"); -$installer->getConnection()->addColumn($table, 'zip_from', "VARCHAR(10) DEFAULT NULL"); -$installer->getConnection()->addColumn($table, 'zip_to', "VARCHAR(10) DEFAULT NULL"); +$installer->getConnection()->addColumn($table, 'zip_is_range', 'TINYINT(1) DEFAULT NULL'); +$installer->getConnection()->addColumn($table, 'zip_from', 'VARCHAR(10) DEFAULT NULL'); +$installer->getConnection()->addColumn($table, 'zip_to', 'VARCHAR(10) DEFAULT NULL'); $installer->getConnection()->addKey($table, 'IDX_TAX_CALCULATION_RATE_RANGE', ['tax_calculation_rate_id', 'tax_country_id', 'tax_region_id', 'zip_is_range', 'tax_postcode']); diff --git a/app/code/core/Mage/Uploader/Model/Config/Abstract.php b/app/code/core/Mage/Uploader/Model/Config/Abstract.php index 2bee5f1a347..906801629f0 100644 --- a/app/code/core/Mage/Uploader/Model/Config/Abstract.php +++ b/app/code/core/Mage/Uploader/Model/Config/Abstract.php @@ -56,6 +56,6 @@ public function __call($method, $args) case 'has': return isset($this->_data[$key]); } - throw new Varien_Exception("Invalid method " . get_class($this) . "::" . $method . "(" . print_r($args, 1) . ")"); + throw new Varien_Exception('Invalid method ' . get_class($this) . '::' . $method . '(' . print_r($args, 1) . ')'); } } diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php index 17b72682502..33b38946200 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php @@ -1070,7 +1070,7 @@ protected function _parseXmlTrackingResponse($trackings, $response) */ $rArr['service'] = (string)$txml->Service->Desc; if (isset($txml->Weight)) { - $rArr['weight'] = (string)$txml->Weight . " lbs"; + $rArr['weight'] = (string)$txml->Weight . ' lbs'; } if (isset($txml->Delivery)) { $rArr['deliverydate'] = (string)$txml->Delivery->Date; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php index 8700e0181ed..0e3953c2a74 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/International.php @@ -799,7 +799,7 @@ protected function _getQuotes() $code = $bodyXml->xpath('//GetQuoteResponse/Note/Condition/ConditionCode'); if (isset($code[0]) && (int)$code[0] == self::CONDITION_CODE_SERVICE_DATE_UNAVAILABLE) { $debugPoint['info'] = sprintf( - Mage::helper('usa')->__("DHL service is not available at %s date"), + Mage::helper('usa')->__('DHL service is not available at %s date'), $date ); } else { @@ -886,7 +886,7 @@ protected function _buildQuotesRequestXml() $nodeDutiable = $nodeGetQuote->addChild('Dutiable'); $baseCurrencyCode = Mage::app()->getWebsite($this->_request->getWebsiteId())->getBaseCurrencyCode(); $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); - $nodeDutiable->addChild('DeclaredValue', sprintf("%.2F", $rawRequest->getValue())); + $nodeDutiable->addChild('DeclaredValue', sprintf('%.2F', $rawRequest->getValue())); } return $xml; } @@ -1026,7 +1026,7 @@ protected function _addRate(SimpleXMLElement $shipmentDetails) } if (!isset($rates[$currencyCode]) || !$totalEstimate) { $totalEstimate = false; - $this->_errors[] = Mage::helper('usa')->__("Exchange rate %s (Base Currency) -> %s not found. DHL method %s skipped", $currencyCode, $baseCurrencyCode, $dhlProductDescription); + $this->_errors[] = Mage::helper('usa')->__('Exchange rate %s (Base Currency) -> %s not found. DHL method %s skipped', $currencyCode, $baseCurrencyCode, $dhlProductDescription); } } } @@ -1051,7 +1051,7 @@ protected function _addRate(SimpleXMLElement $shipmentDetails) if (isset($shipmentDetails->GlobalProductCode)) { $dhlProductDescription = $this->getDhlProductTitle((string)$shipmentDetails->GlobalProductCode); } - $dhlProductDescription = $dhlProductDescription ? $dhlProductDescription : Mage::helper('usa')->__("DHL"); + $dhlProductDescription = $dhlProductDescription ? $dhlProductDescription : Mage::helper('usa')->__('DHL'); $this->_errors[] = Mage::helper('usa')->__("Zero shipping charge for '%s'", $dhlProductDescription); } return $this; @@ -1067,7 +1067,7 @@ protected function _getDimensionUnit() $countryId = $this->_rawRequest->getOrigCountryId(); $measureUnit = $this->getCountryParams($countryId)->getMeasureUnit(); if (empty($measureUnit)) { - Mage::throwException(Mage::helper('usa')->__("Cannot identify measure unit for %s", $countryId)); + Mage::throwException(Mage::helper('usa')->__('Cannot identify measure unit for %s', $countryId)); } return $measureUnit; } @@ -1082,7 +1082,7 @@ protected function _getWeightUnit() $countryId = $this->_rawRequest->getOrigCountryId(); $weightUnit = $this->getCountryParams($countryId)->getWeightUnit(); if (empty($weightUnit)) { - Mage::throwException(Mage::helper('usa')->__("Cannot identify weight unit for %s", $countryId)); + Mage::throwException(Mage::helper('usa')->__('Cannot identify weight unit for %s', $countryId)); } return $weightUnit; } @@ -1235,7 +1235,7 @@ protected function _mapRequestToShipment(Varien_Object $request) */ protected function _getMinDimension($dimensionUnit) { - return $dimensionUnit == "CENTIMETER" ? self::DIMENSION_MIN_CM : self::DIMENSION_MIN_IN; + return $dimensionUnit == 'CENTIMETER' ? self::DIMENSION_MIN_CM : self::DIMENSION_MIN_IN; } /** @@ -1345,7 +1345,7 @@ protected function _doRequest() $nodeDutiable = $xml->addChild('Dutiable', '', ''); $nodeDutiable->addChild( 'DeclaredValue', - sprintf("%.2F", $rawRequest->getOrderShipment()->getOrder()->getSubtotal()) + sprintf('%.2F', $rawRequest->getOrderShipment()->getOrder()->getSubtotal()) ); $baseCurrencyCode = Mage::app()->getWebsite($rawRequest->getWebsiteId())->getBaseCurrencyCode(); $nodeDutiable->addChild('DeclaredCurrency', $baseCurrencyCode); diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php index f8e83f80c7a..4c1de7f7ca2 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl/Label/Pdf/PageBuilder.php @@ -194,7 +194,7 @@ public function addProductContentCode($code) $this->_y(28), Zend_Pdf_Page::SHAPE_DRAW_FILL ); - $this->_page->setFillColor(new Zend_Pdf_Color_Html("#ffffff")); + $this->_page->setFillColor(new Zend_Pdf_Color_Html('#ffffff')); $font = $this->_fontBold; } else { $font = $this->_fontNormal; @@ -258,7 +258,7 @@ public function addSenderInfo(SimpleXMLElement $sender) $phoneNumber = implode(' ', array_filter([(string)$sender->Contact->PhoneNumber, (string)$sender->Contact->PhoneExtension])); - $phoneNumber = $phoneNumber ? "Phone: " . $phoneNumber : ''; + $phoneNumber = $phoneNumber ? 'Phone: ' . $phoneNumber : ''; $pageY = $this->_drawSenderAddress($sender->AddressLine, $phoneNumber); $divisionCode = (string)(strlen($sender->DivisionCode) ? $sender->DivisionCode . ' ' : null); @@ -325,7 +325,7 @@ public function addOriginInfo($serviceAreaCode) } $this->_page->saveGS(); $this->_page->setFont($this->_fontNormal, 6); - $this->_page->drawText("Origin:", $this->_x(260), $this->_y(36)); + $this->_page->drawText('Origin:', $this->_x(260), $this->_y(36)); $this->_page->setFont($this->_fontBold, 9); $this->_page->drawText($serviceAreaCode, $this->_x(260), $this->_y(45)); @@ -344,7 +344,7 @@ public function addReceiveInfo(SimpleXMLElement $consignee) $this->_page->saveGS(); $this->_page->setFont($this->_fontNormal, 9); - $this->_page->drawText("To:", $this->_x(5), $this->_y(92)); + $this->_page->drawText('To:', $this->_x(5), $this->_y(92)); $this->_page->drawText($consignee->CompanyName, $this->_x(20), $this->_y(90)); $y = $this->_page->drawLines($consignee->AddressLine, $this->_x(19), $this->_y(100), 50); @@ -500,7 +500,7 @@ public function addWeightInfo($weight, $unit) { $this->_page->saveGS(); - $units = ["K" => 'kg', "L" => 'lb']; + $units = ['K' => 'kg', 'L' => 'lb']; if (!isset($units[$unit])) { throw new InvalidArgumentException(Mage::helper('usa')->__('Weight unit is invalid')); } @@ -560,12 +560,12 @@ public function addWaybillBarcode($number, $barCode) if (!strlen($number) || !strlen($barCode)) { throw new InvalidArgumentException(Mage::helper('usa')->__('Waybill barcode information is missing')); } - $image = new Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode); + $image = new Zend_Pdf_Resource_Image_Png('data://image/png;base64,' . $barCode); $this->_page->drawImage($image, $this->_x(0), $this->_y(296), $this->_x(232), $this->_y(375)); $this->_page->setFont($this->_fontNormal, 9); $number = substr($number, 0, 2) . ' ' . substr($number, 2, 4) . ' ' . substr($number, 6, 4); - $this->_page->drawText("WAYBILL " . $number, $this->_x(13.5), $this->_y(382)); + $this->_page->drawText('WAYBILL ' . $number, $this->_x(13.5), $this->_y(382)); $this->_page->restoreGS(); return $this; @@ -588,7 +588,7 @@ public function addRoutingBarcode($routingCode, $id, $barCode) throw new InvalidArgumentException(Mage::helper('usa')->__('Routing barcode is missing')); } - $image = new Zend_Pdf_Resource_Image_Png("data://image/png;base64," . $barCode); + $image = new Zend_Pdf_Resource_Image_Png('data://image/png;base64,' . $barCode); $this->_page->drawImage($image, $this->_x(0), $this->_y(386), $this->_x(232), $this->_y(465)); $this->_page->setFont($this->_fontNormal, 9); diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php index ee3bdb4ce14..fc52347002f 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -480,7 +480,7 @@ protected function _prepareRateResponse($response) $errorTitle = (string)$response->Notifications->Message; } } elseif (isset($response->RateReplyDetails)) { - $allowedMethods = explode(",", $this->getConfigData('allowed_methods')); + $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); if (is_array($response->RateReplyDetails)) { foreach ($response->RateReplyDetails as $rate) { @@ -686,7 +686,7 @@ protected function _parseXmlResponse($response) $errorTitle = 'Unknown error'; } - $allowedMethods = explode(",", $this->getConfigData('allowed_methods')); + $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); foreach ($xml->Entry as $entry) { if (in_array((string)$entry->Service, $allowedMethods)) { diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php index 61090b27a62..acf390d2397 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -507,11 +507,11 @@ public function getCode($type, $code = '') ], 'pickup' => [ - 'RDP' => ["label" => 'Regular Daily Pickup',"code" => "01"], - 'OCA' => ["label" => 'On Call Air',"code" => "07"], - 'OTP' => ["label" => 'One Time Pickup',"code" => "06"], - 'LC' => ["label" => 'Letter Center',"code" => "19"], - 'CC' => ["label" => 'Customer Counter',"code" => "03"], + 'RDP' => ['label' => 'Regular Daily Pickup','code' => '01'], + 'OCA' => ['label' => 'On Call Air','code' => '07'], + 'OTP' => ['label' => 'One Time Pickup','code' => '06'], + 'LC' => ['label' => 'Letter Center','code' => '19'], + 'CC' => ['label' => 'Customer Counter','code' => '03'], ], 'container' => [ @@ -711,10 +711,10 @@ protected function _getXmlQuotes() XMLRequest; if ($params['serviceCode'] !== null) { - $xmlRequest .= "" . + $xmlRequest .= '' . "{$params['serviceCode']}" . "{$params['serviceDescription']}" . - ""; + ''; } $xmlRequest .= <<< XMLRequest @@ -781,7 +781,7 @@ protected function _getXmlQuotes() XMLRequest; if ($this->getConfigFlag('negotiated_active')) { - $xmlRequest .= ""; + $xmlRequest .= ''; } $xmlRequest .= <<< XMLRequest @@ -845,14 +845,14 @@ protected function _parseXmlResponse($xmlResponse) if (strlen(trim($xmlResponse)) > 0) { $xml = new Varien_Simplexml_Config(); $xml->loadString($xmlResponse); - $arr = $xml->getXpath("//RatingServiceSelectionResponse/Response/ResponseStatusCode/text()"); + $arr = $xml->getXpath('//RatingServiceSelectionResponse/Response/ResponseStatusCode/text()'); $success = (int)$arr[0]; if ($success === 1) { - $arr = $xml->getXpath("//RatingServiceSelectionResponse/RatedShipment"); - $allowedMethods = explode(",", $this->getConfigData('allowed_methods')); + $arr = $xml->getXpath('//RatingServiceSelectionResponse/RatedShipment'); + $allowedMethods = explode(',', $this->getConfigData('allowed_methods')); // Negotiated rates - $negotiatedArr = $xml->getXpath("//RatingServiceSelectionResponse/RatedShipment/NegotiatedRates"); + $negotiatedArr = $xml->getXpath('//RatingServiceSelectionResponse/RatedShipment/NegotiatedRates'); $negotiatedActive = $this->getConfigFlag('negotiated_active') && $this->getConfigData('shipper_number') && !empty($negotiatedArr); @@ -891,7 +891,7 @@ protected function _parseXmlResponse($xmlResponse) } } } else { - $arr = $xml->getXpath("//RatingServiceSelectionResponse/Response/Error/ErrorDescription/text()"); + $arr = $xml->getXpath('//RatingServiceSelectionResponse/Response/Error/ErrorDescription/text()'); $errorTitle = (string)$arr[0][0]; $error = Mage::getModel('shipping/rate_result_error'); $error->setCarrier('ups'); @@ -1045,25 +1045,25 @@ protected function _parseXmlTrackingResponse($trackingvalue, $xmlResponse) if ($xmlResponse) { $xml = new Varien_Simplexml_Config(); $xml->loadString($xmlResponse); - $arr = $xml->getXpath("//TrackResponse/Response/ResponseStatusCode/text()"); + $arr = $xml->getXpath('//TrackResponse/Response/ResponseStatusCode/text()'); $success = (int)$arr[0][0]; if ($success === 1) { - $arr = $xml->getXpath("//TrackResponse/Shipment/Service/Description/text()"); + $arr = $xml->getXpath('//TrackResponse/Shipment/Service/Description/text()'); $resultArr['service'] = (string)$arr[0]; - $arr = $xml->getXpath("//TrackResponse/Shipment/PickupDate/text()"); + $arr = $xml->getXpath('//TrackResponse/Shipment/PickupDate/text()'); $resultArr['shippeddate'] = (string)$arr[0]; - $arr = $xml->getXpath("//TrackResponse/Shipment/Package/PackageWeight/Weight/text()"); + $arr = $xml->getXpath('//TrackResponse/Shipment/Package/PackageWeight/Weight/text()'); $weight = (string)$arr[0]; - $arr = $xml->getXpath("//TrackResponse/Shipment/Package/PackageWeight/UnitOfMeasurement/Code/text()"); + $arr = $xml->getXpath('//TrackResponse/Shipment/Package/PackageWeight/UnitOfMeasurement/Code/text()'); $unit = (string)$arr[0]; $resultArr['weight'] = "{$weight} {$unit}"; - $activityTags = $xml->getXpath("//TrackResponse/Shipment/Package/Activity"); + $activityTags = $xml->getXpath('//TrackResponse/Shipment/Package/Activity'); if ($activityTags) { $i = 1; foreach ($activityTags as $activityTag) { @@ -1113,7 +1113,7 @@ protected function _parseXmlTrackingResponse($trackingvalue, $xmlResponse) $resultArr['progressdetail'] = $packageProgress; } } else { - $arr = $xml->getXpath("//TrackResponse/Response/Error/ErrorDescription/text()"); + $arr = $xml->getXpath('//TrackResponse/Response/Error/ErrorDescription/text()'); $errorTitle = (string)$arr[0][0]; } } @@ -1147,7 +1147,7 @@ protected function _getRestTracking($trackings) return $this->_trackingResult; } - $version = "v1"; + $version = 'v1'; $query = http_build_query([ 'locale' => 'en_US', 'returnSignature' => 'false', @@ -1654,7 +1654,7 @@ protected function _doShipmentRequestRest(Varien_Object $request): Varien_Object /** Rest API Payload */ $headers = [ "Authorization: Bearer $accessToken", - "Content-Type: application/json" + 'Content-Type: application/json' ]; $debugData = [ 'request' => $rawJsonRequest @@ -1764,25 +1764,25 @@ protected function _formShipmentRestRequest(Varien_Object $request): string /** Shipment API Payload */ $shipParams = [ - "ShipmentRequest" => [ - "Request" => [ - "SubVersion" => "1801", - "RequestOption" => "nonvalidate", - "TransactionReference" => [ - "CustomerContext" => "Shipment Request" + 'ShipmentRequest' => [ + 'Request' => [ + 'SubVersion' => '1801', + 'RequestOption' => 'nonvalidate', + 'TransactionReference' => [ + 'CustomerContext' => 'Shipment Request' ] ], - "Shipment" => [ - "Description" => $shipmentDescription, - "Shipper" => [], - "ShipTo" => [], - "ShipFrom" => [], - "PaymentInformation" => [], - "Service" => [], - "Package" => [], - "ShipmentServiceOptions" => [] + 'Shipment' => [ + 'Description' => $shipmentDescription, + 'Shipper' => [], + 'ShipTo' => [], + 'ShipFrom' => [], + 'PaymentInformation' => [], + 'Service' => [], + 'Package' => [], + 'ShipmentServiceOptions' => [] ], - "LabelSpecification" => [] + 'LabelSpecification' => [] ] ]; if ($request->getIsReturn()) { @@ -1914,7 +1914,7 @@ protected function _formShipmentRestRequest(Varien_Object $request): string = $deliveryConfirmation; } - $shipParams['ShipmentRequest']['Shipment']['PaymentInformation']['ShipmentCharge']['Type'] = "01"; + $shipParams['ShipmentRequest']['Shipment']['PaymentInformation']['ShipmentCharge']['Type'] = '01'; $shipParams['ShipmentRequest']['Shipment']['PaymentInformation']['ShipmentCharge']['BillShipper'] ['AccountNumber'] = $this->getConfigData('shipper_number'); @@ -2204,38 +2204,38 @@ protected function _getRestQuotes() } $rateParams = [ - "RateRequest" => [ - "Request" => [ - "TransactionReference" => [ - "CustomerContext" => "Rating and Service" + 'RateRequest' => [ + 'Request' => [ + 'TransactionReference' => [ + 'CustomerContext' => 'Rating and Service' ] ], - "Shipment" => [ - "Shipper" => [ - "Name" => "UPS", - "ShipperNumber" => "{$shipperNumber}", - "Address" => [ - "AddressLine" => [], - "City" => "{$shipperCity}", - "StateProvinceCode" => "{$shipperStateProvince}", - "PostalCode" => "{$shipperPostalCode}", - "CountryCode" => "{$shipperCountryCode}" + 'Shipment' => [ + 'Shipper' => [ + 'Name' => 'UPS', + 'ShipperNumber' => "{$shipperNumber}", + 'Address' => [ + 'AddressLine' => [], + 'City' => "{$shipperCity}", + 'StateProvinceCode' => "{$shipperStateProvince}", + 'PostalCode' => "{$shipperPostalCode}", + 'CountryCode' => "{$shipperCountryCode}" ] ], - "ShipTo" => [ - "Address" => [ - "AddressLine" => ["{$params['49_residential']}"], - "StateProvinceCode" => "{$params['destRegionCode']}", - "PostalCode" => "{$params['19_destPostal']}", - "CountryCode" => "{$params['22_destCountry']}" + 'ShipTo' => [ + 'Address' => [ + 'AddressLine' => ["{$params['49_residential']}"], + 'StateProvinceCode' => "{$params['destRegionCode']}", + 'PostalCode' => "{$params['19_destPostal']}", + 'CountryCode' => "{$params['22_destCountry']}" ] ], - "ShipFrom" => [ - "Address" => [ - "AddressLine" => [], - "StateProvinceCode" => "{$params['origRegionCode']}", - "PostalCode" => "{$params['15_origPostal']}", - "CountryCode" => "{$params['14_origCountry']}" + 'ShipFrom' => [ + 'Address' => [ + 'AddressLine' => [], + 'StateProvinceCode' => "{$params['origRegionCode']}", + 'PostalCode' => "{$params['15_origPostal']}", + 'CountryCode' => "{$params['14_origCountry']}" ] ], ] @@ -2247,11 +2247,11 @@ protected function _getRestQuotes() } if ($this->getConfigFlag('negotiated_active')) { - $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['TPFCNegotiatedRatesIndicator'] = "Y"; - $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['NegotiatedRatesIndicator'] = "Y"; + $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['TPFCNegotiatedRatesIndicator'] = 'Y'; + $rateParams['RateRequest']['Shipment']['ShipmentRatingOptions']['NegotiatedRatesIndicator'] = 'Y'; } if ($this->getConfigFlag('include_taxes')) { - $rateParams['RateRequest']['Shipment']['TaxInformationIndicator'] = "Y"; + $rateParams['RateRequest']['Shipment']['TaxInformationIndicator'] = 'Y'; } if ($serviceCode !== null) { @@ -2260,41 +2260,41 @@ protected function _getRestQuotes() } $rateParams['RateRequest']['Shipment']['Package'][] = [ - "PackagingType" => [ - "Code" => "{$params['48_container']}", - "Description" => "Packaging" + 'PackagingType' => [ + 'Code' => "{$params['48_container']}", + 'Description' => 'Packaging' ], - "Dimensions" => [ - "UnitOfMeasurement" => [ - "Code" => $rowRequest->getUnitDimensions(), - "Description" => $rowRequest->getUnitDimensionsDescription() + 'Dimensions' => [ + 'UnitOfMeasurement' => [ + 'Code' => $rowRequest->getUnitDimensions(), + 'Description' => $rowRequest->getUnitDimensionsDescription() ], - "Length" => "5", - "Width" => "5", - "Height" => "5" + 'Length' => '5', + 'Width' => '5', + 'Height' => '5' ], - "PackageWeight" => [ - "UnitOfMeasurement" => [ - "Code" => "{$rowRequest->getUnitMeasure()}" + 'PackageWeight' => [ + 'UnitOfMeasurement' => [ + 'Code' => "{$rowRequest->getUnitMeasure()}" ], - "Weight" => "{$params['23_weight']}" + 'Weight' => "{$params['23_weight']}" ] ]; $ratePayload = json_encode($rateParams, JSON_PRETTY_PRINT); /** Rest API Payload */ - $version = "v1"; + $version = 'v1'; $requestOption = $params['10_action']; $headers = [ "Authorization: Bearer $accessToken", - "Content-Type: application/json" + 'Content-Type: application/json' ]; $debugData = [ 'request' => $ratePayload ]; $ch = curl_init(); - curl_setopt($ch, CURLOPT_URL, $url . $version . "/" . $requestOption); + curl_setopt($ch, CURLOPT_URL, $url . $version . '/' . $requestOption); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_POST, 1); @@ -2332,7 +2332,7 @@ protected function _parseRestResponse(string $rateResponse) // Handling cases where a single service is returned by UPS $arr = [$arr]; } - $allowedMethods = explode(",", $this->getConfigData('allowed_methods') ?? ''); + $allowedMethods = explode(',', $this->getConfigData('allowed_methods') ?? ''); $allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies(); foreach ($arr as $shipElement) { $negotiatedArr = $shipElement['NegotiatedRateCharges'] ?? [] ; diff --git a/app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php b/app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php index 90ea30540f8..d8d974ea6ad 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/UpsAuth.php @@ -40,9 +40,9 @@ public function getAccessToken(string $clientId, string $clientSecret, string $c } $headers = [ - "Content-Type: application/x-www-form-urlencoded", + 'Content-Type: application/x-www-form-urlencoded', "x-merchant-id: $clientId", - "Authorization: Basic " . base64_encode("$clientId:$clientSecret"), + 'Authorization: Basic ' . base64_encode("$clientId:$clientSecret"), ]; $authPayload = http_build_query([ 'grant_type' => 'client_credentials', diff --git a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php index d829f18eb76..782dd078cc4 100644 --- a/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php +++ b/app/code/core/Mage/Weee/Block/Renderer/Weee/Tax.php @@ -215,7 +215,7 @@ protected function _setAddButton() $this->setChild( 'add_button', $this->getLayout()->createBlock('adminhtml/widget_button') - ->setData(['id' => "add_tax_" . $this->getElement()->getHtmlId(), + ->setData(['id' => 'add_tax_' . $this->getElement()->getHtmlId(), 'label' => Mage::helper('catalog')->__('Add Tax'), 'onclick' => "weeeTaxControl.addItem('" . $this->getElement()->getHtmlId() . "')", 'class' => 'add' diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php index 68ec97e9966..422683d7779 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.11-0.12.php @@ -17,7 +17,7 @@ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'entity_type_id', "smallint (5) unsigned not null"); +$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'entity_type_id', 'smallint (5) unsigned not null'); $installer->run(" UPDATE `{$installer->getTable('weee_tax')}` diff --git a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php index 2bf0bce692c..1f183bf6d9f 100644 --- a/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php +++ b/app/code/core/Mage/Weee/sql/weee_setup/mysql4-upgrade-0.2-0.3.php @@ -17,6 +17,6 @@ $installer = $this; $installer->startSetup(); -$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'attribute_id', "smallint (5) unsigned not null"); +$installer->getConnection()->addColumn($installer->getTable('weee_tax'), 'attribute_id', 'smallint (5) unsigned not null'); $installer->endSetup(); diff --git a/app/code/core/Mage/Widget/Model/Widget.php b/app/code/core/Mage/Widget/Model/Widget.php index 9a8e51ef8ba..e87a5509478 100644 --- a/app/code/core/Mage/Widget/Model/Widget.php +++ b/app/code/core/Mage/Widget/Model/Widget.php @@ -195,7 +195,7 @@ public function getWidgetsArray($filters = []) 'description' => $helper->__((string)$widget->description) ]; } - usort($result, [$this, "_sortWidgets"]); + usort($result, [$this, '_sortWidgets']); $this->setData('widgets_array', $result); } return $this->_getData('widgets_array'); diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index ec358ecef3c..29cfc35b472 100644 --- a/app/code/core/Mage/Wishlist/controllers/IndexController.php +++ b/app/code/core/Mage/Wishlist/controllers/IndexController.php @@ -586,7 +586,7 @@ public function fromcartAction() $productName = Mage::helper('core')->escapeHtml($item->getProduct()->getName()); $wishlistName = Mage::helper('core')->escapeHtml($wishlist->getName()); $session->addSuccess( - Mage::helper('wishlist')->__("%s has been moved to wishlist %s", $productName, $wishlistName) + Mage::helper('wishlist')->__('%s has been moved to wishlist %s', $productName, $wishlistName) ); $wishlist->save(); } catch (Mage_Core_Exception $e) { diff --git a/lib/Mage/Archive/Helper/File.php b/lib/Mage/Archive/Helper/File.php index 928d9eed77e..88a772d532f 100644 --- a/lib/Mage/Archive/Helper/File.php +++ b/lib/Mage/Archive/Helper/File.php @@ -95,7 +95,7 @@ public function open($mode = 'w+', $chmod = 0666) } if (is_file($this->_filePath) && !is_writable($this->_filePath)) { - throw new Mage_Exception("Can't open file " . $this->_fileName . " for writing. Permission denied."); + throw new Mage_Exception("Can't open file " . $this->_fileName . ' for writing. Permission denied.'); } } diff --git a/lib/Mage/Archive/Tar.php b/lib/Mage/Archive/Tar.php index afc48a9fc67..443d0746d87 100644 --- a/lib/Mage/Archive/Tar.php +++ b/lib/Mage/Archive/Tar.php @@ -362,12 +362,12 @@ protected function _composeHeader($long = false) $header = []; $header['100-name'] = $long ? '././@LongLink' : substr($nameFile, 0, 100); $header['8-mode'] = $long ? ' ' - : str_pad(substr(sprintf("%07o", $infoFile['mode']), -4), 6, '0', STR_PAD_LEFT); - $header['8-uid'] = $long || $infoFile['uid'] == 0 ? "\0\0\0\0\0\0\0" : sprintf("%07o", $infoFile['uid']); - $header['8-gid'] = $long || $infoFile['gid'] == 0 ? "\0\0\0\0\0\0\0" : sprintf("%07o", $infoFile['gid']); - $header['12-size'] = $long ? sprintf("%011o", strlen($nameFile)) : sprintf("%011o", is_dir($file) + : str_pad(substr(sprintf('%07o', $infoFile['mode']), -4), 6, '0', STR_PAD_LEFT); + $header['8-uid'] = $long || $infoFile['uid'] == 0 ? "\0\0\0\0\0\0\0" : sprintf('%07o', $infoFile['uid']); + $header['8-gid'] = $long || $infoFile['gid'] == 0 ? "\0\0\0\0\0\0\0" : sprintf('%07o', $infoFile['gid']); + $header['12-size'] = $long ? sprintf('%011o', strlen($nameFile)) : sprintf('%011o', is_dir($file) ? 0 : filesize($file)); - $header['12-mtime'] = $long ? '00000000000' : sprintf("%011o", $infoFile['mtime']); + $header['12-mtime'] = $long ? '00000000000' : sprintf('%011o', $infoFile['mtime']); $header['8-check'] = sprintf('% 8s', ''); $header['1-type'] = $long ? 'L' : (is_link($file) ? 2 : (is_dir($file) ? 5 : 0)); $header['100-symlink'] = is_link($file) ? readlink($file) : ''; @@ -392,7 +392,7 @@ protected function _composeHeader($long = false) for ($i = 0; $i < 512; $i++) { $checksum += ord(substr($packedHeader, $i, 1)); } - $packedHeader = substr_replace($packedHeader, sprintf("%07o", $checksum) . "\0", 148, 8); + $packedHeader = substr_replace($packedHeader, sprintf('%07o', $checksum) . "\0", 148, 8); return $longHeader . $packedHeader; } @@ -423,7 +423,7 @@ protected function _unpackCurrentTar($destination) $currentFile = $destination . $header['name']; $dirname = dirname($currentFile); - if (in_array($header['type'], ["0",chr(0), ''])) { + if (in_array($header['type'], ['0',chr(0), ''])) { if (!file_exists($dirname)) { $mkdirResult = @mkdir($dirname, 0777, true); @@ -477,7 +477,7 @@ protected function _parseHeader(&$pointer) $header['mtime'] = octdec($header['mtime']); $header['checksum'] = octdec($header['checksum']); - if ($header['type'] == "5") { + if ($header['type'] == '5') { $header['size'] = 0; } @@ -532,7 +532,7 @@ protected function _extractFileHeader() $header['mtime'] = octdec($header['mtime']); $header['checksum'] = octdec($header['checksum']); - if ($header['type'] == "5") { + if ($header['type'] == '5') { $header['size'] = 0; } diff --git a/lib/Mage/DB/Mysqli.php b/lib/Mage/DB/Mysqli.php index ffb86bd3d01..f987ddaf3f1 100644 --- a/lib/Mage/DB/Mysqli.php +++ b/lib/Mage/DB/Mysqli.php @@ -340,11 +340,11 @@ public function unsafeQuery($sql) public function insertAssocOne($table, array $data, $replace = false) { $keys = $this->escapeFieldNames(array_keys($data)); - $keys = "(" . implode(",", $keys) . ")"; + $keys = '(' . implode(',', $keys) . ')'; $table = $this->escapeTableName($table); $sql = $replace ? "REPLACE INTO {$table} " : "INSERT INTO {$table} "; $values = $this->escapeFieldValues(array_values($data)); - $values = " VALUES (" . implode(",", $values) . ")"; + $values = ' VALUES (' . implode(',', $values) . ')'; $sql .= $keys . $values; return $this->query($sql); } @@ -371,30 +371,30 @@ public function insertAssocMultiple($table, array $data, $replace = false, $excl } $keys = $this->escapeFieldNames($keys); - $sql .= " ( "; + $sql .= ' ( '; for ($i = 0, $c = count($keys); $i < $c; $i++) { $sql .= $keys[$i]; if ($i != $c - 1) { - $sql .= ","; + $sql .= ','; } } - $sql .= " ) VALUES "; + $sql .= ' ) VALUES '; for ($i = 0, $c = count($data); $i < $c; $i++) { $row = $data[$i]; for ($j = 0, $jc = count($excluded); $j < $jc; $j++) { unset($data[$excluded[$j]]); } $values = $this->escapeFieldValues(array_values($row)); - $sql .= "( "; + $sql .= '( '; for ($j = 0, $jc = count($values); $j < $jc; $j++) { $sql .= $values[$j]; if ($j != $jc - 1) { - $sql .= ","; + $sql .= ','; } } - $sql .= " )"; + $sql .= ' )'; if ($i != $c - 1) { - $sql .= ","; + $sql .= ','; } } return $this->query($sql); @@ -414,9 +414,9 @@ public function updateAssoc($table, array $data, $condition = '1=1') foreach ($data as $k => $v) { $k = $this->escapeFieldName($k); $v = $this->escapeFieldValue($v); - $set[] = $k . " = " . $v; + $set[] = $k . ' = ' . $v; } - $set = implode(",", $set); + $set = implode(',', $set); $sql = "UPDATE {$table} SET {$set} WHERE {$condition}"; return $this->query($sql); } @@ -438,9 +438,9 @@ public function updateAssocByKey($table, array $data, $value, $key = 'id') foreach ($data as $k => $v) { $k = $this->escapeFieldName($k); $v = $this->escapeFieldValue($v); - $set[] = $k . " = " . $v; + $set[] = $k . ' = ' . $v; } - $set = implode(",", $set); + $set = implode(',', $set); $sql = "UPDATE {$table} SET {$set} WHERE {$key} = {$value}"; return $this->query($sql); } @@ -459,7 +459,7 @@ public function idsToString($ids) foreach ($ids as $id) { $out .= $this->escapeFieldValue($id); } - return implode(",", $out); + return implode(',', $out); } /** @@ -508,7 +508,7 @@ public function simpleCount($table, $condition) public function lastInsertId() { - $sql = "SELECT LAST_INSERT_ID() as `id`"; + $sql = 'SELECT LAST_INSERT_ID() as `id`'; $data = $this->fetchOne($sql); return $data['id']; } diff --git a/lib/Mage/HTTP/Client.php b/lib/Mage/HTTP/Client.php index a7ec0641b46..b9a3f397be0 100644 --- a/lib/Mage/HTTP/Client.php +++ b/lib/Mage/HTTP/Client.php @@ -40,10 +40,10 @@ public static function getInstance($frontend = false) $frontend = self::detectFrontend(); } if (false === $frontend) { - throw new Exception("Cannot find frontend automatically, set it manually"); + throw new Exception('Cannot find frontend automatically, set it manually'); } - $class = __CLASS__ . "_" . str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend))); + $class = __CLASS__ . '_' . str_replace(' ', DIRECTORY_SEPARATOR, ucwords(str_replace('_', ' ', $frontend))); $obj = new $class(); return $obj; } @@ -56,11 +56,11 @@ public static function getInstance($frontend = false) */ protected static function detectFrontend() { - if (function_exists("curl_init")) { - return "curl"; + if (function_exists('curl_init')) { + return 'curl'; } - if (function_exists("fsockopen")) { - return "socket"; + if (function_exists('fsockopen')) { + return 'socket'; } return false; } diff --git a/lib/Mage/HTTP/Client/Curl.php b/lib/Mage/HTTP/Client/Curl.php index 6cef1705467..57edac17b35 100644 --- a/lib/Mage/HTTP/Client/Curl.php +++ b/lib/Mage/HTTP/Client/Curl.php @@ -166,7 +166,7 @@ public function removeHeader($name) public function setCredentials($login, $pass) { $val = base64_encode("$login:$pass"); - $this->addHeader("Authorization", "Basic $val"); + $this->addHeader('Authorization', "Basic $val"); } /** @@ -215,7 +215,7 @@ public function removeCookies() */ public function get($uri) { - $this->makeRequest("GET", $uri); + $this->makeRequest('GET', $uri); } /** @@ -224,7 +224,7 @@ public function get($uri) */ public function post($uri, $params) { - $this->makeRequest("POST", $uri, $params); + $this->makeRequest('POST', $uri, $params); } /** @@ -259,7 +259,7 @@ public function getCookies() } $out = []; foreach ($this->_responseHeaders['Set-Cookie'] as $row) { - $values = explode("; ", $row); + $values = explode('; ', $row); $c = count($values); if (!$c) { continue; @@ -285,7 +285,7 @@ public function getCookiesFull() } $out = []; foreach ($this->_responseHeaders['Set-Cookie'] as $row) { - $values = explode("; ", $row); + $values = explode('; ', $row); $c = count($values); if (!$c) { continue; @@ -301,7 +301,7 @@ public function getCookiesFull() continue; } for ($i = 0; $i < $c; $i++) { - list($subkey, $val) = explode("=", $values[$i]); + list($subkey, $val) = explode('=', $values[$i]); $out[trim($key)][trim($subkey)] = trim($val); } } @@ -330,7 +330,7 @@ protected function makeRequest($method, $uri, $params = []) if ($method == 'POST') { $this->curlOption(CURLOPT_POST, 1); $this->curlOption(CURLOPT_POSTFIELDS, is_array($params) ? http_build_query($params) : $params); - } elseif ($method == "GET") { + } elseif ($method == 'GET') { $this->curlOption(CURLOPT_HTTPGET, 1); } else { $this->curlOption(CURLOPT_CUSTOMREQUEST, $method); @@ -349,7 +349,7 @@ protected function makeRequest($method, $uri, $params = []) foreach ($this->_cookies as $k => $v) { $cookies[] = "$k=$v"; } - $this->curlOption(CURLOPT_COOKIE, implode(";", $cookies)); + $this->curlOption(CURLOPT_COOKIE, implode(';', $cookies)); } if ($this->_timeout) { diff --git a/lib/Mage/HTTP/Client/Socket.php b/lib/Mage/HTTP/Client/Socket.php index 421b426bde8..e0cd7ef6977 100644 --- a/lib/Mage/HTTP/Client/Socket.php +++ b/lib/Mage/HTTP/Client/Socket.php @@ -172,7 +172,7 @@ public function removeHeader($name) public function setCredentials($login, $pass) { $val = base64_encode("$login:$pass"); - $this->addHeader("Authorization", "Basic $val"); + $this->addHeader('Authorization', "Basic $val"); } /** @@ -221,7 +221,7 @@ public function removeCookies() */ public function get($uri) { - $this->makeRequest("GET", $this->parseUrl($uri)); + $this->makeRequest('GET', $this->parseUrl($uri)); } /** @@ -253,7 +253,7 @@ protected function parseUrl($uri) throw new InvalidArgumentException("Uri doesn't contain path part"); } if (!empty($parts['query'])) { - $requestUri .= "?" . $parts['query']; + $requestUri .= '?' . $parts['query']; } return $requestUri; } @@ -263,7 +263,7 @@ protected function parseUrl($uri) */ public function post($uri, $params) { - $this->makeRequest("POST", $this->parseUrl($uri), $params); + $this->makeRequest('POST', $this->parseUrl($uri), $params); } /** @@ -298,7 +298,7 @@ public function getCookies() } $out = []; foreach ($this->_responseHeaders['Set-Cookie'] as $row) { - $values = explode("; ", $row); + $values = explode('; ', $row); $c = count($values); if (!$c) { continue; @@ -324,7 +324,7 @@ public function getCookiesFull() } $out = []; foreach ($this->_responseHeaders['Set-Cookie'] as $row) { - $values = explode("; ", $row); + $values = explode('; ', $row); $c = count($values); if (!$c) { continue; @@ -340,7 +340,7 @@ public function getCookiesFull() continue; } for ($i = 0; $i < $c; $i++) { - list($subkey, $val) = explode("=", $values[$i]); + list($subkey, $val) = explode('=', $values[$i]); $out[trim($key)][trim($subkey)] = trim($val); } } @@ -360,13 +360,13 @@ protected function processResponseHeaders() return; } $name = $value = ''; - $out = explode(": ", trim($line), 2); + $out = explode(': ', trim($line), 2); if (count($out) == 2) { $name = $out[0]; $value = $out[1]; } if (!empty($value)) { - if ($name == "Set-Cookie") { + if ($name == 'Set-Cookie') { if (!isset($this->_responseHeaders[$name])) { $this->_responseHeaders[$name] = []; } @@ -400,9 +400,9 @@ protected function processResponse() $response = ''; $responseLine = trim(fgets($this->_sock, 1024)); - $line = explode(" ", $responseLine, 3); + $line = explode(' ', $responseLine, 3); if (count($line) != 3) { - return $this->doError("Invalid response line returned from server: " . $responseLine); + return $this->doError('Invalid response line returned from server: ' . $responseLine); } $this->_responseStatus = (int) $line[1]; $this->processResponseHeaders(); @@ -442,11 +442,11 @@ protected function makeRequest($method, $uri, $params = []) $errno = $errstr = ''; $this->_sock = @fsockopen($this->_host, $this->_port, $errno, $errstr, $this->_timeout); if (!$this->_sock) { - return $this->doError(sprintf("[errno: %d] %s", $errno, $errstr)); + return $this->doError(sprintf('[errno: %d] %s', $errno, $errstr)); } $crlf = "\r\n"; - $isPost = $method == "POST"; + $isPost = $method == 'POST'; $appendHeaders = []; $paramsStr = false; @@ -487,8 +487,8 @@ public function doError($string) protected function headersToString($append = []) { $headers = []; - $headers["Host"] = $this->_host; - $headers['Connection'] = "close"; + $headers['Host'] = $this->_host; + $headers['Connection'] = 'close'; $headers = array_merge($headers, $this->_headers, $append); $str = []; foreach ($headers as $k => $v) { diff --git a/lib/Mage/System/Ftp.php b/lib/Mage/System/Ftp.php index ff2b1aebbe1..99a2c61bbfd 100644 --- a/lib/Mage/System/Ftp.php +++ b/lib/Mage/System/Ftp.php @@ -37,7 +37,7 @@ class Mage_System_Ftp protected function checkConnected() { if (!$this->_conn) { - throw new Exception(__CLASS__ . " - no connection established with server"); + throw new Exception(__CLASS__ . ' - no connection established with server'); } } @@ -67,13 +67,13 @@ public function mdkir($name) public function mkdirRecursive($path, $mode = 0777) { $this->checkConnected(); - $dir = explode("/", $path); - $path = ""; + $dir = explode('/', $path); + $path = ''; $ret = true; for ($i = 0; $i < count($dir); $i++) { - $path .= "/" . $dir[$i]; + $path .= '/' . $dir[$i]; if (!@ftp_chdir($this->_conn, $path)) { - @ftp_chdir($this->_conn, "/"); + @ftp_chdir($this->_conn, '/'); if (!@ftp_mkdir($this->_conn, $path)) { $ret = false; break; @@ -95,12 +95,12 @@ public function mkdirRecursive($path, $mode = 0777) * * @SuppressWarnings(PHPMD.ErrorControlOperator) */ - public function login($login = "anonymous", $password = "test@gmail.com") + public function login($login = 'anonymous', $password = 'test@gmail.com') { $this->checkConnected(); $res = @ftp_login($this->_conn, $login, $password); if (!$res) { - throw new Exception("Invalid login credentials"); + throw new Exception('Invalid login credentials'); } return $res; } @@ -195,8 +195,8 @@ public function put($remoteFile, $localFile, $mode = FTP_BINARY, $startPos = 0) */ public function getcwd() { - $d = $this->raw("pwd"); - $data = explode(" ", $d[0], 3); + $d = $this->raw('pwd'); + $data = explode(' ', $d[0], 3); if (empty($data[1])) { return false; } @@ -204,8 +204,8 @@ public function getcwd() return false; } $out = trim($data[1], '"'); - if ($out !== "/") { - $out = rtrim($out, "/"); + if ($out !== '/') { + $out = rtrim($out, '/'); } return $out; } @@ -250,16 +250,16 @@ public function upload($remote, $local, $dirMode = 0777, $ftpMode = FTP_BINARY) throw new Exception("Directory given instead of file: {$local}"); } - $globalPathMode = substr($remote, 0, 1) == "/"; + $globalPathMode = substr($remote, 0, 1) == '/'; $dirname = dirname($remote); $cwd = $this->getcwd(); if (false === $cwd) { - throw new Exception("Server returns something awful on PWD command"); + throw new Exception('Server returns something awful on PWD command'); } if (!$globalPathMode) { - $dirname = $cwd . "/" . $dirname; - $remote = $cwd . "/" . $remote; + $dirname = $cwd . '/' . $dirname; + $remote = $cwd . '/' . $remote; } $res = $this->mkdirRecursive($dirname, $dirMode); $this->chdir($cwd); @@ -380,7 +380,7 @@ public function get($localFile, $remoteFile, $fileMode = FTP_BINARY, $resumeOffs * * @SuppressWarnings(PHPMD.ErrorControlOperator) */ - public function nlist($dir = "/") + public function nlist($dir = '/') { $this->checkConnected(); $dir = $this->correctFilePath($dir); @@ -396,7 +396,7 @@ public function nlist($dir = "/") * * @SuppressWarnings(PHPMD.ErrorControlOperator) */ - public function rawlist($dir = "/", $recursive = false) + public function rawlist($dir = '/', $recursive = false) { $this->checkConnected(); $dir = $this->correctFilePath($dir); @@ -440,10 +440,10 @@ public static function chmodnum($chmod) public function fileExists($path, $excludeIfIsDir = true) { $path = $this->correctFilePath($path); - $globalPathMode = substr($path, 0, 1) == "/"; + $globalPathMode = substr($path, 0, 1) == '/'; $file = basename($path); - $dir = $globalPathMode ? dirname($path) : $this->getcwd() . "/" . $path; + $dir = $globalPathMode ? dirname($path) : $this->getcwd() . '/' . $path; $data = $this->ls($dir); foreach ($data as $row) { if ($file == $row['name']) { @@ -463,7 +463,7 @@ public function fileExists($path, $excludeIfIsDir = true) * @param bool $recursive * @return array */ - public function ls($dir = "/", $recursive = false) + public function ls($dir = '/', $recursive = false) { $dir = $this->correctFilePath($dir); $rawfiles = (array) $this->rawlist($dir, $recursive); @@ -504,8 +504,8 @@ public function ls($dir = "/", $recursive = false) */ public function correctFilePath($str) { - $str = str_replace("\\", "/", $str); - $str = preg_replace("/^.\//", "", $str); + $str = str_replace('\\', '/', $str); + $str = preg_replace("/^.\//", '', $str); return $str; } diff --git a/lib/Magento/Db/Sql/Trigger.php b/lib/Magento/Db/Sql/Trigger.php index c2426b15d1f..5ca9af0fbdf 100644 --- a/lib/Magento/Db/Sql/Trigger.php +++ b/lib/Magento/Db/Sql/Trigger.php @@ -288,10 +288,10 @@ public function getBody() public function assemble() { $this->_validateIsComplete(); - return "CREATE TRIGGER " + return 'CREATE TRIGGER ' . $this->getName() . "\n" - . $this->_parts[self::TIME] . " " . $this->_parts[self::EVENT] . "\n" - . "ON " . $this->_parts[self::TARGET] . " " . $this->_parts[self::SCOPE] . "\n" + . $this->_parts[self::TIME] . ' ' . $this->_parts[self::EVENT] . "\n" + . 'ON ' . $this->_parts[self::TARGET] . ' ' . $this->_parts[self::SCOPE] . "\n" . "BEGIN\n" . implode("\n", $this->_parts[self::BODY]) . "\n" . "END;\n"; diff --git a/lib/Varien/Cache/Backend/Memcached.php b/lib/Varien/Cache/Backend/Memcached.php index a1dbc9a403b..b67c7c4c0f8 100644 --- a/lib/Varien/Cache/Backend/Memcached.php +++ b/lib/Varien/Cache/Backend/Memcached.php @@ -42,7 +42,7 @@ public function __construct(array $options = []) if (!isset($options['slab_size']) || !is_numeric($options['slab_size'])) { if (isset($options['slab_size'])) { - throw new Varien_Exception("Invalid value for the node . Expected to be positive integer."); + throw new Varien_Exception('Invalid value for the node . Expected to be positive integer.'); } $this->_options['slab_size'] = self::DEFAULT_SLAB_SIZE; diff --git a/lib/Varien/Cache/Core.php b/lib/Varien/Cache/Core.php index ac1f61166e8..f61973ad7c8 100644 --- a/lib/Varien/Cache/Core.php +++ b/lib/Varien/Cache/Core.php @@ -37,7 +37,7 @@ public function __construct($options = []) { parent::__construct($options); if (!is_numeric($this->getOption('slab_size'))) { - throw new Varien_Exception("Invalid value for the node . Expected to be integer."); + throw new Varien_Exception('Invalid value for the node . Expected to be integer.'); } } diff --git a/lib/Varien/Convert/Container/Abstract.php b/lib/Varien/Convert/Container/Abstract.php index 242472caee6..38dbea0e989 100644 --- a/lib/Varien/Convert/Container/Abstract.php +++ b/lib/Varien/Convert/Container/Abstract.php @@ -83,7 +83,7 @@ public function validateDataString($data = null) $data = $this->getData(); } if (!is_string($data)) { - $this->addException("Invalid data type, expecting string.", Varien_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting string.', Varien_Convert_Exception::FATAL); } return true; } @@ -94,7 +94,7 @@ public function validateDataArray($data = null) $data = $this->getData(); } if (!is_array($data)) { - $this->addException("Invalid data type, expecting array.", Varien_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting array.', Varien_Convert_Exception::FATAL); } return true; } @@ -108,7 +108,7 @@ public function validateDataGrid($data = null) if (count($data) == 0) { return true; } - $this->addException("Invalid data type, expecting 2D grid array.", Varien_Convert_Exception::FATAL); + $this->addException('Invalid data type, expecting 2D grid array.', Varien_Convert_Exception::FATAL); } return true; } diff --git a/lib/Varien/Convert/Parser/Xml/Excel.php b/lib/Varien/Convert/Parser/Xml/Excel.php index 4b8ecd8036d..0f1399c2ccd 100644 --- a/lib/Varien/Convert/Parser/Xml/Excel.php +++ b/lib/Varien/Convert/Parser/Xml/Excel.php @@ -199,9 +199,9 @@ public function getRowXml(array $row) $this->_xmlElement->row = htmlspecialchars($value); $value = str_replace($xmlHeader, '', $this->_xmlElement->asXML()); $value = preg_replace($xmlRegexp, '\\1', $value); - $dataType = "String"; + $dataType = 'String'; if (is_numeric($value)) { - $dataType = "Number"; + $dataType = 'Number'; // is_numeric(' 96000') returns true, but Excel argues about space $value = trim($value); } diff --git a/lib/Varien/Convert/Profile/Abstract.php b/lib/Varien/Convert/Profile/Abstract.php index dfd2d76a856..c7554d6e80e 100644 --- a/lib/Varien/Convert/Profile/Abstract.php +++ b/lib/Varien/Convert/Profile/Abstract.php @@ -93,7 +93,7 @@ public function addException(Varien_Convert_Exception $e) public function run() { if (!$this->_actions) { - $e = new Varien_Convert_Exception("Could not find any actions for this profile"); + $e = new Varien_Convert_Exception('Could not find any actions for this profile'); $e->setLevel(Varien_Convert_Exception::FATAL); $this->addException($e); return; diff --git a/lib/Varien/Data/Collection/Db.php b/lib/Varien/Data/Collection/Db.php index a35fc1ecd7f..a78999460fc 100644 --- a/lib/Varien/Data/Collection/Db.php +++ b/lib/Varien/Data/Collection/Db.php @@ -236,7 +236,7 @@ public function getSelectCountSql() $group = array_map(function ($token) { return $this->getSelect()->getAdapter()->quoteIdentifier($token, true); }, $group); - $countSelect->columns("COUNT(DISTINCT " . implode(", ", $group) . ")"); + $countSelect->columns('COUNT(DISTINCT ' . implode(', ', $group) . ')'); } else { $countSelect->columns('COUNT(*)'); diff --git a/lib/Varien/Data/Form/Element/Editor.php b/lib/Varien/Data/Form/Element/Editor.php index 43d40074109..3656de319fc 100644 --- a/lib/Varien/Data/Form/Element/Editor.php +++ b/lib/Varien/Data/Form/Element/Editor.php @@ -194,7 +194,7 @@ protected function _getPluginButtonsHtml($visible = true) if ($this->getConfig('add_widgets')) { $buttonsHtml .= $this->_getButtonHtml([ 'title' => $this->translate('Insert Widget...'), - 'onclick' => "widgetTools.openDialog('" . $this->getConfig('widget_window_url') . "widget_target_id/" + 'onclick' => "widgetTools.openDialog('" . $this->getConfig('widget_window_url') . 'widget_target_id/' . $this->getHtmlId() . "')", 'class' => 'add-widget plugin', 'style' => $visible ? '' : 'display:none', @@ -207,7 +207,7 @@ protected function _getPluginButtonsHtml($visible = true) 'title' => $this->translate('Insert Image...'), 'onclick' => "MediabrowserUtility.openDialog('" . $this->getConfig('files_browser_window_url') . - "target_element_id/" . $this->getHtmlId() . "/" . + 'target_element_id/' . $this->getHtmlId() . '/' . ((null !== $this->getConfig('store_id')) ? ('store/' . $this->getConfig('store_id') . '/') : '') . diff --git a/lib/Varien/Data/Form/Element/Textarea.php b/lib/Varien/Data/Form/Element/Textarea.php index 23108c984d3..98f4ec32e48 100644 --- a/lib/Varien/Data/Form/Element/Textarea.php +++ b/lib/Varien/Data/Form/Element/Textarea.php @@ -53,7 +53,7 @@ public function getElementHtml() $this->addClass('textarea'); $html = '"; + $html .= ''; $html .= $this->getAfterElementHtml(); return $html; } diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index 93412dad7c6..6cde14f59cf 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -580,13 +580,13 @@ public function proccessBindCallback($matches) protected function _unQuote($string) { $translate = [ - "\\000" => "\000", - "\\n" => "\n", - "\\r" => "\r", - "\\\\" => "\\", + '\\000' => "\000", + '\\n' => "\n", + '\\r' => "\r", + '\\\\' => '\\', "\'" => "'", - "\\\"" => "\"", - "\\032" => "\032" + '\\"' => '"', + '\\032' => "\032" ]; return strtr($string, $translate); } @@ -828,7 +828,7 @@ public function purgeOrphanRecords( || $onDelete == Varien_Db_Adapter_Interface::FK_ACTION_RESTRICT ) { $sql = sprintf( - "DELETE p.* FROM %s AS p LEFT JOIN %s AS r ON p.%s = r.%s WHERE r.%s IS NULL", + 'DELETE p.* FROM %s AS p LEFT JOIN %s AS r ON p.%s = r.%s WHERE r.%s IS NULL', $this->quoteIdentifier($tableName), $this->quoteIdentifier($refTableName), $this->quoteIdentifier($columnName), @@ -838,7 +838,7 @@ public function purgeOrphanRecords( $this->raw_query($sql); } elseif ($onDelete == Varien_Db_Adapter_Interface::FK_ACTION_SET_NULL) { $sql = sprintf( - "UPDATE %s AS p LEFT JOIN %s AS r ON p.%s = r.%s SET p.%s = NULL WHERE r.%s IS NULL", + 'UPDATE %s AS p LEFT JOIN %s AS r ON p.%s = r.%s SET p.%s = NULL WHERE r.%s IS NULL', $this->quoteIdentifier($tableName), $this->quoteIdentifier($refTableName), $this->quoteIdentifier($columnName), @@ -931,7 +931,7 @@ public function addColumn($tableName, $columnName, $definition, $schemaName = nu if (is_array($definition)) { $definition = array_change_key_case($definition, CASE_UPPER); if (empty($definition['COMMENT'])) { - throw new Zend_Db_Exception("Impossible to create a column without comment."); + throw new Zend_Db_Exception('Impossible to create a column without comment.'); } if (!empty($definition['PRIMARY'])) { $primaryKey = sprintf(', ADD PRIMARY KEY (%s)', $this->quoteIdentifier($columnName)); @@ -2194,7 +2194,7 @@ public function insertIgnore($table, array $bind) } // build the statement - $sql = "INSERT IGNORE INTO " + $sql = 'INSERT IGNORE INTO ' . $this->quoteIdentifier($table, true) . ' (' . implode(', ', $cols) . ') ' . 'VALUES (' . implode(', ', $vals) . ')'; @@ -2252,7 +2252,7 @@ public function createTable(Varien_Db_Ddl_Table $table) $columns = $table->getColumns(); foreach ($columns as $columnEntry) { if (empty($columnEntry['COMMENT'])) { - throw new Zend_Db_Exception("Cannot create table without columns comments"); + throw new Zend_Db_Exception('Cannot create table without columns comments'); } } @@ -2266,7 +2266,7 @@ public function createTable(Varien_Db_Ddl_Table $table) "CREATE TABLE %s (\n%s\n) %s", $this->quoteIdentifier($table->getName()), implode(",\n", $sqlFragment), - implode(" ", $tableOptions) + implode(' ', $tableOptions) ); return $this->query($sql); @@ -2291,7 +2291,7 @@ public function createTemporaryTable(Varien_Db_Ddl_Table $table) "CREATE TEMPORARY TABLE %s (\n%s\n) %s", $this->quoteIdentifier($table->getName()), implode(",\n", $sqlFragment), - implode(" ", $tableOptions) + implode(' ', $tableOptions) ); return $this->query($sql); @@ -2951,7 +2951,7 @@ public function formatDate($date, $includeTime = true) public function startSetup() { $this->raw_query("SET SQL_MODE=''"); - $this->raw_query("SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0"); + $this->raw_query('SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0'); $this->raw_query("SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO'"); return $this; @@ -2965,7 +2965,7 @@ public function startSetup() public function endSetup() { $this->raw_query("SET SQL_MODE=IFNULL(@OLD_SQL_MODE,'')"); - $this->raw_query("SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS=0, 0, 1)"); + $this->raw_query('SET FOREIGN_KEY_CHECKS=IF(@OLD_FOREIGN_KEY_CHECKS=0, 0, 1)'); return $this; } @@ -3003,23 +3003,23 @@ public function endSetup() public function prepareSqlCondition($fieldName, $condition) { $conditionKeyMap = [ - 'eq' => "{{fieldName}} = ?", - 'neq' => "{{fieldName}} != ?", - 'like' => "{{fieldName}} LIKE ?", - 'nlike' => "{{fieldName}} NOT LIKE ?", - 'in' => "{{fieldName}} IN(?)", - 'nin' => "{{fieldName}} NOT IN(?)", - 'is' => "{{fieldName}} IS ?", - 'notnull' => "{{fieldName}} IS NOT NULL", - 'null' => "{{fieldName}} IS NULL", - 'gt' => "{{fieldName}} > ?", - 'lt' => "{{fieldName}} < ?", - 'gteq' => "{{fieldName}} >= ?", - 'lteq' => "{{fieldName}} <= ?", - 'finset' => "FIND_IN_SET(?, {{fieldName}})", - 'regexp' => "{{fieldName}} REGEXP ?", - 'from' => "{{fieldName}} >= ?", - 'to' => "{{fieldName}} <= ?", + 'eq' => '{{fieldName}} = ?', + 'neq' => '{{fieldName}} != ?', + 'like' => '{{fieldName}} LIKE ?', + 'nlike' => '{{fieldName}} NOT LIKE ?', + 'in' => '{{fieldName}} IN(?)', + 'nin' => '{{fieldName}} NOT IN(?)', + 'is' => '{{fieldName}} IS ?', + 'notnull' => '{{fieldName}} IS NOT NULL', + 'null' => '{{fieldName}} IS NULL', + 'gt' => '{{fieldName}} > ?', + 'lt' => '{{fieldName}} < ?', + 'gteq' => '{{fieldName}} >= ?', + 'lteq' => '{{fieldName}} <= ?', + 'finset' => 'FIND_IN_SET(?, {{fieldName}})', + 'regexp' => '{{fieldName}} REGEXP ?', + 'from' => '{{fieldName}} >= ?', + 'to' => '{{fieldName}} <= ?', 'seq' => null, 'sneq' => null ]; @@ -3189,9 +3189,9 @@ public function prepareColumnValue(array $column, $value) public function getCheckSql($expression, $true, $false) { if ($expression instanceof Zend_Db_Expr || $expression instanceof Zend_Db_Select) { - $expression = sprintf("IF((%s), %s, %s)", $expression, $true, $false); + $expression = sprintf('IF((%s), %s, %s)', $expression, $true, $false); } else { - $expression = sprintf("IF(%s, %s, %s)", $expression, $true, $false); + $expression = sprintf('IF(%s, %s, %s)', $expression, $true, $false); } return new Zend_Db_Expr($expression); @@ -3207,9 +3207,9 @@ public function getCheckSql($expression, $true, $false) public function getIfNullSql($expression, $value = '0') { if ($expression instanceof Zend_Db_Expr || $expression instanceof Zend_Db_Select) { - $expression = sprintf("IFNULL((%s), %s)", $expression, $value); + $expression = sprintf('IFNULL((%s), %s)', $expression, $value); } else { - $expression = sprintf("IFNULL(%s, %s)", $expression, $value); + $expression = sprintf('IFNULL(%s, %s)', $expression, $value); } return new Zend_Db_Expr($expression); diff --git a/lib/Varien/Debug.php b/lib/Varien/Debug.php index 7a772a5c120..367b29e63fc 100644 --- a/lib/Varien/Debug.php +++ b/lib/Varien/Debug.php @@ -153,7 +153,7 @@ protected static function _formatCalledArgument($arg) { $out = ''; if (is_object($arg)) { - $out .= sprintf("&%s#%s#", get_class($arg), spl_object_hash($arg)); + $out .= sprintf('&%s#%s#', get_class($arg), spl_object_hash($arg)); } elseif (is_resource($arg)) { $out .= '#[' . get_resource_type($arg) . ']'; } elseif (is_array($arg)) { @@ -180,7 +180,7 @@ protected static function _formatCalledArgument($arg) $out .= $arg; } elseif (is_string($arg)) { if (strlen($arg) > self::$argLength) { - $arg = substr($arg, 0, self::$argLength) . "..."; + $arg = substr($arg, 0, self::$argLength) . '...'; } $arg = strtr($arg, ["\t" => '\t', "\r" => '\r', "\n" => '\n', "'" => '\\\'']); $out .= "'" . $arg . "'"; diff --git a/lib/Varien/Directory/Collection.php b/lib/Varien/Directory/Collection.php index a531cf07b4e..f24d0c115b6 100644 --- a/lib/Varien/Directory/Collection.php +++ b/lib/Varien/Directory/Collection.php @@ -145,7 +145,7 @@ public function lastDir() */ public static function getLastDir($path) { - $last = strrpos($path, "/"); + $last = strrpos($path, '/'); return substr($path, $last + 1); } /** diff --git a/lib/Varien/Directory/Factory.php b/lib/Varien/Directory/Factory.php index 83025ee94ac..8231eb6c622 100644 --- a/lib/Varien/Directory/Factory.php +++ b/lib/Varien/Directory/Factory.php @@ -20,8 +20,8 @@ * @package Varien_Directory */ -require_once("Varien/Directory/Collection.php"); -require_once("Varien/File/Object.php"); +require_once('Varien/Directory/Collection.php'); +require_once('Varien/File/Object.php'); class Varien_Directory_Factory { diff --git a/lib/Varien/File/Object.php b/lib/Varien/File/Object.php index 48e10b8db2f..55dab25cbae 100644 --- a/lib/Varien/File/Object.php +++ b/lib/Varien/File/Object.php @@ -20,7 +20,7 @@ * @package Varien_File */ -require_once("Varien/Object.php"); +require_once('Varien/Object.php'); require_once('Varien/Directory/IFactory.php'); class Varien_File_Object extends SplFileObject implements IFactory @@ -180,8 +180,8 @@ public function getExtension() public static function getExt($fileName) { $path_parts = pathinfo($fileName); - if (isset($path_parts["extension"])) { - return $path_parts["extension"]; + if (isset($path_parts['extension'])) { + return $path_parts['extension']; } else { return ''; } diff --git a/lib/Varien/File/Transfer/Adapter/Http.php b/lib/Varien/File/Transfer/Adapter/Http.php index 63e6c3755f7..bac95988909 100644 --- a/lib/Varien/File/Transfer/Adapter/Http.php +++ b/lib/Varien/File/Transfer/Adapter/Http.php @@ -78,7 +78,7 @@ public function send($options = null) } elseif (is_array($options)) { $filepath = $options['filepath']; } else { - throw new Exception("Filename is not set."); + throw new Exception('Filename is not set.'); } if (!is_file($filepath) || !is_readable($filepath)) { diff --git a/lib/Varien/File/Uploader/Image.php b/lib/Varien/File/Uploader/Image.php index c2a6f0ae91c..6402884e482 100644 --- a/lib/Varien/File/Uploader/Image.php +++ b/lib/Varien/File/Uploader/Image.php @@ -74,7 +74,7 @@ public function rotate($degrees = null) * @access public * @param string $type */ - public function flip($type = "h") + public function flip($type = 'h') { $this->uploader->image_flip = $type; } @@ -115,7 +115,7 @@ public function crop($crop = 0) * Default value is 'jpeg' * */ - public function convert($format = "jpeg") + public function convert($format = 'jpeg') { $this->uploader->image_convert = $format; } @@ -147,7 +147,7 @@ public function convert($format = "jpeg") * If a negative value is used, it will represent the distance between the right of the image and the watermark * */ - public function addWatermark($fileName = null, $position = "BL", $absoluteX = null, $absoluteY = null) + public function addWatermark($fileName = null, $position = 'BL', $absoluteX = null, $absoluteY = null) { if (!isset($fileName)) { return; @@ -178,7 +178,7 @@ public function addWatermark($fileName = null, $position = "BL", $absoluteX = nu * Value is an integer between 0 (no opacity) and 100 (full opacity). * */ - public function addReflection($height = "10%", $space = 0, $color = "#FFFFFF", $opacity = 60) + public function addReflection($height = '10%', $space = 0, $color = '#FFFFFF', $opacity = 60) { if ((int) $height == 0) { return; @@ -195,9 +195,9 @@ public function addReflection($height = "10%", $space = 0, $color = "#FFFFFF", $ * * Value is a string, any text. Text will not word-wrap, although you can use breaklines in your text "\n" */ - public function addText($string = "") + public function addText($string = '') { - if (trim($string) == "") { + if (trim($string) == '') { return; } @@ -234,7 +234,7 @@ public function setTextFont($font) $this->uploader->image_text_font = $font; } - public function setTextPosition($position = "TR") + public function setTextPosition($position = 'TR') { $this->uploader->image_text_position = $position; } @@ -299,7 +299,7 @@ public function colorInvert() * $percent value is a percentage, as an integer between 0 and 100 * */ - public function colorOverlay($color = "#FFFFFF", $percent = 50) + public function colorOverlay($color = '#FFFFFF', $percent = 50) { $this->uploader->image_overlay_color = $color; $this->uploader->image_overlay_percent = $percent; @@ -345,7 +345,7 @@ public function setJpegQuality($value = 85) * Is generally used when cropping an image with negative margins * */ - public function setBgColor($color = "#000000") + public function setBgColor($color = '#000000') { $this->uploader->image_background_color = $color; } diff --git a/lib/Varien/Filter/Template.php b/lib/Varien/Filter/Template.php index 45df4772644..a58c90c0ad4 100644 --- a/lib/Varien/Filter/Template.php +++ b/lib/Varien/Filter/Template.php @@ -272,7 +272,7 @@ protected function _getIncludeParameters($value) */ protected function _getVariable($value, $default = '{no_value_defined}') { - Varien_Profiler::start("email_template_proccessing_variables"); + Varien_Profiler::start('email_template_proccessing_variables'); $tokenizer = new Varien_Filter_Template_Tokenizer_Variable(); $tokenizer->setString($value); $stackVars = $tokenizer->tokenize(); @@ -314,7 +314,7 @@ protected function _getVariable($value, $default = '{no_value_defined}') // If value for construction exists set it $result = $stackVars[$last]['variable']; } - Varien_Profiler::stop("email_template_proccessing_variables"); + Varien_Profiler::stop('email_template_proccessing_variables'); return $result; } diff --git a/lib/Varien/Image/Adapter/Gd2.php b/lib/Varien/Image/Adapter/Gd2.php index 8f99a6c9cab..791c16e9c27 100644 --- a/lib/Varien/Image/Adapter/Gd2.php +++ b/lib/Varien/Image/Adapter/Gd2.php @@ -15,7 +15,7 @@ class Varien_Image_Adapter_Gd2 extends Varien_Image_Adapter_Abstract { - protected $_requiredExtensions = ["gd"]; + protected $_requiredExtensions = ['gd']; private static $_callbacks = [ IMAGETYPE_WEBP => ['output' => 'imagewebp', 'create' => 'imagecreatefromwebp'], IMAGETYPE_GIF => ['output' => 'imagegif', 'create' => 'imagecreatefromgif'], @@ -129,13 +129,13 @@ public function save($destination = null, $newName = null) $fileName = (!isset($destination)) ? $this->_fileName : $destination; if (isset($destination) && isset($newName)) { - $fileName = $destination . "/" . $newName; + $fileName = $destination . '/' . $newName; } elseif (isset($destination) && !isset($newName)) { $info = pathinfo($destination); $fileName = $destination; $destination = $info['dirname']; } elseif (!isset($destination) && isset($newName)) { - $fileName = $this->_fileSrcPath . "/" . $newName; + $fileName = $this->_fileSrcPath . '/' . $newName; } else { $fileName = $this->_fileSrcPath . $this->_fileSrcName; } @@ -209,7 +209,7 @@ public function save($destination = null, $newName = null) public function display() { - header("Content-type: " . $this->getMimeTypeWithOutFileType()); + header('Content-type: ' . $this->getMimeTypeWithOutFileType()); call_user_func($this->_getCallback('output'), $this->_imageHandler); } diff --git a/lib/Varien/Io/Abstract.php b/lib/Varien/Io/Abstract.php index 09dd9663db9..f7ee9410433 100644 --- a/lib/Varien/Io/Abstract.php +++ b/lib/Varien/Io/Abstract.php @@ -63,9 +63,9 @@ public function getCleanPath($path) return './'; } - $path = trim(preg_replace("/\\\\/", "/", (string)$path)); + $path = trim(preg_replace('/\\\\/', '/', (string)$path)); - if (!preg_match("/(\.\w{1,4})$/", $path) && !preg_match("/\?[^\\/]+$/", $path) && !preg_match("/\\/$/", $path)) { + if (!preg_match("/(\.\w{1,4})$/", $path) && !preg_match("/\?[^\\/]+$/", $path) && !preg_match('/\\/$/', $path)) { $path .= '/'; } @@ -76,16 +76,16 @@ public function getCleanPath($path) $pathTokR = $matches[0][1]; $pathTokP = $matches[0][2]; - $pathTokP = preg_replace(["/^\\/+/", "/\\/+/"], ["", "/"], $pathTokP); + $pathTokP = preg_replace(['/^\\/+/', '/\\/+/'], ['', '/'], $pathTokP); - $pathParts = explode("/", $pathTokP); + $pathParts = explode('/', $pathTokP); $realPathParts = []; for ($i = 0, $realPathParts = []; $i < count($pathParts); $i++) { if ($pathParts[$i] == '.') { continue; } elseif ($pathParts[$i] == '..') { - if ((isset($realPathParts[0]) && $realPathParts[0] != '..') || ($pathTokR != "")) { + if ((isset($realPathParts[0]) && $realPathParts[0] != '..') || ($pathTokR != '')) { array_pop($realPathParts); continue; } diff --git a/lib/Varien/Io/File.php b/lib/Varien/Io/File.php index 30a71a6444e..ca8658391fb 100644 --- a/lib/Varien/Io/File.php +++ b/lib/Varien/Io/File.php @@ -409,7 +409,7 @@ public static function rmdirRecursive($dir, $recursive = true) if (!strcmp($item, '.') || !strcmp($item, '..')) { continue; } - self::rmdirRecursive($dir . "/" . $item, $recursive); + self::rmdirRecursive($dir . '/' . $item, $recursive); } $result = @rmdir($dir); } elseif (file_exists($dir)) { @@ -898,13 +898,13 @@ protected function _parsePermissions($mode) /* Adjust for SUID, SGID and sticky bit */ if ($mode & 0x800) { - $owner["execute"] = ($owner['execute'] == 'x') ? 's' : 'S'; + $owner['execute'] = ($owner['execute'] == 'x') ? 's' : 'S'; } if ($mode & 0x400) { - $group["execute"] = ($group['execute'] == 'x') ? 's' : 'S'; + $group['execute'] = ($group['execute'] == 'x') ? 's' : 'S'; } if ($mode & 0x200) { - $world["execute"] = ($world['execute'] == 'x') ? 't' : 'T'; + $world['execute'] = ($world['execute'] == 'x') ? 't' : 'T'; } $s = sprintf('%1s', $type); diff --git a/lib/Varien/Io/Sftp.php b/lib/Varien/Io/Sftp.php index 6c71da2c54b..024140880b1 100644 --- a/lib/Varien/Io/Sftp.php +++ b/lib/Varien/Io/Sftp.php @@ -53,7 +53,7 @@ public function open(array $args = []) } $this->_connection = new \phpseclib3\Net\SFTP($host, $port, $args['timeout']); if (!$this->_connection->login($args['username'], $args['password'])) { - throw new Exception(sprintf(__("Unable to open SFTP connection as %s@%s", $args['username'], $args['host']))); + throw new Exception(sprintf(__('Unable to open SFTP connection as %s@%s', $args['username'], $args['host']))); } } diff --git a/lib/Varien/Object.php b/lib/Varien/Object.php index bfd0f11bcff..f82f4ed6098 100644 --- a/lib/Varien/Object.php +++ b/lib/Varien/Object.php @@ -635,7 +635,7 @@ public function __call($method, $args) //Varien_Profiler::stop('HAS: '.get_class($this).'::'.$method); return isset($this->_data[$key]); } - throw new Varien_Exception("Invalid method " . get_class($this) . "::" . $method . "(" . print_r($args, 1) . ")"); + throw new Varien_Exception('Invalid method ' . get_class($this) . '::' . $method . '(' . print_r($args, 1) . ')'); } /** @@ -690,7 +690,7 @@ protected function _underscore($name) return self::$_underscoreCache[$name]; } #Varien_Profiler::start('underscore'); - $result = strtolower(preg_replace('/([A-Z])/', "_$1", lcfirst($name))); + $result = strtolower(preg_replace('/([A-Z])/', '_$1', lcfirst($name))); #Varien_Profiler::stop('underscore'); self::$_underscoreCache[$name] = $result; return $result; diff --git a/lib/Varien/Profiler.php b/lib/Varien/Profiler.php index 0153bbc9bcc..e2308ff6201 100644 --- a/lib/Varien/Profiler.php +++ b/lib/Varien/Profiler.php @@ -162,11 +162,11 @@ public static function getSqlProfiler($res) } } - $out .= 'Executed ' . $queryCount . ' queries in ' . $totalTime . ' seconds' . "
        "; - $out .= 'Average query length: ' . $totalTime / $queryCount . ' seconds' . "
        "; - $out .= 'Queries per second: ' . $queryCount / $totalTime . "
        "; - $out .= 'Longest query length: ' . $longestTime . "
        "; - $out .= 'Longest query:
        ' . $longestQuery . "
        "; + $out .= 'Executed ' . $queryCount . ' queries in ' . $totalTime . ' seconds' . '
        '; + $out .= 'Average query length: ' . $totalTime / $queryCount . ' seconds' . '
        '; + $out .= 'Queries per second: ' . $queryCount / $totalTime . '
        '; + $out .= 'Longest query length: ' . $longestTime . '
        '; + $out .= 'Longest query:
        ' . $longestQuery . '
        '; } return $out; } diff --git a/lib/Varien/Simplexml/Config.php b/lib/Varien/Simplexml/Config.php index 12f1a424805..ef4f5aeebc8 100644 --- a/lib/Varien/Simplexml/Config.php +++ b/lib/Varien/Simplexml/Config.php @@ -72,7 +72,7 @@ class Varien_Simplexml_Config * * @example */ - protected $_xpathExtends = "//*[@extends]"; + protected $_xpathExtends = '//*[@extends]'; /** * Constructor diff --git a/lib/Varien/Simplexml/Element.php b/lib/Varien/Simplexml/Element.php index 6f19de595ee..ee22aa78864 100644 --- a/lib/Varien/Simplexml/Element.php +++ b/lib/Varien/Simplexml/Element.php @@ -141,10 +141,10 @@ public function descend($path) // Simple exploding by / does not suffice, // as an attribute value may contain a / inside // Note that there are three matches for different kinds of attribute values specification - if (strpos($path, "@") === false) { + if (strpos($path, '@') === false) { $pathArr = explode('/', $path); } else { - $regex = "#([^@/\\\"]+(?:@[^=/]+=(?:\\\"[^\\\"]*\\\"|[^/]*))?)/?#"; + $regex = '#([^@/\\"]+(?:@[^=/]+=(?:\\"[^\\"]*\\"|[^/]*))?)/?#'; $pathArr = $pathMatches = []; if (preg_match_all($regex, $path, $pathMatches)) { $pathArr = $pathMatches[1]; diff --git a/shell/indexer.php b/shell/indexer.php index 47d0494e4ca..929820ec06c 100644 --- a/shell/indexer.php +++ b/shell/indexer.php @@ -160,7 +160,7 @@ public function run() $resultTime = microtime(true) - $startTime; Mage::dispatchEvent($process->getIndexerCode() . '_shell_reindex_after'); echo $process->getIndexer()->getName() - . " index was rebuilt successfully in " . gmdate('H:i:s', ceil($resultTime)) . "\n"; + . ' index was rebuilt successfully in ' . gmdate('H:i:s', ceil($resultTime)) . "\n"; } catch (Mage_Core_Exception $e) { echo $e->getMessage() . "\n"; } catch (Exception $e) { From 35f331bc86ef2390cf73e23966f1fa0db862c879 Mon Sep 17 00:00:00 2001 From: Tony Date: Mon, 2 Sep 2024 07:46:44 +0200 Subject: [PATCH 3/6] Fixed issues #4134 undefined array index label_use_default in Mage_Catalog_Model_Product_Attribute_Backend_Media (#4136) * fix issues 4134 * better code Co-authored-by: kiatng --------- Co-authored-by: Ng Kiat Siong --- .../Mage/Catalog/Model/Product/Attribute/Backend/Media.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php index 142faed3128..9bbd405d247 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Backend/Media.php @@ -167,11 +167,13 @@ public function beforeSave($object) foreach ($value['values'] as $mediaAttrCode => $attrData) { if (array_key_exists($attrData, $newImages)) { $object->setData($mediaAttrCode, $newImages[$attrData]['new_file']); - $object->setData($mediaAttrCode . '_label', ($newImages[$attrData]['label'] === null || $newImages[$attrData]['label_use_default']) ? $newImages[$attrData]['label_default'] : $newImages[$attrData]['label']); + $label = $newImages[$attrData]['label'] === null || !empty($newImages[$attrData]['label_use_default']) ? $newImages[$attrData]['label_default'] : $newImages[$attrData]['label']; + $object->setData($mediaAttrCode . '_label', $label); } if (array_key_exists($attrData, $existImages)) { - $object->setData($mediaAttrCode . '_label', ($existImages[$attrData]['label'] === null || $existImages[$attrData]['label_use_default']) ? $existImages[$attrData]['label_default'] : $existImages[$attrData]['label']); + $label = $existImages[$attrData]['label'] === null || !empty($existImages[$attrData]['label_use_default']) ? $existImages[$attrData]['label_default'] : $existImages[$attrData]['label']; + $object->setData($mediaAttrCode . '_label', $label); } } From 99c778a198642b9e4b6025d9dfe6ce7baf159b6f Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 2 Sep 2024 07:47:58 +0200 Subject: [PATCH 4/6] PhpStan fixes (#4146) * Rector: CQ - UnusedForeachValueToArrayKeysRector (#1) * Rector: CQ - UnusedForeachValueToArrayKeysRector See Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector * fixes + phpstan See fix at rector: https://github.com/rectorphp/rector-src/pull/6164 * Fixes some phpstan errors * Revert "Rector: CQ - UnusedForeachValueToArrayKeysRector (#1)" This reverts commit 3d7eaf63f2211a9e1a8defe8c29e8f6da889ab2e. * Update app/code/core/Mage/Tag/Model/Tag.php Co-authored-by: Ng Kiat Siong * Updated docblock - have to keep array from parent method --------- Co-authored-by: Ng Kiat Siong --- .../Mage/Cms/Model/Wysiwyg/Images/Storage.php | 2 +- app/code/core/Mage/Core/Block/Abstract.php | 4 +- app/code/core/Mage/Core/Helper/String.php | 2 +- app/code/core/Mage/Core/Model/Config.php | 6 +- app/code/core/Mage/Core/Model/Store.php | 4 +- app/code/core/Mage/Core/functions.php | 6 +- .../core/Mage/Tag/Block/Customer/Tags.php | 2 +- app/code/core/Mage/Tag/Block/Product/List.php | 2 +- .../core/Mage/Tag/Block/Product/Result.php | 4 +- app/code/core/Mage/Tag/Model/Api.php | 1 + app/code/core/Mage/Tag/Model/Api/V2.php | 6 +- .../Tag/Model/Entity/Customer/Collection.php | 1 + .../Model/Resource/Customer/Collection.php | 1 + app/code/core/Mage/Tag/Model/Tag.php | 1 + lib/Varien/Simplexml/Element.php | 2 +- phpstan.dist.baseline.neon | 127 +----------------- 16 files changed, 27 insertions(+), 144 deletions(-) diff --git a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php index 94e143a9073..8aa9f1998c3 100644 --- a/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php @@ -28,7 +28,7 @@ class Mage_Cms_Model_Wysiwyg_Images_Storage extends Varien_Object /** * Config object * - * @var Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false + * @var Mage_Core_Model_Config_Element */ protected $_config; diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index f33b14a031e..b052542446c 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -993,7 +993,9 @@ protected function _getUrlModelClass() */ protected function _getUrlModel() { - return Mage::getModel($this->_getUrlModelClass()); + /** @var Mage_Core_Model_Url $model */ + $model = Mage::getModel($this->_getUrlModelClass()); + return $model; } /** diff --git a/app/code/core/Mage/Core/Helper/String.php b/app/code/core/Mage/Core/Helper/String.php index 49544a73856..02ab17ead36 100644 --- a/app/code/core/Mage/Core/Helper/String.php +++ b/app/code/core/Mage/Core/Helper/String.php @@ -466,7 +466,7 @@ protected function _getLastSubkey($key, $withBrackets = true) /** * Set array helper * - * @param Mage_Core_Helper_Abstract|Mage_Core_Helper_Array $helper + * @param Mage_Core_Helper_Array $helper * @return $this */ public function setArrayHelper(Mage_Core_Helper_Abstract $helper) diff --git a/app/code/core/Mage/Core/Model/Config.php b/app/code/core/Mage/Core/Model/Config.php index b921c35fe42..546aa7bbef4 100644 --- a/app/code/core/Mage/Core/Model/Config.php +++ b/app/code/core/Mage/Core/Model/Config.php @@ -724,7 +724,7 @@ protected function _getSectionConfig($path) * Get node value from cached section data * * @param array $path - * @return false|Varien_Simplexml_Element + * @return false|Mage_Core_Model_Config_Element */ public function getSectionNode($path) { @@ -741,7 +741,7 @@ public function getSectionNode($path) * Returns node found by the $path and scope info * * @inheritDoc - * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false + * @return Mage_Core_Model_Config_Element */ public function getNode($path = null, $scope = '', $scopeCode = null) { @@ -1150,7 +1150,7 @@ public function substDistroServerVars($data) * Get module config node * * @param string $moduleName - * @return Mage_Core_Model_Config_Element|SimpleXMLElement + * @return Mage_Core_Model_Config_Element */ public function getModuleConfig($moduleName = '') { diff --git a/app/code/core/Mage/Core/Model/Store.php b/app/code/core/Mage/Core/Model/Store.php index 286db5850d0..981e8d1fe66 100644 --- a/app/code/core/Mage/Core/Model/Store.php +++ b/app/code/core/Mage/Core/Model/Store.php @@ -967,9 +967,9 @@ public function roundPrice($price) /** * Format price with currency filter (taking rate into consideration) * - * @param double $price + * @param float $price * @param bool $includeContainer - * @return string + * @return string|float */ public function formatPrice($price, $includeContainer = true) { diff --git a/app/code/core/Mage/Core/functions.php b/app/code/core/Mage/Core/functions.php index de853bee9c5..1e46c5d5814 100644 --- a/app/code/core/Mage/Core/functions.php +++ b/app/code/core/Mage/Core/functions.php @@ -103,7 +103,7 @@ function mageFindClassFile($class) * @param string $errstr * @param string $errfile * @param int $errline - * @return bool|void + * @return bool|null */ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) { @@ -184,6 +184,7 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) throw new Exception($errorMessage); } else { Mage::log($errorMessage, Zend_Log::ERR); + return null; } } @@ -191,7 +192,7 @@ function mageCoreErrorHandler($errno, $errstr, $errfile, $errline) * @param bool $return * @param bool $html * @param bool $showFirst - * @return string|void + * @return string|null * * @SuppressWarnings(PHPMD.ErrorControlOperator) */ @@ -216,6 +217,7 @@ function mageDebugBacktrace($return = false, $html = true, $showFirst = false) return $out; } else { echo $out; + return null; } } diff --git a/app/code/core/Mage/Tag/Block/Customer/Tags.php b/app/code/core/Mage/Tag/Block/Customer/Tags.php index 075c3960090..01ce223e417 100644 --- a/app/code/core/Mage/Tag/Block/Customer/Tags.php +++ b/app/code/core/Mage/Tag/Block/Customer/Tags.php @@ -31,7 +31,7 @@ protected function _loadTags() $this->_tags = []; $tags = Mage::getResourceModel('tag/tag_collection') - ->addPopularity(null, Mage::app()->getStore()->getId()) + ->addPopularity() ->setOrder('popularity', 'DESC') ->addCustomerFilter(Mage::getSingleton('customer/session')->getCustomerId()) ->setActiveFilter() diff --git a/app/code/core/Mage/Tag/Block/Product/List.php b/app/code/core/Mage/Tag/Block/Product/List.php index fd71223d3c8..d69ee562fa1 100644 --- a/app/code/core/Mage/Tag/Block/Product/List.php +++ b/app/code/core/Mage/Tag/Block/Product/List.php @@ -83,7 +83,7 @@ protected function _getCollection() protected function _beforeToHtml() { if (!$this->getProductId()) { - return false; + return $this; } return parent::_beforeToHtml(); diff --git a/app/code/core/Mage/Tag/Block/Product/Result.php b/app/code/core/Mage/Tag/Block/Product/Result.php index aeb8638ff49..bd5da0fb927 100644 --- a/app/code/core/Mage/Tag/Block/Product/Result.php +++ b/app/code/core/Mage/Tag/Block/Product/Result.php @@ -24,7 +24,7 @@ class Mage_Tag_Block_Product_Result extends Mage_Catalog_Block_Product_Abstract { /** - * @var Mage_Tag_Model_Resource_Tag_Collection|null + * @var Mage_Tag_Model_Resource_Product_Collection|null */ protected $_productCollection; @@ -81,7 +81,7 @@ public function getProductListHtml() } /** - * @return Mage_Tag_Model_Resource_Tag_Collection + * @return Mage_Tag_Model_Resource_Product_Collection * @throws Mage_Core_Model_Store_Exception */ protected function _getProductCollection() diff --git a/app/code/core/Mage/Tag/Model/Api.php b/app/code/core/Mage/Tag/Model/Api.php index bb04b28c842..bb8debcee0e 100644 --- a/app/code/core/Mage/Tag/Model/Api.php +++ b/app/code/core/Mage/Tag/Model/Api.php @@ -95,6 +95,7 @@ public function info($tagId, $store) */ public function add($data) { + $result = []; $data = $this->_prepareDataForAdd($data); /** @var Mage_Catalog_Model_Product $product */ $product = Mage::getModel('catalog/product')->load($data['product_id']); diff --git a/app/code/core/Mage/Tag/Model/Api/V2.php b/app/code/core/Mage/Tag/Model/Api/V2.php index 92fa9b27c8e..0684d77772a 100644 --- a/app/code/core/Mage/Tag/Model/Api/V2.php +++ b/app/code/core/Mage/Tag/Model/Api/V2.php @@ -59,7 +59,7 @@ public function add($data) * * @param int $tagId * @param string|int $store - * @return object + * @return object|array */ public function info($tagId, $store) { @@ -74,7 +74,7 @@ public function info($tagId, $store) /** * Convert data from object to array before add * - * @param object $data + * @param array|object $data * @return array */ protected function _prepareDataForAdd($data) @@ -86,7 +86,7 @@ protected function _prepareDataForAdd($data) /** * Convert data from object to array before update * - * @param object $data + * @param array|object $data * @return array */ protected function _prepareDataForUpdate($data) diff --git a/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php index f6fe3c7b8b6..d358c941611 100644 --- a/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php @@ -22,6 +22,7 @@ class Mage_Tag_Model_Entity_Customer_Collection extends Mage_Customer_Model_Entity_Customer_Collection { protected $_tagTable; + protected $_tagRelTable; public function __construct() diff --git a/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php index d9b4dbf5770..167552ad0f2 100644 --- a/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php +++ b/app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php @@ -268,6 +268,7 @@ public function getSelectCountSql() public function addProductName() { $productsId = []; + $productsSku = []; $productsData = []; foreach ($this->getItems() as $item) { diff --git a/app/code/core/Mage/Tag/Model/Tag.php b/app/code/core/Mage/Tag/Model/Tag.php index 0f20394cd4c..1dc6ee88c3a 100644 --- a/app/code/core/Mage/Tag/Model/Tag.php +++ b/app/code/core/Mage/Tag/Model/Tag.php @@ -366,6 +366,7 @@ public function saveRelation($productId, $customerId, $storeId) ->setActive(Mage_Tag_Model_Tag_Relation::STATUS_ACTIVE) ->setCreatedAt($relationModel->getResource()->formatDate(time())); + $result = ''; $relationModelSaveNeed = false; switch ($this->getStatus()) { case $this->getApprovedStatus(): diff --git a/lib/Varien/Simplexml/Element.php b/lib/Varien/Simplexml/Element.php index ee22aa78864..e07d39e6b77 100644 --- a/lib/Varien/Simplexml/Element.php +++ b/lib/Varien/Simplexml/Element.php @@ -128,7 +128,7 @@ public function addChild($name, $value=null, $namespace=null) * @todo Do we need to make it xpath look-a-like? * @todo Check if we still need all this and revert to plain XPath if this makes any sense * @todo param string $path Subset of xpath. Example: "child/grand[@attrName='attrValue']/subGrand" - * @param string $path Example: "child/grand@attrName=attrValue/subGrand" (to make it faster without regex) + * @param array|string $path Example: "child/grand@attrName=attrValue/subGrand" (to make it faster without regex) * @return Varien_Simplexml_Element|false */ public function descend($path) diff --git a/phpstan.dist.baseline.neon b/phpstan.dist.baseline.neon index 58d3dfd945d..aff5acc1f79 100644 --- a/phpstan.dist.baseline.neon +++ b/phpstan.dist.baseline.neon @@ -480,16 +480,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/Model/Config/Data.php - - - message: "#^Method Mage_Adminhtml_Model_Config_Data\\:\\:getConfigRoot\\(\\) should return Mage_Core_Model_Config_Element but returns Varien_Simplexml_Element\\|false\\.$#" - count: 1 - path: app/code/core/Mage/Adminhtml/Model/Config/Data.php - - - - message: "#^Property Mage_Adminhtml_Model_Config_Data\\:\\:\\$_configRoot \\(Mage_Core_Model_Config_Element\\|null\\) does not accept Varien_Simplexml_Element\\|false\\.$#" - count: 1 - path: app/code/core/Mage/Adminhtml/Model/Config/Data.php - - message: "#^Method Mage_Eav_Model_Entity_Abstract\\:\\:load\\(\\) invoked with 1 parameter, 2\\-3 required\\.$#" count: 1 @@ -565,11 +555,6 @@ parameters: count: 1 path: app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Adminhtml/controllers/IndexController.php - - message: "#^Variable \\$id in isset\\(\\) always exists and is not nullable\\.$#" count: 1 @@ -2170,11 +2155,6 @@ parameters: count: 1 path: app/code/core/Mage/Checkout/controllers/OnepageController.php - - - message: "#^Method Mage_Cms_Model_Wysiwyg_Images_Storage\\:\\:getConfig\\(\\) should return Mage_Core_Model_Config_Element but returns Varien_Simplexml_Element\\|false\\.$#" - count: 1 - path: app/code/core/Mage/Cms/Model/Wysiwyg/Images/Storage.php - - message: "#^Method Mage_Eav_Model_Entity_Attribute_Source_Interface\\:\\:getAllOptions\\(\\) invoked with 2 parameters, 0 required\\.$#" count: 1 @@ -2185,11 +2165,6 @@ parameters: count: 2 path: app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php - - - message: "#^Method Mage_Core_Block_Abstract\\:\\:_getUrlModel\\(\\) should return Mage_Core_Model_Url but returns Mage_Core_Model_Abstract\\|false\\.$#" - count: 1 - path: app/code/core/Mage/Core/Block/Abstract.php - - message: "#^Method Mage_Core_Block_Abstract\\:\\:getHelper\\(\\) should return \\$this\\(Mage_Core_Block_Abstract\\) but returns Mage_Core_Block_Abstract\\.$#" count: 1 @@ -2210,11 +2185,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Controller/Front/Router.php - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:is\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Core/Controller/Varien/Action.php - - message: "#^Constructor of class Mage_Core_Controller_Varien_Action has an unused parameter \\$invokeArgs\\.$#" count: 1 @@ -2285,11 +2255,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Helper/Abstract.php - - - message: "#^Property Mage_Core_Helper_String\\:\\:\\$_arrayHelper \\(Mage_Core_Helper_Array\\) does not accept Mage_Core_Helper_Abstract\\.$#" - count: 1 - path: app/code/core/Mage/Core/Helper/String.php - - message: "#^Property Mage_Core_Model_Abstract\\:\\:\\$_cacheTag \\(string\\|true\\) does not accept default value of type false\\.$#" count: 1 @@ -2330,28 +2295,13 @@ parameters: count: 1 path: app/code/core/Mage/Core/Model/Cache.php - - - message: "#^Call to an undefined method SimpleXMLElement\\:\\:getClassName\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Core/Model/Config.php - - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#" - count: 2 - path: app/code/core/Mage/Core/Model/Config.php - - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:is\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Core/Model/Config.php - - message: "#^Method Mage_Core_Model_Config\\:\\:cleanCache\\(\\) should return \\$this\\(Mage_Core_Model_Config\\) but returns Mage_Core_Model_Config\\.$#" count: 1 path: app/code/core/Mage/Core/Model/Config.php - - message: "#^Method Mage_Core_Model_Config\\:\\:getNodeClassInstance\\(\\) should return bool but returns object\\.$#" + message: "#^Method Mage_Core_Model_Config\\:\\:getNode\\(\\) should return Mage_Core_Model_Config_Element but returns Varien_Simplexml_Element\\|false\\.$#" count: 1 path: app/code/core/Mage/Core/Model/Config.php @@ -2575,21 +2525,11 @@ parameters: count: 1 path: app/code/core/Mage/Core/Model/Resource/Iterator.php - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#" - count: 2 - path: app/code/core/Mage/Core/Model/Resource/Setup.php - - message: "#^Property Mage_Core_Model_Resource_Setup\\:\\:\\$_conn \\(Varien_Db_Adapter_Pdo_Mysql\\) does not accept Varien_Db_Adapter_Interface\\|false\\.$#" count: 1 path: app/code/core/Mage/Core/Model/Resource/Setup.php - - - message: "#^Property Mage_Core_Model_Resource_Setup\\:\\:\\$_moduleConfig \\(Mage_Core_Model_Config_Element\\) does not accept SimpleXMLElement\\.$#" - count: 1 - path: app/code/core/Mage/Core/Model/Resource/Setup.php - - message: "#^Property Mage_Core_Model_Resource_Setup\\:\\:\\$_resourceConfig \\(Mage_Core_Model_Config_Element\\) does not accept SimpleXMLElement\\.$#" count: 1 @@ -2625,11 +2565,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Model/Store.php - - - message: "#^Method Mage_Core_Model_Store\\:\\:formatPrice\\(\\) should return string but returns float\\.$#" - count: 1 - path: app/code/core/Mage/Core/Model/Store.php - - message: "#^PHPDoc type bool of property Mage_Core_Model_Store\\:\\:\\$_cacheTag is not covariant with PHPDoc type string\\|true of overridden property Mage_Core_Model_Abstract\\:\\:\\$_cacheTag\\.$#" count: 1 @@ -2675,16 +2610,6 @@ parameters: count: 1 path: app/code/core/Mage/Core/Model/Url/Rewrite/Request.php - - - message: "#^Function mageCoreErrorHandler\\(\\) never returns void so it can be removed from the return type\\.$#" - count: 1 - path: app/code/core/Mage/Core/functions.php - - - - message: "#^Function mageDebugBacktrace\\(\\) never returns void so it can be removed from the return type\\.$#" - count: 1 - path: app/code/core/Mage/Core/functions.php - - message: "#^Variable \\$arguments might not be defined\\.$#" count: 1 @@ -4200,11 +4125,6 @@ parameters: count: 3 path: app/code/core/Mage/Sales/Model/Quote/Address.php - - - message: "#^Call to an undefined method Varien_Simplexml_Element\\:\\:getClassName\\(\\)\\.$#" - count: 1 - path: app/code/core/Mage/Sales/Model/Quote/Address/Total/Collector.php - - message: "#^Return type \\(\\$this\\(Mage_Sales_Model_Quote_Address_Total_Discount\\)\\) of method Mage_Sales_Model_Quote_Address_Total_Discount\\:\\:fetch\\(\\) should be compatible with return type \\(array\\) of method Mage_Sales_Model_Quote_Address_Total_Abstract\\:\\:fetch\\(\\)$#" count: 1 @@ -4490,56 +4410,11 @@ parameters: count: 1 path: app/code/core/Mage/Sitemap/Model/Resource/Catalog/Abstract.php - - - message: "#^Method Mage_Tag_Model_Resource_Tag_Collection\\:\\:addPopularity\\(\\) invoked with 2 parameters, 0\\-1 required\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Block/Customer/Tags.php - - - - message: "#^Method Mage_Tag_Block_Product_List\\:\\:_beforeToHtml\\(\\) should return \\$this\\(Mage_Tag_Block_Product_List\\) but returns false\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Block/Product/List.php - - - - message: "#^Property Mage_Tag_Block_Product_Result\\:\\:\\$_productCollection \\(Mage_Tag_Model_Resource_Tag_Collection\\|null\\) does not accept Mage_Tag_Model_Resource_Product_Collection\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Block/Product/Result.php - - - - message: "#^Variable \\$result might not be defined\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Api.php - - - - message: "#^Parameter \\#1 \\$data \\(object\\) of method Mage_Tag_Model_Api_V2\\:\\:_prepareDataForAdd\\(\\) should be compatible with parameter \\$data \\(array\\) of method Mage_Tag_Model_Api\\:\\:_prepareDataForAdd\\(\\)$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Api/V2.php - - - - message: "#^Parameter \\#1 \\$data \\(object\\) of method Mage_Tag_Model_Api_V2\\:\\:_prepareDataForUpdate\\(\\) should be compatible with parameter \\$data \\(array\\) of method Mage_Tag_Model_Api\\:\\:_prepareDataForUpdate\\(\\)$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Api/V2.php - - - - message: "#^Return type \\(object\\) of method Mage_Tag_Model_Api_V2\\:\\:info\\(\\) should be compatible with return type \\(array\\) of method Mage_Tag_Model_Api\\:\\:info\\(\\)$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Api/V2.php - - message: "#^Access to an undefined property Mage_Tag_Model_Entity_Customer_Collection\\:\\:\\$_read\\.$#" count: 1 path: app/code/core/Mage/Tag/Model/Entity/Customer/Collection.php - - - message: "#^Variable \\$productsSku might not be defined\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Resource/Customer/Collection.php - - - - message: "#^Variable \\$result might not be defined\\.$#" - count: 1 - path: app/code/core/Mage/Tag/Model/Tag.php - - message: "#^Call to an undefined method Mage_Tax_Block_Sales_Order_Tax\\:\\:addTotal\\(\\)\\.$#" count: 7 From 2b368b25760e74c708ef26209dbc98976265e2b2 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 2 Sep 2024 07:48:53 +0200 Subject: [PATCH 5/6] Removed last errors (#4164) Co-authored-by: Ng Kiat Siong --- .github/workflows/phpcs.yml | 2 +- app/code/core/Mage/Catalog/Helper/Image.php | 3 ++- app/code/core/Mage/Core/Block/Abstract.php | 2 +- app/code/core/Mage/Core/Block/Template/Facade.php | 3 ++- .../core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php | 3 ++- 5 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/phpcs.yml b/.github/workflows/phpcs.yml index e078a040ebe..420390adadc 100644 --- a/.github/workflows/phpcs.yml +++ b/.github/workflows/phpcs.yml @@ -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' }} diff --git a/app/code/core/Mage/Catalog/Helper/Image.php b/app/code/core/Mage/Catalog/Helper/Image.php index 0809ccd6eac..3939a00d2a6 100644 --- a/app/code/core/Mage/Catalog/Helper/Image.php +++ b/app/code/core/Mage/Catalog/Helper/Image.php @@ -266,9 +266,10 @@ public function constrainOnly($flag) */ public function backgroundColor($colorRGB) { + $args = func_get_args(); // assume that 3 params were given instead of array if (!is_array($colorRGB)) { - $colorRGB = func_get_args(); + $colorRGB = $args; } $this->_getModel()->setBackgroundColor($colorRGB); return $this; diff --git a/app/code/core/Mage/Core/Block/Abstract.php b/app/code/core/Mage/Core/Block/Abstract.php index b052542446c..a164fea34fc 100644 --- a/app/code/core/Mage/Core/Block/Abstract.php +++ b/app/code/core/Mage/Core/Block/Abstract.php @@ -513,9 +513,9 @@ public function unsetChild($alias) */ public function unsetCallChild($alias, $callback, $result, $params) { + $args = func_get_args(); $child = $this->getChild($alias); if ($child) { - $args = func_get_args(); $alias = array_shift($args); $callback = array_shift($args); $result = (string)array_shift($args); diff --git a/app/code/core/Mage/Core/Block/Template/Facade.php b/app/code/core/Mage/Core/Block/Template/Facade.php index 764f03903ca..6437feb2013 100644 --- a/app/code/core/Mage/Core/Block/Template/Facade.php +++ b/app/code/core/Mage/Core/Block/Template/Facade.php @@ -61,8 +61,9 @@ public function setDataByKeyFromRegistry($key, $registryKey) */ public function ifEquals($conditionKeys) { + $args = func_get_args(); if (!is_array($conditionKeys)) { - $conditionKeys = func_get_args(); + $conditionKeys = $args; } // evaluate conditions (equality) diff --git a/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php b/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php index 7a76430e5de..ac4a2f9b13e 100644 --- a/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php +++ b/app/code/core/Mage/Oauth/Model/Consumer/Validator/KeyLength.php @@ -35,8 +35,9 @@ class Mage_Oauth_Model_Consumer_Validator_KeyLength extends Zend_Validate_String */ public function __construct($options = []) { + $args = func_get_args(); if (!is_array($options)) { - $options = func_get_args(); + $options = $args; if (!isset($options[1])) { $options[1] = 'utf-8'; } From 220399dcbc8a8f39e0e1fffb3f2d61f150fa6b31 Mon Sep 17 00:00:00 2001 From: Sven Reichel Date: Mon, 2 Sep 2024 07:49:24 +0200 Subject: [PATCH 6/6] Small DocBlock update (#4160) * Rector: CQ - UnusedForeachValueToArrayKeysRector (#1) * Rector: CQ - UnusedForeachValueToArrayKeysRector See Rector\CodeQuality\Rector\Foreach_\UnusedForeachValueToArrayKeysRector * fixes + phpstan See fix at rector: https://github.com/rectorphp/rector-src/pull/6164 * Revert "Rector: CQ - UnusedForeachValueToArrayKeysRector (#1)" This reverts commit 3d7eaf63f2211a9e1a8defe8c29e8f6da889ab2e. * DocBlock update * Update app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php Co-authored-by: Ng Kiat Siong * Update app/code/core/Mage/Core/Model/Session/Abstract.php Co-authored-by: Ng Kiat Siong * Update app/code/core/Mage/Core/Model/Session/Abstract.php Co-authored-by: Ng Kiat Siong --------- Co-authored-by: Ng Kiat Siong --- app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php | 2 +- .../Mage/CatalogSearch/Model/Resource/Search/Collection.php | 4 ++-- app/code/core/Mage/Core/Model/Session/Abstract.php | 4 ++-- .../Newsletter/Model/Resource/Subscriber/Collection.php | 2 +- .../Model/Resource/Report/Invoiced/Collection/Order.php | 2 +- .../Mage/Sales/Model/Resource/Report/Order/Collection.php | 2 +- .../Model/Resource/Report/Refunded/Collection/Order.php | 2 +- .../Model/Resource/Report/Shipping/Collection/Order.php | 2 +- .../Mage/SalesRule/Model/Resource/Report/Collection.php | 2 +- app/code/core/Mage/Tax/Model/Resource/Report/Collection.php | 2 +- lib/Varien/Db/Adapter/Pdo/Mysql.php | 6 +++--- 11 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php b/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php index e8727e2b36f..78451d7bcde 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php +++ b/app/code/core/Mage/Adminhtml/Helper/Help/Mapping.php @@ -231,7 +231,7 @@ protected function findInMapping($frontModule, $controllerName, $actionName) /** * Determine which version of docs should target onto * - * @return string + * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false */ protected function getHelpTargetVersion() { diff --git a/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php index 7862c441895..c492cb21fcb 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/core/Mage/CatalogSearch/Model/Resource/Search/Collection.php @@ -105,7 +105,7 @@ protected function _hasAttributeOptionsAndSearchable($attribute) * Retrieve SQL for search entities * * @param string $query - * @return string + * @return Varien_Db_Select */ protected function _getSearchEntityIdsSql($query) { @@ -168,7 +168,7 @@ protected function _getSearchEntityIdsSql($query) * Retrieve SQL for search entities by option * * @param string $query - * @return false|string + * @return false|Varien_Db_Select */ protected function _getSearchInOptionSql($query) { diff --git a/app/code/core/Mage/Core/Model/Session/Abstract.php b/app/code/core/Mage/Core/Model/Session/Abstract.php index c3b858d04c3..1e30dc2ddc0 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract.php @@ -524,7 +524,7 @@ public function getSessionHosts() /** * Retrieve session save method * - * @return string + * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false|string */ public function getSessionSaveMethod() { @@ -537,7 +537,7 @@ public function getSessionSaveMethod() /** * Get session save path * - * @return string + * @return Mage_Core_Model_Config_Element|Varien_Simplexml_Element|false|string */ public function getSessionSavePath() { diff --git a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php index 511961f0a73..47f17964410 100644 --- a/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php +++ b/app/code/core/Mage/Newsletter/Model/Resource/Subscriber/Collection.php @@ -173,7 +173,7 @@ public function showStoreInfo() * @deprecated after 1.4.0.0-rc1 * * @param string $field - * @return string + * @return string|Zend_Db_Expr */ public function _getFieldTableAlias($field) { diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php index ee7b289e758..9f9e8662e5a 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced/Collection/Order.php @@ -24,7 +24,7 @@ class Mage_Sales_Model_Resource_Report_Invoiced_Collection_Order extends Mage_Sa /** * Period format * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php index 4e49fec48cc..6810a3b9029 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Collection.php @@ -24,7 +24,7 @@ class Mage_Sales_Model_Resource_Report_Order_Collection extends Mage_Sales_Model /** * Period format * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php index 0e568ccf98b..1872af34d95 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded/Collection/Order.php @@ -24,7 +24,7 @@ class Mage_Sales_Model_Resource_Report_Refunded_Collection_Order extends Mage_Sa /** * Period format * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php index 6f4108d7275..3054e6597b8 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping/Collection/Order.php @@ -24,7 +24,7 @@ class Mage_Sales_Model_Resource_Report_Shipping_Collection_Order extends Mage_Sa /** * Period format * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php index 354e7162f6b..93ed63c9c28 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Collection.php @@ -24,7 +24,7 @@ class Mage_SalesRule_Model_Resource_Report_Collection extends Mage_Sales_Model_R /** * Period format for report (day, month, year) * - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php b/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php index 83364b3ca50..291994d8c6a 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Collection.php @@ -22,7 +22,7 @@ class Mage_Tax_Model_Resource_Report_Collection extends Mage_Sales_Model_Resource_Report_Collection_Abstract { /** - * @var string + * @var Zend_Db_Expr */ protected $_periodFormat; diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index 6cde14f59cf..1e8d20bafca 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -277,7 +277,7 @@ public function getTransactionLevel() * Convert date to DB format * * @param int|string|Zend_Date $date - * @return string + * @return Zend_Db_Expr */ public function convertDate($date) { @@ -288,11 +288,11 @@ public function convertDate($date) * Convert date and time to DB format * * @param int|string|Zend_Date $datetime - * @return string + * @return Zend_Db_Expr */ public function convertDateTime($datetime) { - return $this->formatDate($datetime, true); + return $this->formatDate($datetime); } /**