diff --git a/.phpmd.dist.xml b/.phpmd.dist.xml index 1fb0e62b4f2..75175f09b1a 100644 --- a/.phpmd.dist.xml +++ b/.phpmd.dist.xml @@ -76,7 +76,7 @@ [-] LongClassName [x] ShortClassName [-] LongVariable - [x] ShortVariable + [-] ShortVariable [x] ShortMethodName - TMP disabled --> diff --git a/.rector.php b/.rector.php index fe2dd2477cf..bed5f24ef21 100644 --- a/.rector.php +++ b/.rector.php @@ -71,7 +71,6 @@ CodeQuality\Ternary\TernaryEmptyArrayArrayDimFetchToCoalesceRector::class, # todo: TMP CodeQuality\Ternary\UnnecessaryTernaryExpressionRector::class, # todo: TMP CodingStyle\Assign\SplitDoubleAssignRector::class, # todo: TMP - CodingStyle\Catch_\CatchExceptionNameMatchingTypeRector::class, # todo: TMP CodingStyle\ClassMethod\FuncGetArgsToVariadicParamRector::class, # todo: TMP CodingStyle\ClassMethod\MakeInheritedMethodVisibilitySameAsParentRector::class, # todo: TMP CodingStyle\Encapsed\EncapsedStringsToSprintfRector::class, # todo: TMP diff --git a/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php b/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php index c98539ec2af..98e3f69664b 100644 --- a/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php +++ b/app/code/core/Mage/Admin/Model/Acl/Role/Registry.php @@ -30,8 +30,8 @@ public function addParent($role, $parents) $roleId = $role; $role = $this->get($role); } - } catch (Zend_Acl_Role_Registry_Exception $e) { - throw new Zend_Acl_Role_Registry_Exception("Child Role id '$roleId' does not exist", $e->getCode(), $e); + } catch (Zend_Acl_Role_Registry_Exception $zendAclRoleRegistryException) { + throw new Zend_Acl_Role_Registry_Exception("Child Role id '$roleId' does not exist", $zendAclRoleRegistryException->getCode(), $zendAclRoleRegistryException); } if (!is_array($parents)) { diff --git a/app/code/core/Mage/Admin/Model/Resource/User.php b/app/code/core/Mage/Admin/Model/Resource/User.php index 6a73aacb571..94fc6196018 100644 --- a/app/code/core/Mage/Admin/Model/Resource/User.php +++ b/app/code/core/Mage/Admin/Model/Resource/User.php @@ -175,9 +175,9 @@ public function delete(Mage_Core_Model_Abstract $user) $adapter->delete($this->getMainTable(), $conditions); $adapter->delete($this->getTable('admin/role'), $conditions); $adapter->commit(); - } catch (Throwable $e) { + } catch (Throwable $throwable) { $adapter->rollBack(); - throw $e; + throw $throwable; } $this->_afterDelete($user); diff --git a/app/code/core/Mage/Admin/Model/User.php b/app/code/core/Mage/Admin/Model/User.php index 26d6741c2d4..d6a9894dfb4 100644 --- a/app/code/core/Mage/Admin/Model/User.php +++ b/app/code/core/Mage/Admin/Model/User.php @@ -404,9 +404,9 @@ public function authenticate($username, $password) 'user' => $this, 'result' => $result, ]); - } catch (Mage_Core_Exception $e) { + } catch (Mage_Core_Exception $mageCoreException) { $this->unsetData(); - throw $e; + throw $mageCoreException; } if (!$result) { diff --git a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php index b874b1f1495..40b2569a50c 100644 --- a/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php +++ b/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php @@ -777,9 +777,9 @@ protected function _beforeToHtml() { try { $this->_prepareGrid(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->resetSavedParametersInSession(); - throw $e; + throw $exception; } return parent::_beforeToHtml(); diff --git a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php index 31fa186792d..910bc24d35f 100644 --- a/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php +++ b/app/code/core/Mage/Adminhtml/Helper/Catalog/Product/Composite.php @@ -125,10 +125,10 @@ public function renderConfigureResult($controller, Varien_Object $configureResul $isOk = true; $productType = $product->getTypeId(); - } catch (Exception $e) { + } catch (Exception $exception) { $isOk = false; $productType = null; - Mage::register('composite_configure_result_error_message', $e->getMessage()); + Mage::register('composite_configure_result_error_message', $exception->getMessage()); } $this->_initConfigureResultLayout($controller, $isOk, $productType); diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php index 0f488d0d94d..6ce0e095da7 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Currency/Cron.php @@ -40,8 +40,8 @@ protected function _afterSave() ->setValue($cronExprString) ->setPath(self::CRON_STRING_PATH) ->save(); - } catch (Exception $e) { - throw new Exception(Mage::helper('cron')->__('Unable to save the cron expression.'), $e->getCode(), $e); + } catch (Exception $exception) { + throw new Exception(Mage::helper('cron')->__('Unable to save the cron expression.'), $exception->getCode(), $exception); } return $this; diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php index 1c324a601e7..d2c9b495b7d 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Product/Alert/Cron.php @@ -47,8 +47,8 @@ protected function _afterSave() ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH)) ->setPath(self::CRON_MODEL_PATH) ->save(); - } catch (Exception $e) { - throw new Exception(Mage::helper('cron')->__('Unable to save the cron expression.'), $e->getCode(), $e); + } catch (Exception $exception) { + throw new Exception(Mage::helper('cron')->__('Unable to save the cron expression.'), $exception->getCode(), $exception); } return $this; diff --git a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php index 0dcef0d981e..56a9bd47c9f 100644 --- a/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php +++ b/app/code/core/Mage/Adminhtml/Model/System/Config/Backend/Sitemap/Cron.php @@ -47,8 +47,8 @@ protected function _afterSave() ->setValue((string) Mage::getConfig()->getNode(self::CRON_MODEL_PATH)) ->setPath(self::CRON_MODEL_PATH) ->save(); - } catch (Exception $e) { - throw new Exception(Mage::helper('cron')->__('Unable to save the cron expression.'), $e->getCode(), $e); + } catch (Exception $exception) { + throw new Exception(Mage::helper('cron')->__('Unable to save the cron expression.'), $exception->getCode(), $exception); } return $this; diff --git a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php index 1be265f3791..26edc9b1a83 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Api/RoleController.php @@ -208,8 +208,8 @@ protected function _deleteUserFromRole($userId, $roleId) ->setRoleId($roleId) ->setUserId($userId) ->deleteFromRole(); - } catch (Exception $e) { - throw $e; + } catch (Exception $exception) { + throw $exception; } return true; 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 8866ff0a102..7a357ebf0b2 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/Product/GalleryController.php @@ -61,10 +61,10 @@ public function uploadAction() 'path' => $this->_getSession()->getCookiePath(), 'domain' => $this->_getSession()->getCookieDomain(), ]; - } catch (Exception $e) { + } catch (Exception $exception) { $result = [ - 'error' => $e->getMessage(), - 'errorcode' => $e->getCode()]; + 'error' => $exception->getMessage(), + 'errorcode' => $exception->getCode()]; } $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); diff --git a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php index 5c06f0e07ae..b06044c174e 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Catalog/ProductController.php @@ -826,9 +826,9 @@ public function duplicateAction() $newProduct = $product->duplicate(); $this->_getSession()->addSuccess($this->__('The product has been duplicated.')); $this->_redirect('*/*/edit', ['_current' => true, 'id' => $newProduct->getId()]); - } catch (Exception $e) { - Mage::logException($e); - $this->_getSession()->addError($e->getMessage()); + } catch (Exception $exception) { + Mage::logException($exception); + $this->_getSession()->addError($exception->getMessage()); $this->_redirect('*/*/edit', ['_current' => true]); } } diff --git a/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php b/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php index 352ab08124f..cd3f76a5e1b 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Cms/Wysiwyg/ImagesController.php @@ -37,8 +37,8 @@ public function indexAction() try { Mage::helper('cms/wysiwyg_images')->getCurrentPath(); - } catch (Exception $e) { - $this->_getSession()->addError($e->getMessage()); + } catch (Exception $exception) { + $this->_getSession()->addError($exception->getMessage()); } $this->_initAction()->loadLayout('overlay_popup'); @@ -69,8 +69,8 @@ public function contentsAction() $this->_initAction()->_saveSessionCurrentPath(); $this->loadLayout('empty'); $this->renderLayout(); - } catch (Exception $e) { - $result = ['error' => true, 'message' => $e->getMessage()]; + } catch (Exception $exception) { + $result = ['error' => true, 'message' => $exception->getMessage()]; $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); } } @@ -82,8 +82,8 @@ public function newFolderAction() $name = $this->getRequest()->getPost('name'); $path = $this->getStorage()->getSession()->getCurrentPath(); $result = $this->getStorage()->createDirectory($name, $path); - } catch (Exception $e) { - $result = ['error' => true, 'message' => $e->getMessage()]; + } catch (Exception $exception) { + $result = ['error' => true, 'message' => $exception->getMessage()]; } $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); @@ -94,8 +94,8 @@ public function deleteFolderAction() try { $path = $this->getStorage()->getSession()->getCurrentPath(); $this->getStorage()->deleteDirectory($path); - } catch (Exception $e) { - $result = ['error' => true, 'message' => $e->getMessage()]; + } catch (Exception $exception) { + $result = ['error' => true, 'message' => $exception->getMessage()]; $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); } } @@ -124,8 +124,8 @@ public function deleteFilesAction() $this->getStorage()->deleteFile($path . DS . $file); } } - } catch (Exception $e) { - $result = ['error' => true, 'message' => $e->getMessage()]; + } catch (Exception $exception) { + $result = ['error' => true, 'message' => $exception->getMessage()]; $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); } } @@ -140,8 +140,8 @@ public function uploadAction() $this->_initAction(); $targetPath = $this->getStorage()->getSession()->getCurrentPath(); $result = $this->getStorage()->uploadFile($targetPath, $this->getRequest()->getParam('type')); - } catch (Exception $e) { - $result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()]; + } catch (Exception $exception) { + $result = ['error' => $exception->getMessage(), 'errorcode' => $exception->getCode()]; } $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php index 6fce7336ca3..a0bb383ac48 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/Cart/Product/Composite/CartController.php @@ -94,9 +94,9 @@ public function configureAction() $configureResult->setBuyRequest($quoteItem->getBuyRequest()); $configureResult->setCurrentStoreId($quoteItem->getStoreId()); $configureResult->setCurrentCustomer($this->_customer); - } catch (Exception $e) { + } catch (Exception $exception) { $configureResult->setError(true); - $configureResult->setMessage($e->getMessage()); + $configureResult->setMessage($exception->getMessage()); } /** @var Mage_Adminhtml_Helper_Catalog_Product_Composite $helper */ @@ -125,9 +125,9 @@ public function updateAction() ->save(); $updateResult->setOk(true); - } catch (Exception $e) { + } catch (Exception $exception) { $updateResult->setError(true); - $updateResult->setMessage($e->getMessage()); + $updateResult->setMessage($exception->getMessage()); } $updateResult->setJsVarName($this->getRequest()->getParam('as_js_varname')); diff --git a/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php b/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php index 6895bd963ee..1da3504d6a8 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Customer/Wishlist/Product/Composite/WishlistController.php @@ -79,9 +79,9 @@ public function configureAction() $configureResult->setCurrentCustomerId($this->_wishlist->getCustomerId()); $configureResult->setOk(true); - } catch (Exception $e) { + } catch (Exception $exception) { $configureResult->setError(true); - $configureResult->setMessage($e->getMessage()); + $configureResult->setMessage($exception->getMessage()); } /** @var Mage_Adminhtml_Helper_Catalog_Product_Composite $helper */ @@ -111,9 +111,9 @@ public function updateAction() ->save(); $updateResult->setOk(true); - } catch (Exception $e) { + } catch (Exception $exception) { $updateResult->setError(true); - $updateResult->setMessage($e->getMessage()); + $updateResult->setMessage($exception->getMessage()); } $updateResult->setJsVarName($this->getRequest()->getParam('as_js_varname')); diff --git a/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php b/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php index ebe213d52ee..1f30b6d7e74 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Newsletter/QueueController.php @@ -246,8 +246,8 @@ public function saveAction() $queue->save(); $this->_redirect('*/*'); - } catch (Mage_Core_Exception $e) { - $this->_getSession()->addError($e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_getSession()->addError($mageCoreException->getMessage()); $id = $this->getRequest()->getParam('id'); if ($id) { $this->_redirect('*/*/edit', ['id' => $id]); diff --git a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php index 4ee87116edd..3fb7b0721b1 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Permissions/RoleController.php @@ -160,8 +160,8 @@ public function deleteAction() try { $role->delete(); Mage::getSingleton('adminhtml/session')->addSuccess($this->__('The role has been deleted.')); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); Mage::getSingleton('adminhtml/session')->addError($this->__('An error occurred while deleting this role.')); } @@ -269,8 +269,8 @@ protected function _deleteUserFromRole($userId, $roleId) ->setRoleId($roleId) ->setUserId($userId) ->deleteFromRole(); - } catch (Exception $e) { - throw $e; + } catch (Exception $exception) { + throw $exception; } return true; diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php index 6a892f1ada2..ba8e5787419 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Order/CreateController.php @@ -424,9 +424,9 @@ public function addConfiguredAction() try { $this->_initSession() ->_processData(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_reloadQuote(); - $errorMessage = $e->getMessage(); + $errorMessage = $exception->getMessage(); } // Form result for client javascript @@ -610,9 +610,9 @@ public function configureQuoteItemsAction() $configureResult->setProductId($quoteItem->getProductId()); $sessionQuote = Mage::getSingleton('adminhtml/session_quote'); $configureResult->setCurrentCustomerId($sessionQuote->getCustomerId()); - } catch (Exception $e) { + } catch (Exception $exception) { $configureResult->setError(true); - $configureResult->setMessage($e->getMessage()); + $configureResult->setMessage($exception->getMessage()); } // Render page diff --git a/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php b/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php index d3eb2f3951c..eba8d863dcb 100644 --- a/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php +++ b/app/code/core/Mage/Adminhtml/controllers/Sales/Recurring/ProfileController.php @@ -84,8 +84,8 @@ public function ordersAction() try { $this->_initProfile(); $this->loadLayout()->renderLayout(); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); $this->norouteAction(); } } diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php b/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php index f3950e7e90b..54c7858b8b6 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Config/System/StorageController.php @@ -71,9 +71,9 @@ public function synchronizeAction() try { $this->_getSyncSingleton()->synchronize($storage); - } catch (Exception $e) { - Mage::logException($e); - $flag->passError($e); + } catch (Exception $exception) { + Mage::logException($exception); + $flag->passError($exception); } $flag->setState(Mage_Core_Model_File_Storage_Flag::STATE_FINISHED)->save(); diff --git a/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php b/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php index d7cad710401..3d467f0d2f3 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/CurrencyController.php @@ -61,7 +61,7 @@ public function fetchRatesAction() $importModel = Mage::getModel( Mage::getConfig()->getNode('global/currency/import/services/' . $service . '/model')->asArray(), ); - } catch (Exception $e) { + } catch (Exception) { Mage::throwException(Mage::helper('adminhtml')->__('Unable to initialize import model')); } @@ -78,8 +78,8 @@ public function fetchRatesAction() } Mage::getSingleton('adminhtml/session')->setRates($rates); - } catch (Exception $e) { - Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + } catch (Exception $exception) { + Mage::getSingleton('adminhtml/session')->addError($exception->getMessage()); } $this->_redirect('*/*/'); diff --git a/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php b/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php index 3008959660c..8eaadb9cefa 100644 --- a/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php +++ b/app/code/core/Mage/Adminhtml/controllers/System/Email/TemplateController.php @@ -145,12 +145,12 @@ public function saveAction() Mage::helper('adminhtml')->__('The email template has been saved.'), ); $this->_redirect('*/*'); - } catch (Exception $e) { + } catch (Exception $exception) { Mage::getSingleton('adminhtml/session')->setData( 'email_template_form_data', $this->getRequest()->getParams(), ); - Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + Mage::getSingleton('adminhtml/session')->addError($exception->getMessage()); $this->_forward('new'); } } diff --git a/app/code/core/Mage/Api/Model/Acl/Role/Registry.php b/app/code/core/Mage/Api/Model/Acl/Role/Registry.php index 11c0f52a531..17f65acbfc6 100644 --- a/app/code/core/Mage/Api/Model/Acl/Role/Registry.php +++ b/app/code/core/Mage/Api/Model/Acl/Role/Registry.php @@ -30,8 +30,8 @@ public function addParent($role, $parents) $roleId = $role; $role = $this->get($role); } - } catch (Zend_Acl_Role_Registry_Exception $e) { - throw new Zend_Acl_Role_Registry_Exception("Child Role id '$roleId' does not exist", $e->getCode(), $e); + } catch (Zend_Acl_Role_Registry_Exception $zendAclRoleRegistryException) { + throw new Zend_Acl_Role_Registry_Exception("Child Role id '$roleId' does not exist", $zendAclRoleRegistryException->getCode(), $zendAclRoleRegistryException); } if (!is_array($parents)) { diff --git a/app/code/core/Mage/Api/Model/Resource/User.php b/app/code/core/Mage/Api/Model/Resource/User.php index 47f382c00aa..b3147ce35a7 100644 --- a/app/code/core/Mage/Api/Model/Resource/User.php +++ b/app/code/core/Mage/Api/Model/Resource/User.php @@ -231,9 +231,9 @@ public function delete(Mage_Core_Model_Abstract $user) $dbh->delete($this->getTable('api/user'), ['user_id = ?' => $uid]); $dbh->delete($this->getTable('api/role'), ['user_id = ?' => $uid]); $dbh->commit(); - } catch (Throwable $e) { + } catch (Throwable $throwable) { $dbh->rollBack(); - throw $e; + throw $throwable; } return $this; diff --git a/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php b/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php index 8fdc92860ff..587556e2e59 100644 --- a/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php +++ b/app/code/core/Mage/Api2/Model/Auth/Adapter/Oauth.php @@ -39,8 +39,8 @@ public function getUserParams(Mage_Api2_Model_Request $request) } $userParamsObj->type = $userType; - } catch (Exception $e) { - throw new Mage_Api2_Exception($oauthServer->reportProblem($e), Mage_Api2_Model_Server::HTTP_UNAUTHORIZED); + } catch (Exception $exception) { + throw new Mage_Api2_Exception($oauthServer->reportProblem($exception), Mage_Api2_Model_Server::HTTP_UNAUTHORIZED); } return $userParamsObj; diff --git a/app/code/core/Mage/Api2/Model/Multicall.php b/app/code/core/Mage/Api2/Model/Multicall.php index 16a40c6374c..2f4e079846f 100644 --- a/app/code/core/Mage/Api2/Model/Multicall.php +++ b/app/code/core/Mage/Api2/Model/Multicall.php @@ -123,10 +123,10 @@ protected function _internalCall($subresource, $requestData) /** @var Mage_Api2_Model_Response $internalResponse */ $internalResponse = Mage::getModel('api2/response'); $server->internalCall($internalRequest, $internalResponse); - } catch (Exception $e) { + } catch (Exception $exception) { // TODO: implement strict mode - Mage::logException($e); - $this->_getResponse()->setException($e); + Mage::logException($exception); + $this->_getResponse()->setException($exception); // TODO: Refactor partial success idintification process $this->_getResponse()->setHttpResponseCode(Mage_Api2_Model_Server::HTTP_CREATED); } diff --git a/app/code/core/Mage/Api2/Model/Resource.php b/app/code/core/Mage/Api2/Model/Resource.php index dcd589d6d3c..0f7ae0d409c 100644 --- a/app/code/core/Mage/Api2/Model/Resource.php +++ b/app/code/core/Mage/Api2/Model/Resource.php @@ -870,8 +870,8 @@ protected function _isSubCallAllowed($resourceId) try { return $globalAcl->isAllowed($this->getApiUser(), $resourceId, $this->getOperation()); - } catch (Mage_Api2_Exception $e) { - throw new Exception('Invalid arguments for isAllowed() call', $e->getCode(), $e); + } catch (Mage_Api2_Exception $mageApi2Exception) { + throw new Exception('Invalid arguments for isAllowed() call', $mageApi2Exception->getCode(), $mageApi2Exception); } } diff --git a/app/code/core/Mage/Api2/Model/Server.php b/app/code/core/Mage/Api2/Model/Server.php index c68e4aeeb72..48cfb65ae74 100644 --- a/app/code/core/Mage/Api2/Model/Server.php +++ b/app/code/core/Mage/Api2/Model/Server.php @@ -63,8 +63,8 @@ public function run() try { /** @var Mage_Api2_Model_Response $response */ $response = Mage::getSingleton('api2/response'); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); if (!headers_sent()) { header('HTTP/1.1 ' . self::HTTP_INTERNAL_ERROR); @@ -80,8 +80,8 @@ public function run() $request = Mage::getSingleton('api2/request'); /** @var Mage_Api2_Model_Renderer_Interface $renderer */ $renderer = Mage_Api2_Model_Renderer::factory($request->getAcceptTypes()); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); $response->setHttpResponseCode(self::HTTP_INTERNAL_ERROR) ->setBody('Service temporary unavailable') diff --git a/app/code/core/Mage/Authorizenet/Model/Directpost.php b/app/code/core/Mage/Authorizenet/Model/Directpost.php index c1e3f56b9f2..3b9bccdbead 100644 --- a/app/code/core/Mage/Authorizenet/Model/Directpost.php +++ b/app/code/core/Mage/Authorizenet/Model/Directpost.php @@ -220,9 +220,9 @@ public function refund(Varien_Object $payment, $amount) $payment->setCcLast4($payment->decrypt($last4)); try { $this->_refund($payment, $amount); - } catch (Exception $e) { + } catch (Exception $exception) { $payment->setCcLast4($last4); - throw $e; + throw $exception; } $payment->setCcLast4($last4); @@ -543,11 +543,11 @@ protected function _authOrder(Mage_Sales_Model_Order $order) try { $this->checkResponseCode(); $this->checkTransId(); - } catch (Exception $e) { + } catch (Exception $exception) { //decline the order (in case of wrong response code) but don't return money to customer. - $message = $e->getMessage(); + $message = $exception->getMessage(); $this->_declineOrder($order, $message, false); - throw $e; + throw $exception; } $response = $this->getResponse(); @@ -590,8 +590,8 @@ protected function _authOrder(Mage_Sales_Model_Order $order) ->load($order->getQuoteId()) ->setIsActive(false) ->save(); - } catch (Exception $e) { - Mage::logException($e); // do not cancel order if we couldn't send email + } catch (Exception $exception) { + Mage::logException($exception); // do not cancel order if we couldn't send email } } @@ -617,9 +617,9 @@ protected function _declineOrder(Mage_Sales_Model_Order $order, $message = '', $ $order->registerCancellation($message) ->save(); - } catch (Exception $e) { + } catch (Exception $exception) { //quiet decline - Mage::logException($e); + Mage::logException($exception); } } 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 68f8a2722f3..4c9efb2c91c 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Indexer/Price.php @@ -27,9 +27,9 @@ public function reindexAll() try { $this->_prepareBundlePrice(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php b/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php index 6d0d7e29469..22498508bd9 100644 --- a/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php +++ b/app/code/core/Mage/Bundle/Model/Resource/Price/Index.php @@ -250,9 +250,9 @@ protected function _savePriceIndex($productId, $websiteId, $groupId, $minPrice, $bind = [$productId, $websiteId, $groupId, $minPrice, $maxPrice]; $adapter->insertOnDuplicate($this->getMainTable(), $bind, ['min_price', 'max_price']); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Catalog/Helper/Image.php b/app/code/core/Mage/Catalog/Helper/Image.php index 8fcf8c6541d..3327dfae9ea 100644 --- a/app/code/core/Mage/Catalog/Helper/Image.php +++ b/app/code/core/Mage/Catalog/Helper/Image.php @@ -362,8 +362,8 @@ public function __toString() $url = $model->saveFile()->getUrl(); } - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); $url = Mage::getDesign()->getSkinUrl($this->getPlaceholder()); } diff --git a/app/code/core/Mage/Catalog/Helper/Product.php b/app/code/core/Mage/Catalog/Helper/Product.php index 1f996793fd3..4ed6e826015 100644 --- a/app/code/core/Mage/Catalog/Helper/Product.php +++ b/app/code/core/Mage/Catalog/Helper/Product.php @@ -369,8 +369,8 @@ public function initProduct($productId, $controller, $params = null) 'controller_action' => $controller, ], ); - } catch (Mage_Core_Exception $e) { - Mage::logException($e); + } catch (Mage_Core_Exception $mageCoreException) { + Mage::logException($mageCoreException); return false; } diff --git a/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php b/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php index 9ea65e451bf..6b0285472d0 100644 --- a/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php +++ b/app/code/core/Mage/Catalog/Model/Api2/Product/Validator/Product.php @@ -102,8 +102,8 @@ public function isValidData(array $data) $this->_validateStockData($data); $this->_validateAttributes($data, $productEntity); $isSatisfied = count($this->getErrors()) == 0; - } catch (Mage_Api2_Exception $e) { - $this->_addError($e->getMessage()); + } catch (Mage_Api2_Exception $mageApi2Exception) { + $this->_addError($mageApi2Exception->getMessage()); $isSatisfied = false; } diff --git a/app/code/core/Mage/Catalog/Model/Category.php b/app/code/core/Mage/Catalog/Model/Category.php index 539ab1e0e3e..94f217e53b6 100644 --- a/app/code/core/Mage/Catalog/Model/Category.php +++ b/app/code/core/Mage/Catalog/Model/Category.php @@ -297,9 +297,9 @@ public function move($parentId, $afterCategoryId) $moveComplete = true; $this->_getResource()->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getResource()->rollBack(); - throw $e; + throw $exception; } if ($moveComplete) { diff --git a/app/code/core/Mage/Catalog/Model/Category/Api.php b/app/code/core/Mage/Catalog/Model/Category/Api.php index 4ceee9f94fe..6f7085b5818 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api.php @@ -349,8 +349,8 @@ public function move($categoryId, $parentId, $afterId = null) try { $category->move($parentId, $afterId); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_moved', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_moved', $mageCoreException->getMessage()); } return true; @@ -372,8 +372,8 @@ public function delete($categoryId) try { $category->delete(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_deleted', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_deleted', $mageCoreException->getMessage()); } return true; @@ -449,8 +449,8 @@ public function assignProduct($categoryId, $productId, $position = null, $identi try { $category->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; @@ -480,8 +480,8 @@ public function updateProduct($categoryId, $productId, $position = null, $identi try { $category->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; @@ -510,8 +510,8 @@ public function removeProduct($categoryId, $productId, $identifierType = null) try { $category->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Catalog/Model/Category/Api/V2.php b/app/code/core/Mage/Catalog/Model/Category/Api/V2.php index d377aebcb5f..ffea3d5b0c7 100644 --- a/app/code/core/Mage/Catalog/Model/Category/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Category/Api/V2.php @@ -96,8 +96,8 @@ public function create($parentId, $categoryData, $store = null) } $category->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $category->getId(); diff --git a/app/code/core/Mage/Catalog/Model/Indexer/Url.php b/app/code/core/Mage/Catalog/Model/Indexer/Url.php index 671d53d9f0a..1ec4cba38aa 100644 --- a/app/code/core/Mage/Catalog/Model/Indexer/Url.php +++ b/app/code/core/Mage/Catalog/Model/Indexer/Url.php @@ -237,9 +237,9 @@ public function reindexAll() try { Mage::getSingleton('catalog/url')->refreshRewrites(); $resourceModel->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $resourceModel->rollBack(); - throw $e; + throw $exception; } } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Api.php b/app/code/core/Mage/Catalog/Model/Product/Api.php index 184bf3a5c82..499fc0f4993 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api.php @@ -80,8 +80,8 @@ public function items($filters = null, $store = null) foreach ($filters as $field => $value) { $collection->addFieldToFilter($field, $value); } - } catch (Mage_Core_Exception $e) { - $this->_fault('filters_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('filters_invalid', $mageCoreException->getMessage()); } $result = []; @@ -196,8 +196,8 @@ public function create($type, $set, $sku, $productData, $store = null) } $product->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $product->getId(); @@ -241,8 +241,8 @@ public function update($productId, $productData, $store = null, $identifierType } $product->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; @@ -373,8 +373,8 @@ public function delete($productId, $identifierType = null) try { $product->delete(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_deleted', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_deleted', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php index 04d4bc44d38..23f1f167463 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Api/V2.php @@ -135,8 +135,8 @@ public function create($type, $set, $sku, $productData, $store = null) } $product->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $product->getId(); @@ -180,8 +180,8 @@ public function update($productId, $productData, $store = null, $identifierType } $product->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php index 0be7c924b46..2a4dfddf208 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Api.php @@ -165,8 +165,8 @@ public function create($data) $model->save(); // clear translation cache because attribute labels are stored in translation Mage::app()->cleanCache([Mage_Core_Model_Translate::CACHE_TAG]); - } catch (Exception $e) { - $this->_fault('unable_to_save', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('unable_to_save', $exception->getMessage()); } return (int) $model->getId(); @@ -198,8 +198,8 @@ public function update($attribute, $data) $model->save(); // clear translation cache because attribute labels are stored in translation Mage::app()->cleanCache([Mage_Core_Model_Translate::CACHE_TAG]); - } catch (Exception $e) { - $this->_fault('unable_to_save', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('unable_to_save', $exception->getMessage()); } return true; @@ -226,8 +226,8 @@ public function remove($attribute) try { $model->delete(); return true; - } catch (Exception $e) { - $this->_fault('can_not_delete', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('can_not_delete', $exception->getMessage()); } } @@ -376,8 +376,8 @@ public function addOption($attribute, $data) $model->addData($modelData); try { $model->save(); - } catch (Exception $e) { - $this->_fault('unable_to_add_option', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('unable_to_add_option', $exception->getMessage()); } return true; @@ -414,8 +414,8 @@ public function removeOption($attribute, $optionId) $model->addData($modelData); try { $model->save(); - } catch (Exception $e) { - $this->_fault('unable_to_remove_option', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('unable_to_remove_option', $exception->getMessage()); } return true; 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 9c22ef96972..c73a00d564a 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 @@ -340,8 +340,8 @@ public function addImage( $storageHelper->saveFile($this->_getConfig()->getTmpMediaShortUrl($fileName)); $ioAdapter->chmod($this->_getConfig()->getTmpMediaPath($fileName), 0777); } - } catch (Exception $e) { - Mage::throwException(Mage::helper('catalog')->__('Failed to move file: %s', $e->getMessage())); + } catch (Exception $exception) { + Mage::throwException(Mage::helper('catalog')->__('Failed to move file: %s', $exception->getMessage())); } $fileName = str_replace(DS, '/', $fileName); diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php index ca230606917..3627df558f0 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Media/Api.php @@ -250,8 +250,8 @@ public function update($productId, $file, $data, $store = null, $identifierType try { $product->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_updated', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_updated', $mageCoreException->getMessage()); } return true; @@ -280,8 +280,8 @@ public function remove($productId, $file, $identifierType = null) try { $product->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_removed', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_removed', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php index bd21eb413c2..dce31c9bbfa 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Set/Api.php @@ -98,8 +98,8 @@ public function remove($attributeSetId, $forceProductsRemove = false) try { $attributeSet->delete(); - } catch (Exception $e) { - $this->_fault('remove_attribute_set_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('remove_attribute_set_error', $exception->getMessage()); } return true; @@ -151,8 +151,8 @@ public function attributeAdd($attributeId, $attributeSetId, $attributeGroupId = ->setAttributeGroupId($attributeGroupId) ->setSortOrder($sortOrder) ->save(); - } catch (Exception $e) { - $this->_fault('add_attribute_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('add_attribute_error', $exception->getMessage()); } return true; @@ -191,8 +191,8 @@ public function attributeRemove($attributeId, $attributeSetId) // delete record from eav_entity_attribute // using entity_attribute_id loaded by loadEntityAttributeIdBySet() $attribute->deleteEntity(); - } catch (Exception $e) { - $this->_fault('remove_attribute_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('remove_attribute_error', $exception->getMessage()); } return true; @@ -219,8 +219,8 @@ public function groupAdd($attributeSetId, $groupName) try { $group->save(); - } catch (Exception $e) { - $this->_fault('group_add_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('group_add_error', $exception->getMessage()); } return (int) $group->getId(); @@ -246,8 +246,8 @@ public function groupRename($groupId, $groupName) ); try { $model->save(); - } catch (Exception $e) { - $this->_fault('group_rename_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('group_rename_error', $exception->getMessage()); } return true; @@ -277,8 +277,8 @@ public function groupRemove($attributeGroupId) try { $group->delete(); - } catch (Exception $e) { - $this->_fault('group_remove_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('group_remove_error', $exception->getMessage()); } return true; diff --git a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php index 45baff7acca..04d023dc54f 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Attribute/Tierprice/Api.php @@ -89,8 +89,8 @@ public function update($productId, $tierPrices, $identifierType = null) } $product->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_updated', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_updated', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php index 39da9b52518..59a0a5385b9 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php +++ b/app/code/core/Mage/Catalog/Model/Product/Flat/Indexer.php @@ -196,9 +196,9 @@ public function updateProduct($productIds, $store = null) $resource->updateProduct($productIds, $store); $resource->updateRelationProducts($store, $productIds); $resource->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $resource->rollBack(); - throw $e; + throw $exception; } return $this; @@ -228,9 +228,9 @@ public function saveProduct($productIds, $store = null) $resource->saveProduct($productIds, $store); $resource->updateRelationProducts($store, $productIds); $resource->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $resource->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php b/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php index 5f4247bb1b7..11c8ba92f14 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php +++ b/app/code/core/Mage/Catalog/Model/Product/Link/Api/V2.php @@ -66,8 +66,8 @@ public function assign($type, $productId, $linkedProductId, $data = [], $identif $indexerPrice = Mage::getResourceModel('catalog/product_indexer_price'); $indexerPrice->reindexProductIds($productId); - } catch (Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('data_invalid', $exception->getMessage()); //$this->_fault('data_invalid', Mage::helper('catalog')->__('Link product does not exist.')); } diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Api.php b/app/code/core/Mage/Catalog/Model/Product/Option/Api.php index 39eb5ea9080..6efb0bb087a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Api.php @@ -158,8 +158,8 @@ protected function _saveProductCustomOption($product, $data) $product->save(); } - } catch (Exception $e) { - $this->_fault('save_option_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('save_option_error', $exception->getMessage()); } } 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 220baa539c7..cc2be257b2d 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 @@ -135,12 +135,12 @@ public function validateUserValue($values) // Process new uploaded file try { $this->_validateUploadedFile(); - } catch (Exception $e) { + } catch (Exception $exception) { if ($this->getSkipCheckRequiredOption()) { $this->setUserValue(null); return $this; } else { - Mage::throwException($e->getMessage()); + Mage::throwException($exception->getMessage()); } } diff --git a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php index 4ada43fe599..bdbe17be249 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php +++ b/app/code/core/Mage/Catalog/Model/Product/Option/Value/Api.php @@ -101,8 +101,8 @@ public function add($optionId, $data, $store = null) $optionValueModel->setValues($data); try { $optionValueModel->saveValues(); - } catch (Exception $e) { - $this->_fault('add_option_value_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('add_option_value_error', $exception->getMessage()); } return true; @@ -146,8 +146,8 @@ public function update($valueId, $data, $store = null) try { $productOptionValue->save()->saveValues(); - } catch (Exception $e) { - $this->_fault('update_option_value_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('update_option_value_error', $exception->getMessage()); } return true; @@ -174,8 +174,8 @@ public function remove($valueId) try { $optionValue->delete(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_deleted', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_deleted', $mageCoreException->getMessage()); } return true; 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 ceddb795de0..6ace0c40a3a 100644 --- a/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php @@ -307,8 +307,8 @@ protected function _prepareProduct(Varien_Object $buyRequest, $product, $process // try to add custom options try { $options = $this->_prepareOptions($buyRequest, $product, $processMode); - } catch (Mage_Core_Exception $e) { - return $e->getMessage(); + } catch (Mage_Core_Exception $mageCoreException) { + return $mageCoreException->getMessage(); } if (is_string($options)) { 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 fc193b15f72..1e8730867ba 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Category/Flat.php @@ -1549,13 +1549,13 @@ public function reindexAll() if ($allowTableChanges) { $this->_allowTableChanges = true; } - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); if ($allowTableChanges) { $this->_allowTableChanges = true; } - throw $e; + throw $exception; } return $this; 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 7d758017010..4e4d45cdf2c 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 @@ -977,9 +977,9 @@ public function reindexAll() } $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php index 35e6f6f8d9b..5eea0ecc12c 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Action.php @@ -70,9 +70,9 @@ public function updateAttributes($entityIds, $attrData, $storeId) $this->_updateUpdatedAt($entityIds); $this->_getWriteAdapter()->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getWriteAdapter()->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php index b3776f112c7..4d9c1704711 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Eav/Abstract.php @@ -32,9 +32,9 @@ public function reindexAll() $this->syncData(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; @@ -82,9 +82,9 @@ public function reindexEntities($processIds) $this->insertFromTable($this->getIdxTable(), $this->getMainTable()); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -229,9 +229,9 @@ protected function _removeAttributeIndexData($attributeId) $where = $adapter->quoteInto('attribute_id = ?', $attributeId); $adapter->delete($this->getMainTable(), $where); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -257,9 +257,9 @@ protected function _synchronizeAttributeIndexData($attributeId) $this->insertFromTable($this->getIdxTable(), $this->getMainTable()); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php index a6190c9bb9e..66a0eb36007 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price.php @@ -114,9 +114,9 @@ protected function _copyIndexDataToMainTable($processIds) $this->insertFromTable($this->getIdxTable(), $this->getMainTable()); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; @@ -365,9 +365,9 @@ public function reindexAll() $this->syncData(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; @@ -586,9 +586,9 @@ protected function _prepareWebsiteDateTable() } $write->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $write->rollBack(); - throw $e; + throw $exception; } return $this; 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 08b1a6a1434..a9fc0c3eab8 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 @@ -29,9 +29,9 @@ public function reindexAll() $this->_applyConfigurableOption(); $this->_movePriceDataToIndexTable(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; 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 d85b2c942b8..76ffa8972df 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 @@ -100,9 +100,9 @@ public function reindexAll() $this->_applyCustomOption(); $this->_movePriceDataToIndexTable(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php index cff43a5c98e..f9709f62ea4 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Indexer/Price/Grouped.php @@ -26,9 +26,9 @@ public function reindexAll() try { $this->_prepareGroupedProductPriceData(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php b/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php index 228a813287e..45d6305d018 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Product/Website.php @@ -56,9 +56,9 @@ public function removeProducts($websiteIds, $productIds) try { $adapter->delete($this->getMainTable(), $whereCond); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -107,9 +107,9 @@ public function addProducts($websiteIds, $productIds) } $this->_getWriteAdapter()->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getWriteAdapter()->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Catalog/Model/Resource/Url.php b/app/code/core/Mage/Catalog/Model/Resource/Url.php index fabf0ff5fab..5c78c75ed86 100644 --- a/app/code/core/Mage/Catalog/Model/Resource/Url.php +++ b/app/code/core/Mage/Catalog/Model/Resource/Url.php @@ -285,8 +285,8 @@ public function saveRewrite($rewriteData, $rewrite) $adapter = $this->_getWriteAdapter(); try { $adapter->insertOnDuplicate($this->getMainTable(), $rewriteData); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); Mage::throwException(Mage::helper('catalog')->__('An error occurred while saving the URL rewrite')); } diff --git a/app/code/core/Mage/Catalog/controllers/CategoryController.php b/app/code/core/Mage/Catalog/controllers/CategoryController.php index d6197f7eb71..e313704757a 100644 --- a/app/code/core/Mage/Catalog/controllers/CategoryController.php +++ b/app/code/core/Mage/Catalog/controllers/CategoryController.php @@ -48,8 +48,8 @@ protected function _initCategory() 'controller_action' => $this, ], ); - } catch (Mage_Core_Exception $e) { - Mage::logException($e); + } catch (Mage_Core_Exception $mageCoreException) { + Mage::logException($mageCoreException); return false; } diff --git a/app/code/core/Mage/Catalog/controllers/ProductController.php b/app/code/core/Mage/Catalog/controllers/ProductController.php index d79dcb6a92c..095b16d80db 100644 --- a/app/code/core/Mage/Catalog/controllers/ProductController.php +++ b/app/code/core/Mage/Catalog/controllers/ProductController.php @@ -116,17 +116,17 @@ public function viewAction() // Render page try { $viewHelper->prepareAndRender($productId, $this, $params); - } catch (Exception $e) { - if ($e->getCode() == $viewHelper->ERR_NO_PRODUCT_LOADED) { + } catch (Exception $exception) { + if ($exception->getCode() == $viewHelper->ERR_NO_PRODUCT_LOADED) { if (isset($_GET['store']) && !$this->getResponse()->isRedirect()) { $this->_redirect(''); } elseif (!$this->getResponse()->isRedirect()) { $this->_forward('noRoute'); } } elseif (Mage::getIsDeveloperMode()) { - Mage::printException($e); + Mage::printException($exception); } else { - Mage::logException($e); + Mage::logException($exception); $this->_forward('noRoute'); } } diff --git a/app/code/core/Mage/CatalogIndex/Model/Indexer.php b/app/code/core/Mage/CatalogIndex/Model/Indexer.php index a9aa305c23b..d6923042af7 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Indexer.php +++ b/app/code/core/Mage/CatalogIndex/Model/Indexer.php @@ -326,9 +326,9 @@ public function plainReindex($products = null, $attributes = null, $stores = nul $this->updateCatalogProductFlat($store, $products); } } - } catch (Exception $e) { + } catch (Exception $exception) { $flag->delete(); - throw $e; + throw $exception; } if ($flag->getState() == Mage_CatalogIndex_Model_Catalog_Index_Flag::STATE_RUNNING) { diff --git a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Abstract.php b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Abstract.php index 13781500562..9b4db83cf1b 100644 --- a/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Abstract.php +++ b/app/code/core/Mage/CatalogIndex/Model/Resource/Indexer/Abstract.php @@ -71,9 +71,9 @@ protected function _executeReplace($data, $storeId, $productId) } $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php index 307a242ea82..9157c2422af 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock.php @@ -93,9 +93,9 @@ public function reindexProducts($productIds) } $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -127,9 +127,9 @@ public function catalogProductDelete(Mage_Index_Model_Event $event) } $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -199,9 +199,9 @@ public function catalogProductMassAction(Mage_Index_Model_Event $event) } $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -225,9 +225,9 @@ public function reindexAll() $this->syncData(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php index 814fd368582..62c1c18d0e8 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Indexer/Stock/Default.php @@ -45,9 +45,9 @@ public function reindexAll() try { $this->_prepareIndexTable(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php index 09134b6e0eb..6748c905545 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Resource/Stock.php @@ -162,9 +162,9 @@ public function correctItemsQty($stock, $productQtys, $operator = '-') try { $adapter->update($this->getTable('cataloginventory/stock_item'), ['qty' => $value], $where); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock.php b/app/code/core/Mage/CatalogInventory/Model/Stock.php index 465857fe005..6270bd34070 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock.php @@ -144,9 +144,9 @@ public function registerProductsSale($items) $this->_getResource()->correctItemsQty($this, $qtys, '-'); $this->_getResource()->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getResource()->rollBack(); - throw $e; + throw $exception; } return $fullSaveItems; diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php index 400ed0f8e25..79e52fe953f 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api.php @@ -115,8 +115,8 @@ public function update($productId, $data) try { $product->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_updated', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_updated', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php index a64594ae219..29b6e313874 100644 --- a/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php +++ b/app/code/core/Mage/CatalogInventory/Model/Stock/Item/Api/V2.php @@ -42,8 +42,8 @@ public function update($productId, $data) try { $stockItem->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_updated', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_updated', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php b/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php index 35f4ba8e7ed..087c5c22cb5 100644 --- a/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php +++ b/app/code/core/Mage/CatalogRule/Model/Resource/Rule.php @@ -337,9 +337,9 @@ public function updateRuleProductData(Mage_CatalogRule_Model_Rule $rule) $this->insertRuleData($rule, $websiteIds); $write->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $write->rollBack(); - throw $e; + throw $exception; } return $this; @@ -634,9 +634,9 @@ protected function _saveRuleProductPrices($arrData) $adapter->insertOnDuplicate($this->getTable('catalogrule/affected_product'), array_unique($productIds)); $adapter->insertOnDuplicate($this->getTable('catalogrule/rule_product_price'), $arrData); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -767,9 +767,9 @@ public function applyToProduct($rule, $product, $websiteIds) } $write->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $write->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php index 4f2e164d43f..5239ef05a19 100644 --- a/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php +++ b/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php @@ -429,9 +429,9 @@ public function reindexAll() try { $this->_getIndexer()->rebuildIndex(); $resourceModel->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $resourceModel->rollBack(); - throw $e; + throw $exception; } } } diff --git a/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php b/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php index 91e7ea28bdc..f444327edea 100644 --- a/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php +++ b/app/code/core/Mage/CatalogSearch/controllers/AdvancedController.php @@ -27,8 +27,8 @@ public function resultAction() $this->loadLayout(); try { Mage::getSingleton('catalogsearch/advanced')->addFilters($this->getRequest()->getQuery()); - } catch (Mage_Core_Exception $e) { - Mage::getSingleton('catalogsearch/session')->addError($e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + Mage::getSingleton('catalogsearch/session')->addError($mageCoreException->getMessage()); $this->_redirectError( Mage::getModel('core/url') ->setQueryParams($this->getRequest()->getQuery()) diff --git a/app/code/core/Mage/Centinel/Model/Api.php b/app/code/core/Mage/Centinel/Model/Api.php index 8dbae6519cf..bd063110c6e 100644 --- a/app/code/core/Mage/Centinel/Model/Api.php +++ b/app/code/core/Mage/Centinel/Model/Api.php @@ -139,10 +139,10 @@ protected function _call($method, $data) } $client->sendHttp($this->_getApiEndpointUrl(), $this->_getTimeoutConnect(), $this->_getTimeoutRead()); - } catch (Exception $e) { - $debugData['response'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; + } catch (Exception $exception) { + $debugData['response'] = ['error' => $exception->getMessage(), 'code' => $exception->getCode()]; $this->_debug($debugData); - throw $e; + throw $exception; } $debugData['response'] = $client->response; diff --git a/app/code/core/Mage/Checkout/Model/Cart.php b/app/code/core/Mage/Checkout/Model/Cart.php index b8109ef718d..c588893823b 100644 --- a/app/code/core/Mage/Checkout/Model/Cart.php +++ b/app/code/core/Mage/Checkout/Model/Cart.php @@ -585,9 +585,9 @@ public function updateItem($itemId, $requestInfo = null, $updatingParams = null) } $result = $this->getQuote()->updateItem($itemId, $request, $updatingParams); - } catch (Mage_Core_Exception $e) { + } catch (Mage_Core_Exception $mageCoreException) { $this->getCheckoutSession()->setUseNotice(false); - $result = $e->getMessage(); + $result = $mageCoreException->getMessage(); } /** diff --git a/app/code/core/Mage/Checkout/Model/Cart/Api.php b/app/code/core/Mage/Checkout/Model/Cart/Api.php index b572cd90398..f7e596e25a1 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Api.php @@ -40,8 +40,8 @@ public function create($store = null) ->setIsActive(false) ->setIsMultiShipping(false) ->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('create_quote_fault', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('create_quote_fault', $mageCoreException->getMessage()); } return (int) $quote->getId(); @@ -171,8 +171,8 @@ public function createOrder($quoteId, $store = null, $agreements = null) 'checkout_submit_all_after', ['order' => $order, 'quote' => $quote], ); - } catch (Mage_Core_Exception $e) { - $this->_fault('create_order_fault', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('create_order_fault', $mageCoreException->getMessage()); } return $order->getIncrementId(); 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 b369f7803cb..061fac89682 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Coupon/Api.php @@ -72,8 +72,8 @@ protected function _applyCoupon($quoteId, $couponCode, $store = null) $quote->setCouponCode(strlen($couponCode) ? $couponCode : '') ->collectTotals() ->save(); - } catch (Exception $e) { - $this->_fault('cannot_apply_coupon_code', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('cannot_apply_coupon_code', $exception->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 ca374db40b8..23c7a1dfd94 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Customer/Api.php @@ -73,8 +73,8 @@ public function set($quoteId, $customerData, $store = null) ->setCheckoutMethod($customer->getMode()) ->setPasswordHash($customer->encryptPassword($customer->getPassword())) ->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('customer_not_set', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('customer_not_set', $mageCoreException->getMessage()); } return true; @@ -160,8 +160,8 @@ public function setAddresses($quoteId, $customerAddressData, $store = null) $quote ->collectTotals() ->save(); - } catch (Exception $e) { - $this->_fault('address_is_not_set', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('address_is_not_set', $exception->getMessage()); } return true; 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 e65dd5c1b0e..e477cca94eb 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Payment/Api.php @@ -179,8 +179,8 @@ public function setPaymentMethod($quoteId, $paymentData, $store = null) $quote->setTotalsCollectedFlag(false) ->collectTotals() ->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('payment_method_is_not_set', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('payment_method_is_not_set', $mageCoreException->getMessage()); } return true; 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 cd18fb99013..b85f8ac7cd7 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Product/Api.php @@ -71,8 +71,8 @@ public function add($quoteId, $productsData, $store = null) try { $quote->collectTotals()->save(); - } catch (Exception $e) { - $this->_fault('add_product_quote_save_fault', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('add_product_quote_save_fault', $exception->getMessage()); } return true; @@ -128,8 +128,8 @@ public function update($quoteId, $productsData, $store = null) try { $quote->collectTotals()->save(); - } catch (Exception $e) { - $this->_fault('update_product_quote_save_fault', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('update_product_quote_save_fault', $exception->getMessage()); } return true; @@ -187,8 +187,8 @@ public function remove($quoteId, $productsData, $store = null) try { $quote->collectTotals()->save(); - } catch (Exception $e) { - $this->_fault('remove_product_quote_save_fault', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('remove_product_quote_save_fault', $exception->getMessage()); } return true; @@ -307,8 +307,8 @@ public function moveToCustomerQuote($quoteId, $productsData, $store = null) $quote ->collectTotals() ->save(); - } catch (Exception $e) { - $this->_fault('product_move_quote_save_fault', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('product_move_quote_save_fault', $exception->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 a2b74811dfc..411cdee1153 100644 --- a/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php +++ b/app/code/core/Mage/Checkout/Model/Cart/Shipping/Api.php @@ -44,8 +44,8 @@ public function setShippingMethod($quoteId, $shippingMethod, $store = null) try { $quote->getShippingAddress()->setShippingMethod($shippingMethod); $quote->collectTotals()->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('shipping_method_is_not_set', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('shipping_method_is_not_set', $mageCoreException->getMessage()); } return true; @@ -85,8 +85,8 @@ public function getShippingMethodsList($quoteId, $store = null) unset($rateItem); } } - } catch (Mage_Core_Exception $e) { - $this->_fault('shipping_methods_list_could_not_be_retrieved', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('shipping_methods_list_could_not_be_retrieved', $mageCoreException->getMessage()); } return $ratesResult; diff --git a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php index 36e82af2ade..e7a32839c92 100644 --- a/app/code/core/Mage/Checkout/Model/Type/Multishipping.php +++ b/app/code/core/Mage/Checkout/Model/Type/Multishipping.php @@ -548,9 +548,9 @@ public function createOrders() Mage::dispatchEvent('checkout_submit_all_after', ['orders' => $orders, 'quote' => $this->getQuote()]); return $this; - } catch (Exception $e) { + } catch (Exception $exception) { Mage::dispatchEvent('checkout_multishipping_refund_all', ['orders' => $orders]); - throw $e; + throw $exception; } } diff --git a/app/code/core/Mage/Checkout/controllers/CartController.php b/app/code/core/Mage/Checkout/controllers/CartController.php index 9e6fb5743e9..d73eb86b1b3 100644 --- a/app/code/core/Mage/Checkout/controllers/CartController.php +++ b/app/code/core/Mage/Checkout/controllers/CartController.php @@ -335,9 +335,9 @@ public function configureAction() $params->setBuyRequest($quoteItem->getBuyRequest()); Mage::helper('catalog/product_view')->prepareAndRender($quoteItem->getProduct()->getId(), $this, $params); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getSession()->addError($this->__('Cannot configure product.')); - Mage::logException($e); + Mage::logException($exception); $this->_goBack(); return; } @@ -536,8 +536,8 @@ public function estimatePostAction() try { Mage::getModel('directory/country')->loadByCode($country); - } catch (Mage_Core_Exception $e) { - $this->_getSession()->addError($e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_getSession()->addError($mageCoreException->getMessage()); $this->_goBack(); return; } diff --git a/app/code/core/Mage/Checkout/controllers/MultishippingController.php b/app/code/core/Mage/Checkout/controllers/MultishippingController.php index d6c8e22067f..5a43c97db42 100644 --- a/app/code/core/Mage/Checkout/controllers/MultishippingController.php +++ b/app/code/core/Mage/Checkout/controllers/MultishippingController.php @@ -365,8 +365,8 @@ public function shippingPostAction() Mage_Checkout_Model_Type_Multishipping_State::STEP_SHIPPING, ); $this->_redirect('*/*/billing'); - } catch (Exception $e) { - $this->_getCheckoutSession()->addError($e->getMessage()); + } catch (Exception $exception) { + $this->_getCheckoutSession()->addError($exception->getMessage()); $this->_redirect('*/*/shipping'); } } diff --git a/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php b/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php index 7a0a9498517..b86642a8162 100644 --- a/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php +++ b/app/code/core/Mage/ConfigurableSwatches/Model/Resource/Catalog/Product/Type/Configurable/Product/Collection.php @@ -43,10 +43,10 @@ public function _loadEntities($printQuery = false, $logQuery = false) */ $query = $this->_prepareSelect($this->getSelect()); $rows = $this->_fetchAll($query); - } catch (Exception $e) { - Mage::printException($e, $query); + } catch (Exception $exception) { + Mage::printException($exception, $query); $this->printLogQuery(true, true, $query); - throw $e; + throw $exception; } foreach ($rows as $v) { diff --git a/app/code/core/Mage/Core/Block/Template.php b/app/code/core/Mage/Core/Block/Template.php index 34c2fe86111..145e74ca3c4 100644 --- a/app/code/core/Mage/Core/Block/Template.php +++ b/app/code/core/Mage/Core/Block/Template.php @@ -283,17 +283,17 @@ public function fetchView($fileName) $thisClass = static::class; Mage::log('Not valid template file:' . $fileName . ' class: ' . $thisClass, Zend_Log::CRIT, null, true); } - } catch (Throwable $e) { + } catch (Throwable $throwable) { if (!$do) { ob_get_clean(); $do = true; } if (Mage::getIsDeveloperMode()) { - throw $e; + throw $throwable; } - Mage::logException($e); + Mage::logException($throwable); } if ($hints) { diff --git a/app/code/core/Mage/Core/Controller/Varien/Action.php b/app/code/core/Mage/Core/Controller/Varien/Action.php index 4c0ed4887f6..4bfe7d38bfd 100644 --- a/app/code/core/Mage/Core/Controller/Varien/Action.php +++ b/app/code/core/Mage/Core/Controller/Varien/Action.php @@ -429,15 +429,15 @@ public function dispatch($action) Varien_Profiler::stop(self::PROFILER_KEY . '::postdispatch'); } } - } catch (Mage_Core_Controller_Varien_Exception $e) { + } catch (Mage_Core_Controller_Varien_Exception $mageCoreControllerVarienException) { // set prepared flags - foreach ($e->getResultFlags() as $flagData) { + foreach ($mageCoreControllerVarienException->getResultFlags() as $flagData) { [$action, $flag, $value] = $flagData; $this->setFlag($action, $flag, $value); } // call forward, redirect or an action - [$method, $parameters] = $e->getResultCallback(); + [$method, $parameters] = $mageCoreControllerVarienException->getResultCallback(); switch ($method) { case Mage_Core_Controller_Varien_Exception::RESULT_REDIRECT: [$path, $arguments] = $parameters; diff --git a/app/code/core/Mage/Core/Helper/Data.php b/app/code/core/Mage/Core/Helper/Data.php index e31bc869ee4..83d9a0d7ce4 100644 --- a/app/code/core/Mage/Core/Helper/Data.php +++ b/app/code/core/Mage/Core/Helper/Data.php @@ -121,8 +121,8 @@ public static function currencyByStore($value, $store = null, $format = true, $i } $value = $store->convertPrice($value, $format, $includeContainer); - } catch (Exception $e) { - $value = $e->getMessage(); + } catch (Exception $exception) { + $value = $exception->getMessage(); } return $value; @@ -878,8 +878,8 @@ public function mergeFiles( } return true; // no need in merger or merged into file successfully - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); } return false; diff --git a/app/code/core/Mage/Core/Helper/Translate.php b/app/code/core/Mage/Core/Helper/Translate.php index d0027c2cace..1ea574ae7a2 100644 --- a/app/code/core/Mage/Core/Helper/Translate.php +++ b/app/code/core/Mage/Core/Helper/Translate.php @@ -33,8 +33,8 @@ public function apply($translate, $area, $returnType = 'json') Mage::getModel('core/translate_inline')->processAjaxPost($translate); return $returnType == 'json' ? '{success:true}' : true; - } catch (Exception $e) { - return $returnType == 'json' ? "{error:true,message:'" . $e->getMessage() . "'}" : false; + } catch (Exception $exception) { + return $returnType == 'json' ? "{error:true,message:'" . $exception->getMessage() . "'}" : false; } } } diff --git a/app/code/core/Mage/Core/Helper/UnserializeArray.php b/app/code/core/Mage/Core/Helper/UnserializeArray.php index 952f28ca340..b821c06b423 100644 --- a/app/code/core/Mage/Core/Helper/UnserializeArray.php +++ b/app/code/core/Mage/Core/Helper/UnserializeArray.php @@ -30,8 +30,8 @@ public function unserialize($str) } return $result; - } catch (Error $e) { - throw new Exception('Error unserializing data: ' . $e->getMessage(), 0, $e); + } catch (Error $error) { + throw new Exception('Error unserializing data: ' . $error->getMessage(), 0, $error); } } } diff --git a/app/code/core/Mage/Core/Helper/Url/Rewrite.php b/app/code/core/Mage/Core/Helper/Url/Rewrite.php index c2fe0c4d413..3be572a404e 100644 --- a/app/code/core/Mage/Core/Helper/Url/Rewrite.php +++ b/app/code/core/Mage/Core/Helper/Url/Rewrite.php @@ -88,16 +88,16 @@ public function validateSuffix($suffix) { try { $this->_validateRequestPath($suffix); // Suffix itself must be a valid request path - } catch (Exception $e) { + } catch (Exception $exception) { // Make message saying about suffix, not request path - switch ($e->getCode()) { + switch ($exception->getCode()) { case self::VERR_MANYSLASHES: - throw new Mage_Core_Exception($this->__('Two and more slashes together are not permitted in url rewrite suffix'), $e->getCode(), $e); + throw new Mage_Core_Exception($this->__('Two and more slashes together are not permitted in url rewrite suffix'), $exception->getCode(), $exception); case self::VERR_ANCHOR: - throw new Mage_Core_Exception($this->__('Anchor symbol (#) is not supported in url rewrite suffix'), $e->getCode(), $e); + throw new Mage_Core_Exception($this->__('Anchor symbol (#) is not supported in url rewrite suffix'), $exception->getCode(), $exception); } - throw $e; + throw $exception; } return true; diff --git a/app/code/core/Mage/Core/Model/Abstract.php b/app/code/core/Mage/Core/Model/Abstract.php index d1c40e9b3b8..ab005c81a61 100644 --- a/app/code/core/Mage/Core/Model/Abstract.php +++ b/app/code/core/Mage/Core/Model/Abstract.php @@ -384,10 +384,10 @@ public function save() $this->_getResource()->addCommitCallback([$this, 'afterCommitCallback']) ->commit(); $this->_hasDataChanges = false; - } catch (Throwable $e) { + } catch (Throwable $throwable) { $this->_getResource()->rollBack(); $this->_hasDataChanges = true; - throw $e; + throw $throwable; } return $this; @@ -533,9 +533,9 @@ public function delete() $this->_afterDelete(); $this->_getResource()->commit(); - } catch (Throwable $e) { + } catch (Throwable $throwable) { $this->_getResource()->rollBack(); - throw $e; + throw $throwable; } $this->_afterDeleteCommit(); diff --git a/app/code/core/Mage/Core/Model/App.php b/app/code/core/Mage/Core/Model/App.php index 7a6ba001d29..4c5091607bb 100644 --- a/app/code/core/Mage/Core/Model/App.php +++ b/app/code/core/Mage/Core/Model/App.php @@ -364,8 +364,8 @@ public function run($params) try { Mage::dispatchEvent('core_app_run_after', ['app' => $this]); - } catch (Throwable $e) { - Mage::logException($e); + } catch (Throwable $throwable) { + Mage::logException($throwable); } return $this; diff --git a/app/code/core/Mage/Core/Model/Design/Package.php b/app/code/core/Mage/Core/Model/Design/Package.php index 3e82c9d417c..781638af8f0 100644 --- a/app/code/core/Mage/Core/Model/Design/Package.php +++ b/app/code/core/Mage/Core/Model/Design/Package.php @@ -644,8 +644,8 @@ protected function _checkUserAgentAgainstRegexps($regexpsConfigPath) try { $regexps = Mage::helper('core/unserializeArray')->unserialize($configValueSerialized); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); } if (empty($regexps)) { @@ -849,8 +849,8 @@ protected function _initMergerDir($dirRelativeName, $cleanup = false) } return is_writable($dir) ? $dir : false; - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); } return false; diff --git a/app/code/core/Mage/Core/Model/Email/Queue.php b/app/code/core/Mage/Core/Model/Email/Queue.php index 68a802af853..0643e7b315e 100644 --- a/app/code/core/Mage/Core/Model/Email/Queue.php +++ b/app/code/core/Mage/Core/Model/Email/Queue.php @@ -102,8 +102,8 @@ public function addMessageToQueue() try { $this->save(); $this->setId(null); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); } return $this; diff --git a/app/code/core/Mage/Core/Model/Email/Template.php b/app/code/core/Mage/Core/Model/Email/Template.php index bc9a347a50c..6183efbcf48 100644 --- a/app/code/core/Mage/Core/Model/Email/Template.php +++ b/app/code/core/Mage/Core/Model/Email/Template.php @@ -319,9 +319,9 @@ public function getProcessedTemplate(array $variables = []) $this->setInlineCssFile($processor->getInlineCssFile()); // Now that all HTML has been assembled, run email through CSS inlining process $processedResult = $this->getPreparedTemplateText($result); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_cancelDesignConfig(); - throw $e; + throw $exception; } $this->_cancelDesignConfig(); @@ -472,9 +472,9 @@ public function send($email, $name = null, array $variables = []) } $this->_mail = null; - } catch (Exception $e) { + } catch (Exception $exception) { $this->_mail = null; - Mage::logException($e); + Mage::logException($exception); return false; } @@ -549,9 +549,9 @@ public function getProcessedTemplateSubject(array $variables) $this->_applyDesignConfig(); try { $processedResult = $processor->filter($this->getTemplateSubject()); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_cancelDesignConfig(); - throw $e; + throw $exception; } $this->_cancelDesignConfig(); 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 738f3e696a5..5250bb1e234 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Abstract.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Abstract.php @@ -199,8 +199,8 @@ protected function _applyInlineCss($html) } else { $processedHtml = $html; } - } catch (Exception $e) { - $processedHtml = '{CSS inlining error: ' . $e->getMessage() . '}' . PHP_EOL . $html; + } catch (Exception $exception) { + $processedHtml = '{CSS inlining error: ' . $exception->getMessage() . '}' . PHP_EOL . $html; } return $processedHtml; diff --git a/app/code/core/Mage/Core/Model/Email/Template/Filter.php b/app/code/core/Mage/Core/Model/Email/Template/Filter.php index d1717705ee7..2d192530bd4 100644 --- a/app/code/core/Mage/Core/Model/Email/Template/Filter.php +++ b/app/code/core/Mage/Core/Model/Email/Template/Filter.php @@ -551,9 +551,9 @@ public function filter($value) { try { $value = parent::filter($value); - } catch (Exception $e) { + } catch (Exception $exception) { $value = ''; - Mage::logException($e); + Mage::logException($exception); } return $value; @@ -572,9 +572,9 @@ protected function _getVariable($value, $default = '{no_value_defined}') Mage::register('varProcessing', true); try { $result = parent::_getVariable($value, $default); - } catch (Exception $e) { + } catch (Exception $exception) { $result = ''; - Mage::logException($e); + Mage::logException($exception); } Mage::unregister('varProcessing'); diff --git a/app/code/core/Mage/Core/Model/Layout.php b/app/code/core/Mage/Core/Model/Layout.php index 3c81706a903..5bf0dc3b061 100644 --- a/app/code/core/Mage/Core/Model/Layout.php +++ b/app/code/core/Mage/Core/Model/Layout.php @@ -460,8 +460,8 @@ public function createBlock($type, $name = '', array $attributes = []) { try { $block = $this->_getBlockInstance($type, $attributes); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); return false; } diff --git a/app/code/core/Mage/Core/Model/Resource/Cache.php b/app/code/core/Mage/Core/Model/Resource/Cache.php index 56536060d8e..666e2241177 100644 --- a/app/code/core/Mage/Core/Model/Resource/Cache.php +++ b/app/code/core/Mage/Core/Model/Resource/Cache.php @@ -68,9 +68,9 @@ public function saveAllOptions($options) } $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Core/Model/Resource/Email/Queue.php b/app/code/core/Mage/Core/Model/Resource/Email/Queue.php index 6961b3a72f4..402ef2bde68 100644 --- a/app/code/core/Mage/Core/Model/Resource/Email/Queue.php +++ b/app/code/core/Mage/Core/Model/Resource/Email/Queue.php @@ -165,9 +165,9 @@ public function saveRecipients($messageId, array $recipients) } $writeAdapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $writeAdapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Core/Model/Resource/Transaction.php b/app/code/core/Mage/Core/Model/Resource/Transaction.php index d91113affd1..802b2200f37 100644 --- a/app/code/core/Mage/Core/Model/Resource/Transaction.php +++ b/app/code/core/Mage/Core/Model/Resource/Transaction.php @@ -135,15 +135,15 @@ public function save() foreach ($this->_objects as $object) { $object->save(); } - } catch (Exception $e) { - $error = $e; + } catch (Exception $exception) { + $error = $exception; } if ($error === false) { try { $this->_runCallbacks(); - } catch (Exception $e) { - $error = $e; + } catch (Exception $exception) { + $error = $exception; } } @@ -172,15 +172,15 @@ public function delete() foreach ($this->_objects as $object) { $object->delete(); } - } catch (Exception $e) { - $error = $e; + } catch (Exception $exception) { + $error = $exception; } if ($error === false) { try { $this->_runCallbacks(); - } catch (Exception $e) { - $error = $e; + } catch (Exception $exception) { + $error = $exception; } } diff --git a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php index 828b3de4407..c17a8904d8c 100644 --- a/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php +++ b/app/code/core/Mage/Core/Model/Session/Abstract/Varien.php @@ -173,13 +173,13 @@ public function start($sessionName = null) if (session_start() === false) { throw new Exception('Unable to start session.'); } - } catch (Throwable $e) { + } catch (Throwable $throwable) { session_abort(); if (Mage::registry(self::REGISTRY_CONCURRENCY_ERROR)) { require_once Mage::getBaseDir() . DS . 'errors' . DS . '503.php'; die(); } else { - Mage::printException($e); + Mage::printException($throwable); } } diff --git a/app/code/core/Mage/Cron/Model/Observer.php b/app/code/core/Mage/Cron/Model/Observer.php index 15902b05fef..6c8491dcdef 100644 --- a/app/code/core/Mage/Cron/Model/Observer.php +++ b/app/code/core/Mage/Cron/Model/Observer.php @@ -335,9 +335,9 @@ protected function _processJob($schedule, $jobConfig, $isAlways = false) $schedule ->setStatus(Mage_Cron_Model_Schedule::STATUS_SUCCESS) ->setFinishedAt(date(Varien_Db_Adapter_Pdo_Mysql::TIMESTAMP_FORMAT)); - } catch (Exception $e) { + } catch (Exception $exception) { $schedule->setStatus($errorStatus) - ->setMessages($e->__toString()); + ->setMessages($exception->__toString()); } if ($schedule->getIsError()) { diff --git a/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/System/CurrencysymbolController.php b/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/System/CurrencysymbolController.php index f96d3f5d795..4918958fb12 100644 --- a/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/System/CurrencysymbolController.php +++ b/app/code/core/Mage/CurrencySymbol/controllers/Adminhtml/System/CurrencysymbolController.php @@ -59,8 +59,8 @@ public function saveAction() Mage::getSingleton('adminhtml/session')->addSuccess( Mage::helper('currencysymbol')->__('Custom currency symbols were applied successfully.'), ); - } catch (Exception $e) { - Mage::getSingleton('adminhtml/session')->addError($e->getMessage()); + } catch (Exception $exception) { + Mage::getSingleton('adminhtml/session')->addError($exception->getMessage()); } $this->_redirectReferer(); diff --git a/app/code/core/Mage/Customer/Model/Address/Api.php b/app/code/core/Mage/Customer/Model/Address/Api.php index 840dc250c15..27149fd2566 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api.php +++ b/app/code/core/Mage/Customer/Model/Address/Api.php @@ -106,8 +106,8 @@ public function create($customerId, $addressData) try { $address->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $address->getId(); @@ -183,8 +183,8 @@ public function update($addressId, $addressData) try { $address->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; @@ -207,8 +207,8 @@ public function delete($addressId) try { $address->delete(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_deleted', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_deleted', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Customer/Model/Address/Api/V2.php b/app/code/core/Mage/Customer/Model/Address/Api/V2.php index 9656e24ee5a..3c3fc2b98aa 100644 --- a/app/code/core/Mage/Customer/Model/Address/Api/V2.php +++ b/app/code/core/Mage/Customer/Model/Address/Api/V2.php @@ -57,8 +57,8 @@ public function create($customerId, $addressData) try { $address->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $address->getId(); @@ -134,8 +134,8 @@ public function update($addressId, $addressData) try { $address->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; @@ -158,8 +158,8 @@ public function delete($addressId) try { $address->delete(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_deleted', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_deleted', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Customer/Model/Customer/Api.php b/app/code/core/Mage/Customer/Model/Customer/Api.php index 6f57c6347b1..3a48a9e2d61 100644 --- a/app/code/core/Mage/Customer/Model/Customer/Api.php +++ b/app/code/core/Mage/Customer/Model/Customer/Api.php @@ -51,8 +51,8 @@ public function create($customerData) $customer ->setData($customerData) ->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $customer->getId(); @@ -106,8 +106,8 @@ public function items($filters) foreach ($filters as $field => $value) { $collection->addFieldToFilter($field, $value); } - } catch (Mage_Core_Exception $e) { - $this->_fault('filters_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('filters_invalid', $mageCoreException->getMessage()); } $result = []; @@ -174,8 +174,8 @@ public function delete($customerId) try { $customer->delete(); - } catch (Mage_Core_Exception $e) { - $this->_fault('not_deleted', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('not_deleted', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Customer/controllers/AccountController.php b/app/code/core/Mage/Customer/controllers/AccountController.php index 88f348e7ebd..ffa299e87a8 100644 --- a/app/code/core/Mage/Customer/controllers/AccountController.php +++ b/app/code/core/Mage/Customer/controllers/AccountController.php @@ -645,9 +645,9 @@ public function confirmAction() // die happy $this->_redirectSuccess($this->_getUrl('*/*/index', ['_secure' => true])); return; - } catch (Exception $e) { + } catch (Exception $exception) { // die unhappy - $this->_getSession()->addError($e->getMessage()); + $this->_getSession()->addError($exception->getMessage()); $this->_redirectError($this->_getUrl('*/*/index', ['_secure' => true])); return; } diff --git a/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php b/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php index 6518379a880..c1aee08a0ef 100644 --- a/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php +++ b/app/code/core/Mage/Dataflow/Model/Mysql4/Catalogold.php @@ -77,8 +77,8 @@ public function addProductToStore($productId, $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; + } catch (Exception $exception) { + throw $exception; } return $this; diff --git a/app/code/core/Mage/Dataflow/Model/Profile.php b/app/code/core/Mage/Dataflow/Model/Profile.php index b2db4778251..3395a030fc0 100644 --- a/app/code/core/Mage/Dataflow/Model/Profile.php +++ b/app/code/core/Mage/Dataflow/Model/Profile.php @@ -294,8 +294,8 @@ public function run() $profile->setDataflowProfile($this->getData()); $profile->run(); - } catch (Exception $e) { - echo $e; + } catch (Exception $exception) { + echo $exception; } $this->setExceptions($profile->getExceptions()); diff --git a/app/code/core/Mage/Directory/Model/Region/Api.php b/app/code/core/Mage/Directory/Model/Region/Api.php index 901c38577ba..ed7d4924732 100644 --- a/app/code/core/Mage/Directory/Model/Region/Api.php +++ b/app/code/core/Mage/Directory/Model/Region/Api.php @@ -24,8 +24,8 @@ public function items($country) { try { $country = Mage::getModel('directory/country')->loadByCode($country); - } catch (Mage_Core_Exception $e) { - $this->_fault('country_not_exists', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('country_not_exists', $mageCoreException->getMessage()); } if (!$country->getId()) { diff --git a/app/code/core/Mage/Downloadable/Model/Link/Api.php b/app/code/core/Mage/Downloadable/Model/Link/Api.php index 79679363b46..744df6c39bb 100644 --- a/app/code/core/Mage/Downloadable/Model/Link/Api.php +++ b/app/code/core/Mage/Downloadable/Model/Link/Api.php @@ -54,11 +54,11 @@ protected function _uploadFile($fileInfo, $type) $fullPath = rtrim($tmpPath, DS) . DS . ltrim($result['file'], DS); Mage::helper('core/file_storage_database')->saveFile($fullPath); } - } catch (Exception $e) { - if ($e->getMessage() != '') { - $this->_fault('upload_failed', $e->getMessage()); + } catch (Exception $exception) { + if ($exception->getMessage() != '') { + $this->_fault('upload_failed', $exception->getMessage()); } else { - $this->_fault($e->getCode()); + $this->_fault($exception->getCode()); } } @@ -82,8 +82,8 @@ public function add($productId, $resource, $resourceType, $store = null, $identi try { $this->_getValidator()->validateType($resourceType); $this->_getValidator()->validateAttributes($resource, $resourceType); - } catch (Exception $e) { - $this->_fault('validation_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('validation_error', $exception->getMessage()); } $resource['is_delete'] = 0; @@ -118,8 +118,8 @@ public function add($productId, $resource, $resourceType, $store = null, $identi $downloadable = [$resourceType => [$resource]]; $product->setDownloadableData($downloadable); $product->save(); - } catch (Exception $e) { - $this->_fault('save_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('save_error', $exception->getMessage()); } return true; @@ -223,8 +223,8 @@ public function remove($linkId, $resourceType) { try { $this->_getValidator()->validateType($resourceType); - } catch (Exception $e) { - $this->_fault('validation_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('validation_error', $exception->getMessage()); } switch ($resourceType) { @@ -247,8 +247,8 @@ public function remove($linkId, $resourceType) try { $downloadableModel->delete(); - } catch (Exception $e) { - $this->_fault('remove_error', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('remove_error', $exception->getMessage()); } return true; 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 7158a94e8d4..7e345ac17d6 100644 --- a/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php +++ b/app/code/core/Mage/Downloadable/Model/Resource/Indexer/Price.php @@ -29,9 +29,9 @@ public function reindexAll() $this->_applyDownloadableLink(); $this->_movePriceDataToIndexTable(); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; 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 f43e2da2cd8..ee95dc08cb0 100644 --- a/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php +++ b/app/code/core/Mage/Downloadable/controllers/Adminhtml/Downloadable/FileController.php @@ -60,8 +60,8 @@ public function uploadAction() 'path' => $this->_getSession()->getCookiePath(), 'domain' => $this->_getSession()->getCookieDomain(), ]; - } catch (Exception $e) { - $result = ['error' => $e->getMessage(), 'errorcode' => $e->getCode()]; + } catch (Exception $exception) { + $result = ['error' => $exception->getMessage(), 'errorcode' => $exception->getCode()]; } $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); diff --git a/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php b/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php index a86d59597e2..856677e5585 100644 --- a/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php +++ b/app/code/core/Mage/Eav/Model/Convert/Adapter/Grid.php @@ -49,8 +49,8 @@ public function load() try { $collection = Mage::getResourceModel($this->getEntity() . '_collection'); $collection->load(); - } catch (Exception $e) { - $this->addException(Mage::helper('eav')->__('An error occurred while loading the collection, aborting. Error: %s', $e->getMessage()), Varien_Convert_Exception::FATAL); + } catch (Exception $exception) { + $this->addException(Mage::helper('eav')->__('An error occurred while loading the collection, aborting. Error: %s', $exception->getMessage()), Varien_Convert_Exception::FATAL); } $data = []; diff --git a/app/code/core/Mage/Eav/Model/Entity/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Abstract.php index c7e502536dd..1332c8798ea 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Abstract.php @@ -1456,10 +1456,10 @@ protected function _processAttributeValues() // reset data arrays $this->_attributeValuesToSave = []; $this->_attributeValuesToDelete = []; - } catch (Exception $e) { + } catch (Exception $exception) { $this->_attributeValuesToSave = []; $this->_attributeValuesToDelete = []; - throw $e; + throw $exception; } return $this; @@ -1568,9 +1568,9 @@ public function saveAttribute(Varien_Object $object, $attributeCode) $this->_processAttributeValues(); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php index 703049a71a9..2a5fcc32ef7 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php +++ b/app/code/core/Mage/Eav/Model/Entity/Collection/Abstract.php @@ -1071,10 +1071,10 @@ public function _loadEntities($printQuery = false, $logQuery = false) */ $query = $this->_prepareSelect($this->getSelect()); $rows = $this->_fetchAll($query); - } catch (Exception $e) { - Mage::printException($e, $query); + } catch (Exception $exception) { + Mage::printException($exception, $query); $this->printLogQuery(true, true, $query); - throw $e; + throw $exception; } foreach ($rows as $v) { diff --git a/app/code/core/Mage/Eav/Model/Entity/Type.php b/app/code/core/Mage/Eav/Model/Entity/Type.php index a9f52226d52..0190acc3e22 100644 --- a/app/code/core/Mage/Eav/Model/Entity/Type.php +++ b/app/code/core/Mage/Eav/Model/Entity/Type.php @@ -212,9 +212,9 @@ public function fetchNewIncrementId($storeId = null) // Commit increment_last_id changes $this->_getResource()->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getResource()->rollBack(); - throw $e; + throw $exception; } return $incrementId; diff --git a/app/code/core/Mage/GiftMessage/Model/Api.php b/app/code/core/Mage/GiftMessage/Model/Api.php index 0fd4fea0ba6..ba971aee744 100644 --- a/app/code/core/Mage/GiftMessage/Model/Api.php +++ b/app/code/core/Mage/GiftMessage/Model/Api.php @@ -50,8 +50,8 @@ protected function _setGiftMessage($entityId, $request, $quote) ['request' => $request, 'quote' => $quote], ); return ['entityId' => $entityId, 'result' => true, 'error' => '']; - } catch (Exception $e) { - return ['entityId' => $entityId, 'result' => false, 'error' => $e->getMessage()]; + } catch (Exception $exception) { + return ['entityId' => $entityId, 'result' => false, 'error' => $exception->getMessage()]; } } diff --git a/app/code/core/Mage/GiftMessage/Model/Api/V2.php b/app/code/core/Mage/GiftMessage/Model/Api/V2.php index 7830ba84f6f..53737d1f400 100644 --- a/app/code/core/Mage/GiftMessage/Model/Api/V2.php +++ b/app/code/core/Mage/GiftMessage/Model/Api/V2.php @@ -82,9 +82,9 @@ protected function _setGiftMessage($entityId, $request, $quote) Mage::dispatchEvent('checkout_controller_onepage_save_shipping_method', ['request' => $request, 'quote' => $quote]); $response->result = true; $response->error = ''; - } catch (Exception $e) { + } catch (Exception $exception) { $response->result = false; - $response->error = $e->getMessage(); + $response->error = $exception->getMessage(); } return $response; diff --git a/app/code/core/Mage/ImportExport/Model/Import.php b/app/code/core/Mage/ImportExport/Model/Import.php index 76078788a5e..b8f2b5e2d77 100644 --- a/app/code/core/Mage/ImportExport/Model/Import.php +++ b/app/code/core/Mage/ImportExport/Model/Import.php @@ -425,9 +425,9 @@ public function uploadSource() // trying to create source adapter for file and catch possible exception to be convinced in its adequacy try { $this->_getSourceAdapter($sourceFile); - } catch (Exception $e) { + } catch (Exception $exception) { unlink($sourceFile); - Mage::throwException($e->getMessage()); + Mage::throwException($exception->getMessage()); } return $sourceFile; diff --git a/app/code/core/Mage/Index/Model/Indexer.php b/app/code/core/Mage/Index/Model/Indexer.php index f15d81f7f38..e491f31fa47 100644 --- a/app/code/core/Mage/Index/Model/Indexer.php +++ b/app/code/core/Mage/Index/Model/Indexer.php @@ -211,9 +211,9 @@ public function indexEvents($entity = null, $type = null) try { $this->_runAll('indexEvents', [$entity, $type]); $resourceModel->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $resourceModel->rollBack(); - throw $e; + throw $exception; } if ($allowTableChanges) { diff --git a/app/code/core/Mage/Index/Model/Lock.php b/app/code/core/Mage/Index/Model/Lock.php index 2e59e24a307..2c12044a971 100644 --- a/app/code/core/Mage/Index/Model/Lock.php +++ b/app/code/core/Mage/Index/Model/Lock.php @@ -239,9 +239,9 @@ protected function _isLockExistsFile($lockName) flock($fp, LOCK_UN); $result = false; } - } catch (Exception $e) { - Mage::logException($e); - throw $e; + } catch (Exception $exception) { + Mage::logException($exception); + throw $exception; } return $result; diff --git a/app/code/core/Mage/Index/Model/Process.php b/app/code/core/Mage/Index/Model/Process.php index 12f82160d85..243740c4567 100644 --- a/app/code/core/Mage/Index/Model/Process.php +++ b/app/code/core/Mage/Index/Model/Process.php @@ -213,10 +213,10 @@ public function reindexAll() } else { $this->_getResource()->endProcess($this); } - } catch (Exception $e) { + } catch (Exception $exception) { $this->unlock(); $this->_getResource()->failProcess($this); - throw $e; + throw $exception; } Mage::dispatchEvent('after_reindex_process_' . $this->getIndexerCode()); @@ -363,9 +363,9 @@ public function indexEvents($entity = null, $type = null) $this->_processEventsCollection($eventsCollection); $this->unlock(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->unlock(); - throw $e; + throw $exception; } return $this; @@ -629,9 +629,9 @@ public function safeProcessEvent(Mage_Index_Model_Event $event) try { $this->processEvent($event); $this->unlock(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->unlock(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Index/Model/Resource/Abstract.php b/app/code/core/Mage/Index/Model/Resource/Abstract.php index d10344b2805..01c13ae4080 100644 --- a/app/code/core/Mage/Index/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Index/Model/Resource/Abstract.php @@ -96,9 +96,9 @@ public function syncData() $this->_getWriteAdapter()->delete($this->getMainTable()); $this->insertFromTable($this->getIdxTable(), $this->getMainTable(), false); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Install/Model/Installer.php b/app/code/core/Mage/Install/Model/Installer.php index 505f4590643..520e8072eeb 100644 --- a/app/code/core/Mage/Install/Model/Installer.php +++ b/app/code/core/Mage/Install/Model/Installer.php @@ -250,9 +250,9 @@ public function validateEncryptionKey($key) if ($key) { Mage::helper('core')->validateKey($key); } - } catch (Exception $e) { - $errors[] = $e->getMessage(); - $this->getDataModel()->addError($e->getMessage()); + } catch (Exception $exception) { + $errors[] = $exception->getMessage(); + $this->getDataModel()->addError($exception->getMessage()); } if (!empty($errors)) { diff --git a/app/code/core/Mage/Install/Model/Installer/Config.php b/app/code/core/Mage/Install/Model/Installer/Config.php index a5ea02a1141..b818d33897e 100644 --- a/app/code/core/Mage/Install/Model/Installer/Config.php +++ b/app/code/core/Mage/Install/Model/Installer/Config.php @@ -150,10 +150,10 @@ protected function _checkUrl($url, $secure = false) $client = new Varien_Http_Client($url . 'index.php/' . $prefix); $response = $client->request('GET'); $body = $response->getBody(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getInstaller()->getDataModel() ->addError(Mage::helper('install')->__('The URL "%s" is not accessible.', $url)); - throw $e; + throw $exception; } if ($body != Mage_Install_Model_Installer::INSTALLER_HOST_RESPONSE) { diff --git a/app/code/core/Mage/Install/Model/Installer/Console.php b/app/code/core/Mage/Install/Model/Installer/Console.php index 4a089b38fe8..38e75dcace8 100644 --- a/app/code/core/Mage/Install/Model/Installer/Console.php +++ b/app/code/core/Mage/Install/Model/Installer/Console.php @@ -419,8 +419,8 @@ public function install() */ @chmod('var/cache', 0777); @chmod('var/session', 0777); - } catch (Exception $e) { - $this->addError('ERROR: ' . $e->getMessage()); + } catch (Exception $exception) { + $this->addError('ERROR: ' . $exception->getMessage()); return false; } diff --git a/app/code/core/Mage/Install/controllers/WizardController.php b/app/code/core/Mage/Install/controllers/WizardController.php index 80598ba110d..b09adc6b1cc 100644 --- a/app/code/core/Mage/Install/controllers/WizardController.php +++ b/app/code/core/Mage/Install/controllers/WizardController.php @@ -251,8 +251,8 @@ public function installDbAction() Mage::app()->getStore()->resetConfig(); $this->getResponse()->setRedirect(Mage::getUrl($step->getNextUrlPath())); - } catch (Exception $e) { - Mage::getSingleton('install/session')->addError($e->getMessage()); + } catch (Exception $exception) { + Mage::getSingleton('install/session')->addError($exception->getMessage()); $this->getResponse()->setRedirect($step->getUrl()); } } @@ -309,10 +309,10 @@ public function administratorPostAction() try { $this->_getInstaller()->createAdministrator($user); $this->_getInstaller()->installEnryptionKey($encryptionKey); - } catch (Exception $e) { + } catch (Exception $exception) { Mage::getSingleton('install/session') ->setAdminData($adminData) - ->addError($e->getMessage()); + ->addError($exception->getMessage()); $this->getResponse()->setRedirect($step->getUrl()); return false; } diff --git a/app/code/core/Mage/Log/Model/Cron.php b/app/code/core/Mage/Log/Model/Cron.php index 1e481495cab..91306ce36b2 100644 --- a/app/code/core/Mage/Log/Model/Cron.php +++ b/app/code/core/Mage/Log/Model/Cron.php @@ -79,9 +79,9 @@ public function logClean() try { Mage::getModel('log/log')->clean(); - } catch (Exception $e) { - $this->_errors[] = $e->getMessage(); - $this->_errors[] = $e->getTrace(); + } catch (Exception $exception) { + $this->_errors[] = $exception->getMessage(); + $this->_errors[] = $exception->getTrace(); } $this->_sendLogCleanEmail(); diff --git a/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php b/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php index 226421cabb2..5c22531b27d 100644 --- a/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php +++ b/app/code/core/Mage/Log/Model/Resource/Visitor/Online.php @@ -113,9 +113,9 @@ public function prepare(Mage_Log_Model_Visitor_Online $object) } $writeAdapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $writeAdapter->rollBack(); - throw $e; + throw $exception; } $object->setPrepareAt(); diff --git a/app/code/core/Mage/Log/Model/Visitor.php b/app/code/core/Mage/Log/Model/Visitor.php index 3a150a05f05..e4f460a2c70 100644 --- a/app/code/core/Mage/Log/Model/Visitor.php +++ b/app/code/core/Mage/Log/Model/Visitor.php @@ -260,8 +260,8 @@ public function saveByRequest($observer) $this->setLastVisitAt(Varien_Date::now()); $this->save(); $this->_session->setVisitorData($this->getData()); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); } return $this; diff --git a/app/code/core/Mage/Newsletter/Model/Template.php b/app/code/core/Mage/Newsletter/Model/Template.php index 8fe1da00747..7fef69dd934 100644 --- a/app/code/core/Mage/Newsletter/Model/Template.php +++ b/app/code/core/Mage/Newsletter/Model/Template.php @@ -340,7 +340,7 @@ public function send($subscriber, array $variables = [], $name = null, ?Mage_New if (!is_null($queue)) { $subscriber->received($queue); } - } catch (Exception $e) { + } catch (Exception $exception) { if ($subscriber instanceof Mage_Newsletter_Model_Subscriber) { // If letter sent for subscriber, we create a problem report entry $problem = Mage::getModel('newsletter/problem'); @@ -349,7 +349,7 @@ public function send($subscriber, array $variables = [], $name = null, ?Mage_New $problem->addQueueData($queue); } - $problem->addErrorData($e); + $problem->addErrorData($exception); $problem->save(); if (!is_null($queue)) { @@ -357,7 +357,7 @@ public function send($subscriber, array $variables = [], $name = null, ?Mage_New } } else { // Otherwise throw error to upper level - throw $e; + throw $exception; } return false; diff --git a/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.1-1.6.0.2.php b/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.1-1.6.0.2.php index 12e1245b0e9..305adb6d684 100644 --- a/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.1-1.6.0.2.php +++ b/app/code/core/Mage/Newsletter/data/newsletter_setup/data-upgrade-1.6.0.1-1.6.0.2.php @@ -265,6 +265,6 @@ try { $model->save(); -} catch (Exception $e) { - Mage::logException($e); +} catch (Exception $exception) { + Mage::logException($exception); } diff --git a/app/code/core/Mage/Oauth/Model/Server.php b/app/code/core/Mage/Oauth/Model/Server.php index 9697d2c9f80..d7ef60db124 100644 --- a/app/code/core/Mage/Oauth/Model/Server.php +++ b/app/code/core/Mage/Oauth/Model/Server.php @@ -625,8 +625,8 @@ public function accessToken() $this->_processRequest(self::REQUEST_TOKEN); $response = $this->_token->toString(); - } catch (Exception $e) { - $response = $this->reportProblem($e); + } catch (Exception $exception) { + $response = $this->reportProblem($exception); } $this->_getResponse()->setBody($response); @@ -698,8 +698,8 @@ public function initiateToken() $this->_processRequest(self::REQUEST_INITIATE); $response = $this->_token->toString() . '&oauth_callback_confirmed=true'; - } catch (Exception $e) { - $response = $this->reportProblem($e); + } catch (Exception $exception) { + $response = $this->reportProblem($exception); } $this->_getResponse()->setBody($response); diff --git a/app/code/core/Mage/Paygate/Model/Authorizenet.php b/app/code/core/Mage/Paygate/Model/Authorizenet.php index 595cd45863c..911a680a010 100644 --- a/app/code/core/Mage/Paygate/Model/Authorizenet.php +++ b/app/code/core/Mage/Paygate/Model/Authorizenet.php @@ -1219,8 +1219,8 @@ protected function _processPartialAuthorizationResponse($response, $orderPayment Mage::helper('paygate')->__('Payment partial authorization error.'), ); } - } catch (Exception $e) { - $exceptionMessage = $e->getMessage(); + } catch (Exception $exception) { + $exceptionMessage = $exception->getMessage(); } throw new Mage_Payment_Model_Info_Exception($exceptionMessage); @@ -1388,14 +1388,14 @@ protected function _postRequest(Varien_Object $request) try { $response = $client->request(); - } catch (Exception $e) { + } catch (Exception $exception) { $result->setResponseCode(-1) - ->setResponseReasonCode($e->getCode()) - ->setResponseReasonText($e->getMessage()); + ->setResponseReasonCode($exception->getCode()) + ->setResponseReasonText($exception->getMessage()); $debugData['result'] = $result->getData(); $this->_debug($debugData); - Mage::throwException($this->_wrapGatewayError($e->getMessage())); + Mage::throwException($this->_wrapGatewayError($exception->getMessage())); } $responseBody = $response->getBody(); @@ -1670,8 +1670,8 @@ protected function _getTransactionDetails($transactionId) libxml_use_internal_errors(true); $responseXmlDocument = new Varien_Simplexml_Element($responseBody); libxml_use_internal_errors(false); - } catch (Exception $e) { - $debugData['exception'] = $e->getMessage(); + } catch (Exception $exception) { + $debugData['exception'] = $exception->getMessage(); $this->_debug($debugData); Mage::throwException(Mage::helper('paygate')->__('Payment updating error.')); } diff --git a/app/code/core/Mage/Payment/Block/Info/Checkmo.php b/app/code/core/Mage/Payment/Block/Info/Checkmo.php index c11998a614e..ed70ff67429 100644 --- a/app/code/core/Mage/Payment/Block/Info/Checkmo.php +++ b/app/code/core/Mage/Payment/Block/Info/Checkmo.php @@ -55,8 +55,8 @@ protected function _convertAdditionalData() try { $details = Mage::helper('core/unserializeArray') ->unserialize($this->getInfo()->getAdditionalData()); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); } if (is_array($details)) { diff --git a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php index 94abdd6df11..872f9e96602 100644 --- a/app/code/core/Mage/Paypal/Controller/Express/Abstract.php +++ b/app/code/core/Mage/Paypal/Controller/Express/Abstract.php @@ -137,8 +137,8 @@ public function shippingOptionsCallbackAction() $this->_initCheckout(); $response = $this->_checkout->getShippingOptionsCallbackResponse($this->getRequest()->getParams()); $this->getResponse()->setBody($response); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); } } @@ -247,8 +247,8 @@ public function editAction() { try { $this->getResponse()->setRedirect($this->_config->getExpressCheckoutEditUrl($this->_initToken())); - } catch (Mage_Core_Exception $e) { - $this->_getSession()->addError($e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_getSession()->addError($mageCoreException->getMessage()); $this->_redirect('*/*/review'); } } diff --git a/app/code/core/Mage/Paypal/Model/Api/Nvp.php b/app/code/core/Mage/Paypal/Model/Api/Nvp.php index bb331842f16..a74332b24cd 100644 --- a/app/code/core/Mage/Paypal/Model/Api/Nvp.php +++ b/app/code/core/Mage/Paypal/Model/Api/Nvp.php @@ -840,12 +840,12 @@ public function callUpdateBillingAgreement() $request = $this->_exportToRequest($this->_updateBillingAgreementRequest); try { $response = $this->call('BillAgreementUpdate', $request); - } catch (Mage_Core_Exception $e) { + } catch (Mage_Core_Exception $mageCoreException) { if (in_array(10201, $this->_callErrors)) { $this->setIsBillingAgreementAlreadyCancelled(true); } - throw $e; + throw $mageCoreException; } $this->_importFromResponse($this->_updateBillingAgreementResponse, $response); @@ -874,7 +874,7 @@ public function callManageRecurringPaymentsProfileStatus() try { $response = $this->call('ManageRecurringPaymentsProfileStatus', $request); - } catch (Mage_Core_Exception $e) { + } catch (Mage_Core_Exception $mageCoreException) { if ((in_array(11556, $this->_callErrors) && $request['ACTION'] === 'Cancel') || (in_array(11557, $this->_callErrors) && $request['ACTION'] === 'Suspend') || (in_array(11558, $this->_callErrors) && $request['ACTION'] === 'Reactivate') @@ -882,7 +882,7 @@ public function callManageRecurringPaymentsProfileStatus() Mage::throwException(Mage::helper('paypal')->__('Unable to change status. Current status is not correspond to real status.')); } - throw $e; + throw $mageCoreException; } } @@ -984,10 +984,10 @@ public function call($methodName, array $request) $this->_buildQuery($request), ); $response = $http->read(); - } catch (Exception $e) { - $debugData['http_error'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; + } catch (Exception $exception) { + $debugData['http_error'] = ['error' => $exception->getMessage(), 'code' => $exception->getCode()]; $this->_debug($debugData); - throw $e; + throw $exception; } $response = preg_split('/^\r?$/m', $response, 2); diff --git a/app/code/core/Mage/Paypal/Model/Express/Checkout.php b/app/code/core/Mage/Paypal/Model/Express/Checkout.php index 33d455e5dd2..9368b34d56d 100644 --- a/app/code/core/Mage/Paypal/Model/Express/Checkout.php +++ b/app/code/core/Mage/Paypal/Model/Express/Checkout.php @@ -547,9 +547,9 @@ public function getShippingOptionsCallbackResponse(array $request) $debugData['response'] = $response; $logger->log($debugData); return $response; - } catch (Exception $e) { + } catch (Exception $exception) { $logger->log($debugData); - throw $e; + throw $exception; } } diff --git a/app/code/core/Mage/Paypal/Model/Ipn.php b/app/code/core/Mage/Paypal/Model/Ipn.php index a53e009f67c..06346593bba 100644 --- a/app/code/core/Mage/Paypal/Model/Ipn.php +++ b/app/code/core/Mage/Paypal/Model/Ipn.php @@ -103,10 +103,10 @@ public function processIpnRequest(array $request, ?Zend_Http_Client_Adapter_Inte $this->_processOrder(); } - } catch (Exception $e) { - $this->_debugData['exception'] = $e->getMessage(); + } catch (Exception $exception) { + $this->_debugData['exception'] = $exception->getMessage(); $this->_debug(); - throw $e; + throw $exception; } $this->_debug(); @@ -134,9 +134,9 @@ protected function _postBack(Zend_Http_Client_Adapter_Interface $httpAdapter) try { $postbackResult = $httpAdapter->read(); - } catch (Exception $e) { - $this->_debugData['http_error'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; - throw $e; + } catch (Exception $exception) { + $this->_debugData['http_error'] = ['error' => $exception->getMessage(), 'code' => $exception->getCode()]; + throw $exception; } /* @@ -279,10 +279,10 @@ protected function _processOrder() Mage_Paypal_Model_Info::TXN_TYPE_ADJUSTMENT => $this->_registerAdjustment(), default => $this->_registerTransaction(), }; - } catch (Mage_Core_Exception $e) { - $comment = $this->_createIpnComment(Mage::helper('paypal')->__('Note: %s', $e->getMessage()), true); + } catch (Mage_Core_Exception $mageCoreException) { + $comment = $this->_createIpnComment(Mage::helper('paypal')->__('Note: %s', $mageCoreException->getMessage()), true); $comment->save(); - throw $e; + throw $mageCoreException; } } @@ -342,10 +342,10 @@ protected function _registerTransaction() Mage_Paypal_Model_Info::PAYMENTSTATUS_EXPIRED, Mage_Paypal_Model_Info::PAYMENTSTATUS_VOIDED => $this->_registerPaymentVoid(), default => throw new Exception("Cannot handle payment status '{$paymentStatus}'."), }; - } catch (Mage_Core_Exception $e) { - $comment = $this->_createIpnComment(Mage::helper('paypal')->__('Note: %s', $e->getMessage()), true); + } catch (Mage_Core_Exception $mageCoreException) { + $comment = $this->_createIpnComment(Mage::helper('paypal')->__('Note: %s', $mageCoreException->getMessage()), true); $comment->save(); - throw $e; + throw $mageCoreException; } } @@ -365,8 +365,8 @@ protected function _processRecurringProfile() Mage_Paypal_Model_Info::PAYMENTSTATUS_COMPLETED => $this->_registerRecurringProfilePaymentCapture(), default => throw new Exception("Cannot handle payment status '{$paymentStatus}'."), }; - } catch (Mage_Core_Exception $e) { - throw $e; + } catch (Mage_Core_Exception $mageCoreException) { + throw $mageCoreException; } } diff --git a/app/code/core/Mage/Paypal/Model/Method/Agreement.php b/app/code/core/Mage/Paypal/Model/Method/Agreement.php index e70b904b41e..9a57671bb92 100644 --- a/app/code/core/Mage/Paypal/Model/Method/Agreement.php +++ b/app/code/core/Mage/Paypal/Model/Method/Agreement.php @@ -156,12 +156,12 @@ public function updateBillingAgreementStatus(Mage_Payment_Model_Billing_Agreemen ->setBillingAgreementStatus($targetStatus); try { $api->callUpdateBillingAgreement(); - } catch (Mage_Core_Exception $e) { + } catch (Mage_Core_Exception $mageCoreException) { // when BA was already canceled, just pretend that the operation succeeded if (!(Mage_Sales_Model_Billing_Agreement::STATUS_CANCELED == $targetStatus && $api->getIsBillingAgreementAlreadyCancelled()) ) { - throw $e; + throw $mageCoreException; } } diff --git a/app/code/core/Mage/Paypal/Model/Observer.php b/app/code/core/Mage/Paypal/Model/Observer.php index ba92f374a25..3dc3b77243b 100644 --- a/app/code/core/Mage/Paypal/Model/Observer.php +++ b/app/code/core/Mage/Paypal/Model/Observer.php @@ -30,8 +30,8 @@ public function fetchReports() Mage::logException($e); } } - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); } } diff --git a/app/code/core/Mage/Paypal/Model/Payflowpro.php b/app/code/core/Mage/Paypal/Model/Payflowpro.php index 1b0d825bbb9..3eebd927dc6 100644 --- a/app/code/core/Mage/Paypal/Model/Payflowpro.php +++ b/app/code/core/Mage/Paypal/Model/Payflowpro.php @@ -425,14 +425,14 @@ protected function _postRequest(Varien_Object $request) * so we set up _urlEncodeBody flag to false */ $response = $client->setUrlEncodeBody(false)->request(); - } catch (Exception $e) { + } catch (Exception $exception) { $result->setResponseCode(-1) - ->setResponseReasonCode($e->getCode()) - ->setResponseReasonText($e->getMessage()); + ->setResponseReasonCode($exception->getCode()) + ->setResponseReasonText($exception->getMessage()); $debugData['result'] = $result->getData(); $this->_debug($debugData); - throw $e; + throw $exception; } $response = strstr($response->getBody(), 'RESULT'); diff --git a/app/code/core/Mage/ProductAlert/controllers/AddController.php b/app/code/core/Mage/ProductAlert/controllers/AddController.php index 03791d5526f..5eeefde0651 100644 --- a/app/code/core/Mage/ProductAlert/controllers/AddController.php +++ b/app/code/core/Mage/ProductAlert/controllers/AddController.php @@ -69,8 +69,8 @@ public function priceAction() ->setWebsiteId(Mage::app()->getStore()->getWebsiteId()); $model->save(); $session->addSuccess($this->__('The alert subscription has been saved.')); - } catch (Exception $e) { - $session->addException($e, $this->__('Unable to update the alert subscription.')); + } catch (Exception $exception) { + $session->addException($exception, $this->__('Unable to update the alert subscription.')); } $this->_redirectReferer(); @@ -103,8 +103,8 @@ public function stockAction() ->setWebsiteId(Mage::app()->getStore()->getWebsiteId()); $model->save(); $session->addSuccess($this->__('Alert subscription has been saved.')); - } catch (Exception $e) { - $session->addException($e, $this->__('Unable to update the alert subscription.')); + } catch (Exception $exception) { + $session->addException($exception, $this->__('Unable to update the alert subscription.')); } $this->_redirectReferer(); diff --git a/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php b/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php index ecf781b20fc..4576e77459c 100644 --- a/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php +++ b/app/code/core/Mage/ProductAlert/controllers/UnsubscribeController.php @@ -59,8 +59,8 @@ public function priceAction() } $session->addSuccess($this->__('The alert subscription has been deleted.')); - } catch (Exception $e) { - $session->addException($e, $this->__('Unable to update the alert subscription.')); + } catch (Exception $exception) { + $session->addException($exception, $this->__('Unable to update the alert subscription.')); } $this->_redirectUrl($product->getProductUrl()); @@ -77,8 +77,8 @@ public function priceAllAction() Mage::app()->getStore()->getWebsiteId(), ); $session->addSuccess($this->__('You will no longer receive price alerts for this product.')); - } catch (Exception $e) { - $session->addException($e, $this->__('Unable to update the alert subscription.')); + } catch (Exception $exception) { + $session->addException($exception, $this->__('Unable to update the alert subscription.')); } $this->_redirect('customer/account/'); @@ -113,8 +113,8 @@ public function stockAction() } $session->addSuccess($this->__('You will no longer receive stock alerts for this product.')); - } catch (Exception $e) { - $session->addException($e, $this->__('Unable to update the alert subscription.')); + } catch (Exception $exception) { + $session->addException($exception, $this->__('Unable to update the alert subscription.')); } $this->_redirectUrl($product->getProductUrl()); @@ -130,8 +130,8 @@ public function stockAllAction() Mage::app()->getStore()->getWebsiteId(), ); $session->addSuccess($this->__('You will no longer receive stock alerts.')); - } catch (Exception $e) { - $session->addException($e, $this->__('Unable to update the alert subscription.')); + } catch (Exception $exception) { + $session->addException($exception, $this->__('Unable to update the alert subscription.')); } $this->_redirect('customer/account/'); diff --git a/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php b/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php index 385d4ef25e4..8abc99ee7b9 100644 --- a/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php +++ b/app/code/core/Mage/Rating/Model/Resource/Rating/Option.php @@ -123,9 +123,9 @@ public function addVote($option) } $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw new Exception($e->getMessage(), $e->getCode(), $e); + throw new Exception($exception->getMessage(), $exception->getCode(), $exception); } return $this; 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 351a1ec2305..155b63b667b 100644 --- a/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php +++ b/app/code/core/Mage/Reports/Model/Resource/Report/Abstract.php @@ -436,8 +436,8 @@ protected function _getTZOffsetTransitions($timezone, $from = null, $to = null) $nextPeriod = $tr['time']; } - } catch (Exception $e) { - $this->_logException($e); + } catch (Exception $exception) { + $this->_logException($exception); } return $tzTransitions; diff --git a/app/code/core/Mage/Review/controllers/ProductController.php b/app/code/core/Mage/Review/controllers/ProductController.php index 2269f38dbb8..bb824f005c3 100644 --- a/app/code/core/Mage/Review/controllers/ProductController.php +++ b/app/code/core/Mage/Review/controllers/ProductController.php @@ -74,8 +74,8 @@ protected function _initProduct() 'product' => $product, 'controller_action' => $this, ]); - } catch (Mage_Core_Exception $e) { - Mage::logException($e); + } catch (Mage_Core_Exception $mageCoreException) { + Mage::logException($mageCoreException); return false; } diff --git a/app/code/core/Mage/Rss/Model/Rss.php b/app/code/core/Mage/Rss/Model/Rss.php index 5fd5570da0a..3a69432de89 100644 --- a/app/code/core/Mage/Rss/Model/Rss.php +++ b/app/code/core/Mage/Rss/Model/Rss.php @@ -62,8 +62,8 @@ public function createRssXml() try { $rssFeedFromArray = Zend_Feed::importArray($this->getFeedArray(), 'rss'); return $rssFeedFromArray->saveXml(); - } catch (Exception $e) { - return Mage::helper('rss')->__('Error in processing xml. %s', $e->getMessage()); + } catch (Exception $exception) { + return Mage::helper('rss')->__('Error in processing xml. %s', $exception->getMessage()); } } } diff --git a/app/code/core/Mage/Rule/Model/Resource/Abstract.php b/app/code/core/Mage/Rule/Model/Resource/Abstract.php index 51dfa422d4f..961d958ebd7 100644 --- a/app/code/core/Mage/Rule/Model/Resource/Abstract.php +++ b/app/code/core/Mage/Rule/Model/Resource/Abstract.php @@ -163,9 +163,9 @@ public function bindRuleToEntity($ruleIds, $entityIds, $entityType, $deleteOldRe } $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Sales/Model/Entity/Sale/Collection.php b/app/code/core/Mage/Sales/Model/Entity/Sale/Collection.php index b512523a271..c81f649cb29 100644 --- a/app/code/core/Mage/Sales/Model/Entity/Sale/Collection.php +++ b/app/code/core/Mage/Sales/Model/Entity/Sale/Collection.php @@ -90,9 +90,9 @@ public function load($printQuery = false, $logQuery = false) $this->printLogQuery($printQuery, $logQuery); try { $values = $this->_read->fetchAll($this->getSelect()->__toString()); - } catch (Exception $e) { + } catch (Exception $exception) { $this->printLogQuery(true, true, $this->getSelect()->__toString()); - throw $e; + throw $exception; } $stores = Mage::getResourceModel('core/store_collection')->setWithoutDefaultFilter()->load()->toOptionHash(); diff --git a/app/code/core/Mage/Sales/Model/Order.php b/app/code/core/Mage/Sales/Model/Order.php index ea4b2db6a5b..636ae296044 100644 --- a/app/code/core/Mage/Sales/Model/Order.php +++ b/app/code/core/Mage/Sales/Model/Order.php @@ -1467,13 +1467,13 @@ public function queueNewOrderEmail($forceMode = false) ->setIsSecureMode(true); $paymentBlock->getMethod()->setStore($storeId); $paymentBlockHtml = $paymentBlock->toHtml(); - } catch (Exception $e) { + } catch (Exception $exception) { // Stop store emulation process if (isset($appEmulation, $initialEnvironmentInfo)) { $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); } - throw $e; + throw $exception; } // Stop store emulation process diff --git a/app/code/core/Mage/Sales/Model/Order/Api.php b/app/code/core/Mage/Sales/Model/Order/Api.php index fd59aa6d878..f1813978b48 100644 --- a/app/code/core/Mage/Sales/Model/Order/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Api.php @@ -106,8 +106,8 @@ public function items($filters = null) foreach ($filters as $field => $value) { $orderCollection->addFieldToFilter($field, $value); } - } catch (Mage_Core_Exception $e) { - $this->_fault('filters_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('filters_invalid', $mageCoreException->getMessage()); } foreach ($orderCollection as $order) { @@ -190,8 +190,8 @@ public function addComment($orderIncrementId, $status, $comment = '', $notify = Mage::getDesign()->setStore($oldStore); Mage::getDesign()->setArea($oldArea); } - } catch (Mage_Core_Exception $e) { - $this->_fault('status_not_changed', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('status_not_changed', $mageCoreException->getMessage()); } return true; @@ -210,8 +210,8 @@ public function hold($orderIncrementId) try { $order->hold(); $order->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('status_not_changed', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('status_not_changed', $mageCoreException->getMessage()); } return true; @@ -230,8 +230,8 @@ public function unhold($orderIncrementId) try { $order->unhold(); $order->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('status_not_changed', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('status_not_changed', $mageCoreException->getMessage()); } return true; @@ -254,8 +254,8 @@ public function cancel($orderIncrementId) try { $order->cancel(); $order->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('status_not_changed', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('status_not_changed', $mageCoreException->getMessage()); } if (Mage_Sales_Model_Order::STATE_CANCELED != $order->getState()) { diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php index 46a515e564a..587d9bb5add 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo.php @@ -798,13 +798,13 @@ public function sendEmail($notifyCustomer = true, $comment = '') ->setIsSecureMode(true); $paymentBlock->getMethod()->setStore($storeId); $paymentBlockHtml = $paymentBlock->toHtml(); - } catch (Exception $e) { + } catch (Exception $exception) { // Stop store emulation process if (isset($appEmulation, $initialEnvironmentInfo)) { $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); } - throw $e; + throw $exception; } // Stop store emulation process diff --git a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php index b4ce3c369cc..b7a988245c9 100644 --- a/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Creditmemo/Api.php @@ -45,8 +45,8 @@ public function items($filters = null) foreach ($creditMemoCollection as $creditmemo) { $creditmemos[] = $this->_getAttributes($creditmemo, 'creditmemo'); } - } catch (Exception $e) { - $this->_fault('invalid_filter', $e->getMessage()); + } catch (Exception $exception) { + $this->_fault('invalid_filter', $exception->getMessage()); } return $creditmemos; @@ -174,8 +174,8 @@ public function create( ->save(); // send email notification $creditmemo->sendEmail($notifyCustomer, ($includeComment ? $comment : '')); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $creditmemo->getIncrementId(); @@ -197,8 +197,8 @@ public function addComment($creditmemoIncrementId, $comment, $notifyCustomer = f $creditmemo->addComment($comment, $notifyCustomer); $creditmemo->getCommentsCollection()->save(); $creditmemo->sendUpdateEmail($notifyCustomer, ($includeComment ? $comment : '')); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice.php b/app/code/core/Mage/Sales/Model/Order/Invoice.php index 5b6c1ddae84..c2eca4344da 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice.php @@ -834,13 +834,13 @@ public function sendEmail($notifyCustomer = true, $comment = '') ->setIsSecureMode(true); $paymentBlock->getMethod()->setStore($storeId); $paymentBlockHtml = $paymentBlock->toHtml(); - } catch (Exception $e) { + } catch (Exception $exception) { // Stop store emulation process if (isset($appEmulation, $initialEnvironmentInfo)) { $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); } - throw $e; + throw $exception; } // Stop store emulation process diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php index 1d0b4171b7d..ca7ff059301 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api.php @@ -51,8 +51,8 @@ public function items($filters = null) foreach ($filters as $field => $value) { $invoiceCollection->addFieldToFilter($field, $value); } - } catch (Mage_Core_Exception $e) { - $this->_fault('filters_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('filters_invalid', $mageCoreException->getMessage()); } foreach ($invoiceCollection as $invoice) { @@ -149,8 +149,8 @@ public function create($orderIncrementId, $itemsQty = [], $comment = null, $emai ->save(); $invoice->sendEmail($email, ($includeComment ? $comment : '')); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $invoice->getIncrementId(); @@ -179,8 +179,8 @@ public function addComment($invoiceIncrementId, $comment, $email = false, $inclu $invoice->addComment($comment, $email); $invoice->sendUpdateEmail($email, ($includeComment ? $comment : '')); $invoice->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php b/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php index e0da421e6b5..f48051f82b0 100644 --- a/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php +++ b/app/code/core/Mage/Sales/Model/Order/Invoice/Api/V2.php @@ -60,8 +60,8 @@ public function create($invoiceIncrementId, $itemsQty = [], $comment = null, $em try { Mage::getModel('core/resource_transaction')->addObject($invoice)->addObject($invoice->getOrder())->save(); $invoice->sendEmail($email, ($includeComment ? $comment : '')); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $invoice->getIncrementId(); diff --git a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php index e1f28add1cc..a98a024b1f5 100644 --- a/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php +++ b/app/code/core/Mage/Sales/Model/Order/Payment/Transaction.php @@ -299,12 +299,12 @@ public function closeAuthorization($shouldSave = true, $dryRun = false) { try { $this->_verifyThisTransactionExists(); - } catch (Exception $e) { + } catch (Exception $exception) { if ($dryRun) { return false; } - throw $e; + throw $exception; } $authTransaction = false; diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment.php b/app/code/core/Mage/Sales/Model/Order/Shipment.php index 5f2c222bb14..0ce09950829 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment.php @@ -464,13 +464,13 @@ public function sendEmail($notifyCustomer = true, $comment = '') ->setIsSecureMode(true); $paymentBlock->getMethod()->setStore($storeId); $paymentBlockHtml = $paymentBlock->toHtml(); - } catch (Exception $e) { + } catch (Exception $exception) { // Stop store emulation process if (isset($appEmulation, $initialEnvironmentInfo)) { $appEmulation->stopEnvironmentEmulation($initialEnvironmentInfo); } - throw $e; + throw $exception; } // Stop store emulation process diff --git a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php index 534a24bf5cc..bc504a5bd30 100644 --- a/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php +++ b/app/code/core/Mage/Sales/Model/Order/Shipment/Api.php @@ -47,8 +47,8 @@ public function items($filters = null) foreach ($filters as $field => $value) { $shipmentCollection->addFieldToFilter($field, $value); } - } catch (Mage_Core_Exception $e) { - $this->_fault('filters_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('filters_invalid', $mageCoreException->getMessage()); } foreach ($shipmentCollection as $shipment) { @@ -189,8 +189,8 @@ public function addTrack($shipmentIncrementId, $carrier, $title, $trackNumber, $ try { $shipment->save(); $track->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return $track->getId(); @@ -217,8 +217,8 @@ public function removeTrack($shipmentIncrementId, $trackId) try { $track->delete(); - } catch (Mage_Core_Exception $e) { - $this->_fault('track_not_deleted', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('track_not_deleted', $mageCoreException->getMessage()); } return true; @@ -249,8 +249,8 @@ public function sendInfo($shipmentIncrementId, $comment = '') $historyItem->setIsCustomerNotified(1); $historyItem->save(); } - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; @@ -305,8 +305,8 @@ public function addComment($shipmentIncrementId, $comment, $email = false, $incl $shipment->addComment($comment, $email); $shipment->sendUpdateEmail($email, ($includeInEmail ? $comment : '')); $shipment->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('data_invalid', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('data_invalid', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Sales/Model/Order/Status.php b/app/code/core/Mage/Sales/Model/Order/Status.php index 44a78283a50..bd0e75af6e5 100644 --- a/app/code/core/Mage/Sales/Model/Order/Status.php +++ b/app/code/core/Mage/Sales/Model/Order/Status.php @@ -40,9 +40,9 @@ public function assignState($state, $isDefault = false) try { $this->_getResource()->assignState($this->getStatus(), $state, $isDefault); $this->_getResource()->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getResource()->rollBack(); - throw $e; + throw $exception; } return $this; @@ -60,9 +60,9 @@ public function unassignState($state) try { $this->_getResource()->unassignState($this->getStatus(), $state); $this->_getResource()->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getResource()->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Sales/Model/Recurring/Profile.php b/app/code/core/Mage/Sales/Model/Recurring/Profile.php index 4223a28b3ca..7f95518bf87 100644 --- a/app/code/core/Mage/Sales/Model/Recurring/Profile.php +++ b/app/code/core/Mage/Sales/Model/Recurring/Profile.php @@ -144,9 +144,9 @@ public function submit() $this->getMethodInstance()->submitRecurringProfile($this, $this->getQuote()->getPayment()); $this->save(); $this->_getResource()->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_getResource()->rollBack(); - throw $e; + throw $exception; } } diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php index 77a15ac59d1..78ffda147a1 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Bestsellers.php @@ -213,9 +213,9 @@ public function aggregate($from = null, $to = null) $this->_updateRatingPos(self::AGGREGATION_YEARLY); $this->_setFlagData(Mage_Reports_Model_Flag::REPORT_BESTSELLERS_FLAG_CODE); - } catch (Exception $e) { + } catch (Exception $exception) { //$this->_getWriteAdapter()->rollBack(); - throw $e; + throw $exception; } //$this->_getWriteAdapter()->commit(); diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php index 68dea1900e1..8ae35503043 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Invoiced.php @@ -160,9 +160,9 @@ protected function _aggregateByInvoiceCreatedAt($from, $to) $insertQuery = $helper->getInsertFromSelectUsingAnalytic($select, $table, array_keys($columns)); $adapter->query($insertQuery); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php index 72c4400bfc7..43daa27028f 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Order/Createdat.php @@ -246,9 +246,9 @@ protected function _aggregateByField($aggregationField, $from, $to) ]); $adapter->query($select->insertFromSelect($this->getMainTable(), array_keys($columns))); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php index cb6a0804080..7af44cfa109 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Refunded.php @@ -129,9 +129,9 @@ protected function _aggregateByOrderCreatedAt($from, $to) $insertQuery = $helper->getInsertFromSelectUsingAnalytic($select, $table, array_keys($columns)); $adapter->query($insertQuery); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -260,9 +260,9 @@ protected function _aggregateByRefundCreatedAt($from, $to) $insertQuery = $helper->getInsertFromSelectUsingAnalytic($select, $table, array_keys($columns)); $adapter->query($insertQuery); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php index 4bf262762e3..83befefa14d 100644 --- a/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php +++ b/app/code/core/Mage/Sales/Model/Resource/Report/Shipping.php @@ -136,9 +136,9 @@ protected function _aggregateByOrderCreatedAt($from, $to) $insertQuery = $helper->getInsertFromSelectUsingAnalytic($select, $table, array_keys($columns)); $adapter->query($insertQuery); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; @@ -261,9 +261,9 @@ protected function _aggregateByShippingCreatedAt($from, $to) $insertQuery = $helper->getInsertFromSelectUsingAnalytic($select, $table, array_keys($columns)); $adapter->query($insertQuery); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Sales/Model/Service/Quote.php b/app/code/core/Mage/Sales/Model/Service/Quote.php index b6359a9cba7..237263d8511 100644 --- a/app/code/core/Mage/Sales/Model/Service/Quote.php +++ b/app/code/core/Mage/Sales/Model/Service/Quote.php @@ -176,7 +176,7 @@ public function submitOrder() Mage::dispatchEvent('sales_model_service_quote_submit_before', ['order' => $order, 'quote' => $quote]); try { $transaction->save(); - } catch (Exception $e) { + } catch (Exception $exception) { if (!Mage::getSingleton('customer/session')->isLoggedIn()) { // reset customer ID's on exception, because customer not saved $quote->getCustomer()->setId(null); @@ -191,7 +191,7 @@ public function submitOrder() } Mage::dispatchEvent('sales_model_service_quote_submit_failure', ['order' => $order, 'quote' => $quote]); - throw $e; + throw $exception; } $this->_inactivateQuote(); @@ -225,9 +225,9 @@ public function submitAll() try { $this->submitNominalItems(); $this->_shouldInactivateQuote = $shouldInactivateQuoteOld; - } catch (Exception $e) { + } catch (Exception $exception) { $this->_shouldInactivateQuote = $shouldInactivateQuoteOld; - throw $e; + throw $exception; } // no need to submit the order if there are no normal items remained diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php index 677a91f96c9..06366af3d82 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Report/Rule/Createdat.php @@ -163,9 +163,9 @@ protected function _aggregateByOrder($aggregationField, $from, $to) $adapter->query($select->insertFromSelect($table, array_keys($columns))); $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/SalesRule/Model/Resource/Rule.php b/app/code/core/Mage/SalesRule/Model/Resource/Rule.php index d1cd3bcdce1..f5ce5fa9126 100644 --- a/app/code/core/Mage/SalesRule/Model/Resource/Rule.php +++ b/app/code/core/Mage/SalesRule/Model/Resource/Rule.php @@ -189,9 +189,9 @@ public function saveStoreLabels($ruleId, $labels) } $adapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $adapter->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Tag/Model/Api.php b/app/code/core/Mage/Tag/Model/Api.php index 9f4082ce804..85700058905 100644 --- a/app/code/core/Mage/Tag/Model/Api.php +++ b/app/code/core/Mage/Tag/Model/Api.php @@ -124,8 +124,8 @@ public function add($data) $tag->saveRelation($product->getId(), $customer->getId(), $storeId); $result[$tagName] = $tag->getId(); } - } catch (Mage_Core_Exception $e) { - $this->_fault('save_error', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('save_error', $mageCoreException->getMessage()); } return $result; @@ -172,8 +172,8 @@ public function update($tagId, $data, $store) try { $tag->save(); - } catch (Mage_Core_Exception $e) { - $this->_fault('save_error', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('save_error', $mageCoreException->getMessage()); } return true; @@ -195,8 +195,8 @@ public function remove($tagId) try { $tag->delete(); - } catch (Mage_Core_Exception $e) { - $this->_fault('remove_error', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + $this->_fault('remove_error', $mageCoreException->getMessage()); } return true; diff --git a/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php b/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php index a206c9017bb..a103334e640 100644 --- a/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php +++ b/app/code/core/Mage/Tag/Model/Resource/Indexer/Summary.php @@ -233,9 +233,9 @@ public function aggregate($tagIds = null) $agregateSelect->insertFromSelect($this->getTable('tag/summary'), array_keys($selectedFields)), ); $this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return $this; diff --git a/app/code/core/Mage/Tax/Helper/Data.php b/app/code/core/Mage/Tax/Helper/Data.php index 51b8368767a..37e80fceed5 100644 --- a/app/code/core/Mage/Tax/Helper/Data.php +++ b/app/code/core/Mage/Tax/Helper/Data.php @@ -161,8 +161,8 @@ public function getProductPrice($product, $format = null) try { $value = $product->getPrice(); $value = $this->_app->getStore()->convertPrice($value, $format); - } catch (Exception $e) { - $value = $e->getMessage(); + } catch (Exception $exception) { + $value = $exception->getMessage(); } return $value; diff --git a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php index 5b81fe6b800..ccbb8d471af 100644 --- a/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php +++ b/app/code/core/Mage/Tax/Model/Resource/Report/Tax/Createdat.php @@ -127,9 +127,9 @@ protected function _aggregateByOrder($aggregationField, $from, $to) $insertQuery = $writeAdapter->insertFromSelect($select, $this->getMainTable(), array_keys($columns)); $writeAdapter->query($insertQuery); $writeAdapter->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $writeAdapter->rollBack(); - throw $e; + throw $exception; } return $this; 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 5c2b018db9a..8d936193fa8 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Dhl.php @@ -1049,8 +1049,8 @@ protected function _getXMLTracking($trackings) $responseBody = curl_exec($ch); $debugData['result'] = $responseBody; curl_close($ch); - } catch (Exception $e) { - $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; + } catch (Exception $exception) { + $debugData['result'] = ['error' => $exception->getMessage(), 'code' => $exception->getCode()]; $responseBody = ''; } 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 1d83a656257..1328135e062 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 @@ -813,8 +813,8 @@ protected function _getQuotes() } $this->_debug($debugData); - } catch (Exception $e) { - $this->_errors[$e->getCode()] = $e->getMessage(); + } catch (Exception $exception) { + $this->_errors[$exception->getCode()] = $exception->getMessage(); } return $this->_parseResponse($responseBody); 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 dd0ce23189d..9d7db28bd62 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Fedex.php @@ -749,8 +749,8 @@ protected function _parseXml($xmlContent) } catch (Exception $e) { throw new Exception(Mage::helper('usa')->__('Failed to parse xml document: %s', $xmlContent), $e->getCode(), $e); } - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); return false; } } 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 d7f065778cc..f411df6b8e0 100644 --- a/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php +++ b/app/code/core/Mage/Usa/Model/Shipping/Carrier/Ups.php @@ -1155,8 +1155,8 @@ protected function _getRestTracking($trackings) try { $accessToken = $this->setAPIAccessRequest(); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); $this->_trackingResult = Mage::getModel('shipping/tracking_result'); $this->_trackingResult->setError('Authentication error'); return $this->_trackingResult; @@ -1611,8 +1611,8 @@ protected function _sendShipmentAcceptRequest(SimpleXMLElement $shipmentConfirmR try { $response = new SimpleXMLElement($xmlResponse); - } catch (Exception $e) { - $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; + } catch (Exception $exception) { + $debugData['result'] = ['error' => $exception->getMessage(), 'code' => $exception->getCode()]; } $this->_debug($debugData); @@ -2030,9 +2030,9 @@ protected function _doShipmentRequestXML(Varien_Object $request): Varien_Object try { $response = new SimpleXMLElement($xmlResponse); - } catch (Exception $e) { - $debugData['result'] = ['error' => $e->getMessage(), 'code' => $e->getCode()]; - $result->setErrors($e->getMessage()); + } catch (Exception $exception) { + $debugData['result'] = ['error' => $exception->getMessage(), 'code' => $exception->getCode()]; + $result->setErrors($exception->getMessage()); } if (isset($response->Response->Error) @@ -2219,8 +2219,8 @@ protected function _getRestQuotes() try { $accessToken = $this->setAPIAccessRequest(); - } catch (Exception $e) { - Mage::logException($e); + } catch (Exception $exception) { + Mage::logException($exception); $result = Mage::getModel('shipping/rate_result'); $result->setError('Authentication error'); return $result; diff --git a/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php b/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php index 7436597d121..302b3aba06c 100644 --- a/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php +++ b/app/code/core/Mage/Widget/controllers/Adminhtml/WidgetController.php @@ -57,8 +57,8 @@ public function loadOptionsAction() $this->renderLayout(); } - } catch (Mage_Core_Exception $e) { - $result = ['error' => true, 'message' => $e->getMessage()]; + } catch (Mage_Core_Exception $mageCoreException) { + $result = ['error' => true, 'message' => $mageCoreException->getMessage()]; $this->getResponse()->setBody(Mage::helper('core')->jsonEncode($result)); } } diff --git a/app/code/core/Mage/Wishlist/controllers/IndexController.php b/app/code/core/Mage/Wishlist/controllers/IndexController.php index b72d3dda703..f63cfffb4f1 100644 --- a/app/code/core/Mage/Wishlist/controllers/IndexController.php +++ b/app/code/core/Mage/Wishlist/controllers/IndexController.php @@ -740,10 +740,10 @@ public function sendAction() $this->__('Your Wishlist has been shared.'), ); $this->_redirect('*/*', ['wishlist_id' => $wishlist->getId()]); - } catch (Exception $e) { + } catch (Exception $exception) { $translate->setTranslateInline(true); - Mage::getSingleton('wishlist/session')->addError($e->getMessage()); + Mage::getSingleton('wishlist/session')->addError($exception->getMessage()); Mage::getSingleton('wishlist/session')->setSharingForm($this->getRequest()->getPost()); $this->_redirect('*/*/share'); } diff --git a/cron.php b/cron.php index a887c8edaee..3b072cccaf0 100644 --- a/cron.php +++ b/cron.php @@ -22,8 +22,8 @@ try { Mage::app('admin')->setUseSessionInUrl(false); -} catch (Exception $e) { - Mage::printException($e); +} catch (Exception $exception) { + Mage::printException($exception); exit; } @@ -66,7 +66,7 @@ } elseif (isset($cronMode)) { Mage::dispatchEvent($cronMode); } -} catch (Exception $e) { - Mage::printException($e); +} catch (Exception $exception) { + Mage::printException($exception); exit(1); } diff --git a/get.php b/get.php index 9de7e66d9a0..572e2d1788f 100644 --- a/get.php +++ b/get.php @@ -153,8 +153,8 @@ } sendFile($filePath); -} catch (Exception $e) { - Mage::logException($e); +} catch (Exception $exception) { + Mage::logException($exception); } sendNotFoundPage(); diff --git a/install.php b/install.php index 4d78714a7b5..3898e5fb2f8 100644 --- a/install.php +++ b/install.php @@ -119,8 +119,8 @@ echo 'SUCCESS: ' . $installer->getEncryptionKey() . "\n"; exit; } -} catch (Exception $e) { - Mage::printException($e); +} catch (Exception $exception) { + Mage::printException($exception); } // print all errors if there were any diff --git a/lib/Magento/Crypt.php b/lib/Magento/Crypt.php index 4509567908a..9c361886184 100644 --- a/lib/Magento/Crypt.php +++ b/lib/Magento/Crypt.php @@ -73,9 +73,9 @@ public function __construct($key, $cipher = MCRYPT_BLOWFISH, $mode = MCRYPT_MODE } $this->_initVector = $initVector; - } catch (Exception $e) { + } catch (Exception $exception) { mcrypt_module_close($this->_handle); - throw $e; + throw $exception; } mcrypt_generic_init($this->_handle, $key, $initVector); diff --git a/lib/Varien/Data/Tree/Dbp.php b/lib/Varien/Data/Tree/Dbp.php index d602f01a431..06ddd76f5e2 100644 --- a/lib/Varien/Data/Tree/Dbp.php +++ b/lib/Varien/Data/Tree/Dbp.php @@ -326,9 +326,9 @@ public function move($node, $newParent, $prevNode = null) ); $this->_conn->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_conn->rollBack(); - throw new Exception("Can't move tree node due to error: " . $e->getMessage(), $e->getCode(), $e); + throw new Exception("Can't move tree node due to error: " . $exception->getMessage(), $exception->getCode(), $exception); } } diff --git a/lib/Varien/Db/Adapter/Mysqli.php b/lib/Varien/Db/Adapter/Mysqli.php index 3cd1637981a..8583b9e4c3d 100644 --- a/lib/Varien/Db/Adapter/Mysqli.php +++ b/lib/Varien/Db/Adapter/Mysqli.php @@ -152,9 +152,9 @@ public function multi_query($sql) } else { throw new Zend_Db_Adapter_Mysqli_Exception('multi_query: ' . $connection->error); } - } catch (Exception $e) { + } catch (Exception $exception) { $this->rollBack(); - throw $e; + throw $exception; } return true; diff --git a/lib/Varien/Db/Adapter/Pdo/Mysql.php b/lib/Varien/Db/Adapter/Pdo/Mysql.php index 3439a8e58ee..0053cb33a6a 100644 --- a/lib/Varien/Db/Adapter/Pdo/Mysql.php +++ b/lib/Varien/Db/Adapter/Pdo/Mysql.php @@ -499,23 +499,23 @@ public function query($sql, $bind = []) $this->_checkDdlTransaction($sql); $this->_prepareQuery($sql, $bind); $result = parent::query($sql, $bind); - } catch (Exception $e) { + } catch (Exception $exception) { $this->_debugStat(self::DEBUG_QUERY, $sql, $bind); // Detect implicit rollback - MySQL SQLSTATE: ER_LOCK_WAIT_TIMEOUT or ER_LOCK_DEADLOCK if ($this->_transactionLevel > 0 - && $e->getPrevious() && isset($e->getPrevious()->errorInfo[1]) - && in_array($e->getPrevious()->errorInfo[1], [1205, 1213]) + && $exception->getPrevious() && isset($exception->getPrevious()->errorInfo[1]) + && in_array($exception->getPrevious()->errorInfo[1], [1205, 1213]) ) { if ($this->_debug) { - $this->_debugWriteToFile('IMPLICIT ROLLBACK AFTER SQLSTATE: ' . $e->getPrevious()->errorInfo[1]); + $this->_debugWriteToFile('IMPLICIT ROLLBACK AFTER SQLSTATE: ' . $exception->getPrevious()->errorInfo[1]); } $this->_transactionLevel = 1; // Deadlock rolls back entire transaction $this->rollBack(); } - $this->_debugException($e); + $this->_debugException($exception); } $this->_debugStat(self::DEBUG_QUERY, $sql, $bind, $result); @@ -706,9 +706,9 @@ public function multi_query($sql) } #$this->commit(); - } catch (Exception $e) { + } catch (Exception $exception) { #$this->rollback(); - throw $e; + throw $exception; } $this->resetDdlCache(); diff --git a/lib/Varien/Db/Statement/Pdo/Mysql.php b/lib/Varien/Db/Statement/Pdo/Mysql.php index b783d8c185f..7668e550d70 100644 --- a/lib/Varien/Db/Statement/Pdo/Mysql.php +++ b/lib/Varien/Db/Statement/Pdo/Mysql.php @@ -61,8 +61,8 @@ public function _executeWithBinding(array $params) try { return $statement->execute(); - } catch (PDOException $e) { - throw new Zend_Db_Statement_Exception($e->getMessage(), (int) $e->getCode(), $e); + } catch (PDOException $pdoException) { + throw new Zend_Db_Statement_Exception($pdoException->getMessage(), (int) $pdoException->getCode(), $pdoException); } } diff --git a/lib/Varien/Db/Tree.php b/lib/Varien/Db/Tree.php index e782aa21d7d..72bfc2e28c7 100644 --- a/lib/Varien/Db/Tree.php +++ b/lib/Varien/Db/Tree.php @@ -219,8 +219,8 @@ public function clear($data = []) try { $this->_db->insert($this->_table, $data); - } catch (Zend_Db_Adapter_Exception $e) { - echo $e->getMessage(); + } catch (Zend_Db_Adapter_Exception $zendDbAdapterException) { + echo $zendDbAdapterException->getMessage(); } return $this->_db->lastInsertId(); @@ -387,10 +387,10 @@ public function moveNode($eId, $pId, $aId = 0) $this->_db->commit(); echo "alert('node moved');"; return true; - } catch (Exception $e) { + } catch (Exception $exception) { $this->_db->rollBack(); echo "alert('node not moved: fatal error');"; - echo $e->getMessage(); + echo $exception->getMessage(); echo "
\r\n"; echo $sql; echo "
\r\n"; @@ -490,8 +490,8 @@ public function getChildren($ID, $start_level = 0, $end_level = 0) { try { $info = $this->getNodeInfo($ID); - } catch (Exception $e) { - echo $e->getMessage(); + } catch (Exception $exception) { + echo $exception->getMessage(); exit; } diff --git a/tests/unit/Mage/Admin/Model/UserTest.php b/tests/unit/Mage/Admin/Model/UserTest.php index 6ebebe941cb..d22b9e34697 100644 --- a/tests/unit/Mage/Admin/Model/UserTest.php +++ b/tests/unit/Mage/Admin/Model/UserTest.php @@ -45,8 +45,8 @@ public function testAuthenticate(bool|string $expectedResult, array $methods): v try { self::assertSame($expectedResult, $mock->authenticate($methods['getUsername'], $methods['getPassword'])); - } catch (Mage_Core_Exception $exception) { - self::assertSame($expectedResult, $exception->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertSame($expectedResult, $mageCoreException->getMessage()); } } diff --git a/tests/unit/Mage/AdminNotification/Model/InboxTest.php b/tests/unit/Mage/AdminNotification/Model/InboxTest.php index fe6cfa34fd7..1e2315c1c12 100644 --- a/tests/unit/Mage/AdminNotification/Model/InboxTest.php +++ b/tests/unit/Mage/AdminNotification/Model/InboxTest.php @@ -76,8 +76,8 @@ public function testAddException(): void { try { self::$subject->add(0, self::TITLE, __METHOD__); - } catch (Mage_Core_Exception $e) { - self::assertSame('Wrong message type', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertSame('Wrong message type', $mageCoreException->getMessage()); } } diff --git a/tests/unit/Mage/Catalog/Model/UrlTest.php b/tests/unit/Mage/Catalog/Model/UrlTest.php index e3d1296af18..fdd1d163618 100644 --- a/tests/unit/Mage/Catalog/Model/UrlTest.php +++ b/tests/unit/Mage/Catalog/Model/UrlTest.php @@ -65,8 +65,8 @@ public function testGeneratePath( ): void { try { self::assertSame($expectedResult, self::$subject->generatePath($type, $product, $category, $parentPath)); - } catch (Mage_Core_Exception $e) { - self::assertSame($expectedResult, $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertSame($expectedResult, $mageCoreException->getMessage()); } } diff --git a/tests/unit/Mage/Core/Model/AppTest.php b/tests/unit/Mage/Core/Model/AppTest.php index 389187474e5..4e0bacff41a 100644 --- a/tests/unit/Mage/Core/Model/AppTest.php +++ b/tests/unit/Mage/Core/Model/AppTest.php @@ -36,9 +36,9 @@ public function testGetStore(Mage_Core_Model_Store|int|string|bool|null $id): vo { try { self::assertInstanceOf(Mage_Core_Model_Store::class, self::$subject->getStore($id)); - } catch (Mage_Core_Model_Store_Exception $e) { - self::assertNotEmpty($e->getMessage()); - self::assertSame('Invalid store code requested.', $e->getMessage()); + } catch (Mage_Core_Model_Store_Exception $mageCoreModelStoreException) { + self::assertNotEmpty($mageCoreModelStoreException->getMessage()); + self::assertSame('Invalid store code requested.', $mageCoreModelStoreException->getMessage()); } } @@ -51,9 +51,9 @@ public function testGetWebsite(Mage_Core_Model_Website|int|string|bool|null $id) { try { self::assertInstanceOf(Mage_Core_Model_Website::class, self::$subject->getWebsite($id)); - } catch (Mage_Core_Exception $exception) { - self::assertNotEmpty($exception->getMessage()); - self::assertSame('Invalid website id requested.', $exception->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertNotEmpty($mageCoreException->getMessage()); + self::assertSame('Invalid website id requested.', $mageCoreException->getMessage()); } } @@ -66,9 +66,9 @@ public function testGetGroup(Mage_Core_Model_Store_Group|int|string|bool|null $i { try { self::assertInstanceOf(Mage_Core_Model_Store_Group::class, self::$subject->getGroup($id)); - } catch (Mage_Core_Exception $e) { - self::assertNotEmpty($e->getMessage()); - self::assertSame('Invalid store group id requested.', $e->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertNotEmpty($mageCoreException->getMessage()); + self::assertSame('Invalid store group id requested.', $mageCoreException->getMessage()); } } } diff --git a/tests/unit/Mage/Index/Model/ProcessTest.php b/tests/unit/Mage/Index/Model/ProcessTest.php index ea70cee838d..735c6675535 100644 --- a/tests/unit/Mage/Index/Model/ProcessTest.php +++ b/tests/unit/Mage/Index/Model/ProcessTest.php @@ -38,8 +38,8 @@ public function testReindexEverything(): void try { self::assertInstanceOf(Subject::class, self::$subject->reindexEverything()); - } catch (Mage_Core_Exception $exception) { - self::assertSame(self::INDEXER_MODEL_IS_NOT_DEFINED, $exception->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertSame(self::INDEXER_MODEL_IS_NOT_DEFINED, $mageCoreException->getMessage()); } } @@ -52,8 +52,8 @@ public function testDisableIndexerKeys(): void try { self::assertInstanceOf(Subject::class, self::$subject->disableIndexerKeys()); - } catch (Mage_Core_Exception $exception) { - self::assertSame(self::INDEXER_MODEL_IS_NOT_DEFINED, $exception->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertSame(self::INDEXER_MODEL_IS_NOT_DEFINED, $mageCoreException->getMessage()); } } @@ -67,8 +67,8 @@ public function testEnableIndexerKeys(): void try { self::assertInstanceOf(Subject::class, self::$subject->enableIndexerKeys()); - } catch (Mage_Core_Exception $exception) { - self::assertSame(self::INDEXER_MODEL_IS_NOT_DEFINED, $exception->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertSame(self::INDEXER_MODEL_IS_NOT_DEFINED, $mageCoreException->getMessage()); } } diff --git a/tests/unit/Mage/Reports/Helper/DataTest.php b/tests/unit/Mage/Reports/Helper/DataTest.php index 57deccf712d..fb7ca21e221 100644 --- a/tests/unit/Mage/Reports/Helper/DataTest.php +++ b/tests/unit/Mage/Reports/Helper/DataTest.php @@ -61,8 +61,8 @@ public function testGetIntervals(int|string $expectedResult, string $from, strin try { self::assertCount($expectedResult, self::$subject->getIntervals($from, $to, $period)); - } catch (Zend_Date_Exception $exception) { - self::assertSame("No date part in '' found.", $exception->getMessage()); + } catch (Zend_Date_Exception $zendDateException) { + self::assertSame("No date part in '' found.", $zendDateException->getMessage()); } } @@ -78,8 +78,8 @@ public function testPrepareIntervalsCollection(int|string $expectedResult, strin try { self::$subject->prepareIntervalsCollection($collection, $from, $to, $period); self::assertGreaterThanOrEqual(0, $collection->count()); - } catch (\Zend_Date_Exception $exception) { - self::assertSame($expectedResult, $exception->getMessage()); + } catch (\Zend_Date_Exception $zendDateException) { + self::assertSame($expectedResult, $zendDateException->getMessage()); } } } diff --git a/tests/unit/Mage/Rule/Model/AbstractTest.php b/tests/unit/Mage/Rule/Model/AbstractTest.php index 14aadbdb5b6..5936f4de8d8 100644 --- a/tests/unit/Mage/Rule/Model/AbstractTest.php +++ b/tests/unit/Mage/Rule/Model/AbstractTest.php @@ -44,8 +44,8 @@ public function testGetProductFlatSelect(): void { try { self::assertInstanceOf(Varien_Db_Select::class, self::$subject->getProductFlatSelect(0)); - } catch (Mage_Core_Exception $exception) { - self::assertSame('Resource is not set.', $exception->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertSame('Resource is not set.', $mageCoreException->getMessage()); } } @@ -174,8 +174,8 @@ public function testGetWebsiteIds(): void { try { self::assertIsArray(self::$subject->getWebsiteIds()); - } catch (Mage_Core_Exception $exception) { - self::assertSame('Resource is not set.', $exception->getMessage()); + } catch (Mage_Core_Exception $mageCoreException) { + self::assertSame('Resource is not set.', $mageCoreException->getMessage()); } } diff --git a/tests/unit/Varien/Data/Form/Filter/DateTest.php b/tests/unit/Varien/Data/Form/Filter/DateTest.php index 7341a00e841..b966321b46a 100644 --- a/tests/unit/Varien/Data/Form/Filter/DateTest.php +++ b/tests/unit/Varien/Data/Form/Filter/DateTest.php @@ -34,10 +34,10 @@ public function testInputFilter(?string $expectedResult, ?string $value): void { try { self::assertSame($expectedResult, $this->subject->inputFilter($value)); - } catch (Throwable $e) { + } catch (Throwable $throwable) { // PHP7: bcsub(): bcmath function argument is not well-formed // PHP8: bcsub(): Argument #1 ($num1) is not well-formed - self::assertStringStartsWith((string) $expectedResult, $e->getMessage()); + self::assertStringStartsWith((string) $expectedResult, $throwable->getMessage()); } } diff --git a/tests/unit/Varien/Data/Form/Filter/DatetimeTest.php b/tests/unit/Varien/Data/Form/Filter/DatetimeTest.php index ba073893d6e..f2c3a235801 100644 --- a/tests/unit/Varien/Data/Form/Filter/DatetimeTest.php +++ b/tests/unit/Varien/Data/Form/Filter/DatetimeTest.php @@ -34,10 +34,10 @@ public function testInputFilter(?string $expectedResult, ?string $value): void { try { self::assertSame($expectedResult, $this->subject->inputFilter($value)); - } catch (Throwable $e) { + } catch (Throwable $throwable) { // PHP7: bcsub(): bcmath function argument is not well-formed // PHP8: bcsub(): Argument #1 ($num1) is not well-formed - self::assertStringStartsWith((string) $expectedResult, $e->getMessage()); + self::assertStringStartsWith((string) $expectedResult, $throwable->getMessage()); } } diff --git a/tests/unit/Varien/ObjectTest.php b/tests/unit/Varien/ObjectTest.php index adbd7d1368a..0e7179dc836 100644 --- a/tests/unit/Varien/ObjectTest.php +++ b/tests/unit/Varien/ObjectTest.php @@ -241,8 +241,8 @@ public function testGetSetUnsData(): void /** @phpstan-ignore-next-line */ $this->subject->notData(); self::fail('Invalid __call'); - } catch (Varien_Exception $exception) { - self::assertStringStartsWith('Invalid method', $exception->getMessage()); + } catch (Varien_Exception $varienException) { + self::assertStringStartsWith('Invalid method', $varienException->getMessage()); } }