Skip to content

Commit 551a0f7

Browse files
authored
rector: RemoveUnusedVariableInCatchRector (#4834)
* rector: `RemoveUnusedVariableInCatchRector` * rector: `RemoveUnusedVariableInCatchRector` * fix
1 parent 3abc5b9 commit 551a0f7

File tree

139 files changed

+213
-212
lines changed

Some content is hidden

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

139 files changed

+213
-212
lines changed

app/Mage.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -703,7 +703,7 @@ public static function init($code = '', $type = 'store', $options = [], $modules
703703
} else {
704704
self::$_app->init($code, $type, $options);
705705
}
706-
} catch (Mage_Core_Model_Session_Exception $e) {
706+
} catch (Mage_Core_Model_Session_Exception) {
707707
header('Location: ' . self::getBaseUrl());
708708
die;
709709
} catch (Mage_Core_Model_Store_Exception $e) {
@@ -746,7 +746,7 @@ public static function run($code = '', $type = 'store', $options = [])
746746
'options' => $options,
747747
]);
748748
Varien_Profiler::stop('mage');
749-
} catch (Mage_Core_Model_Session_Exception $e) {
749+
} catch (Mage_Core_Model_Session_Exception) {
750750
header('Location: ' . self::getBaseUrl());
751751
die();
752752
} catch (Mage_Core_Model_Store_Exception $e) {
@@ -857,7 +857,7 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
857857
if (empty($file)) {
858858
$file = self::getStoreConfig('dev/log/file');
859859
}
860-
} catch (Exception $e) {
860+
} catch (Exception) {
861861
$logActive = true;
862862
}
863863

@@ -869,7 +869,7 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
869869

870870
try {
871871
$maxLogLevel = (int) self::getStoreConfig('dev/log/max_level');
872-
} catch (Throwable $e) {
872+
} catch (Throwable) {
873873
$maxLogLevel = Zend_Log::DEBUG;
874874
}
875875

@@ -924,7 +924,7 @@ public static function log($message, $level = null, $file = '', $forceLog = fals
924924

925925
$message = addcslashes($message, '<?');
926926
$loggers[$file]->log($message, $level);
927-
} catch (Exception $e) {
927+
} catch (Exception) {
928928
}
929929
}
930930

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ protected function _unserializeExtraData(Mage_Core_Model_Abstract $user)
448448
try {
449449
$unsterilizedData = Mage::helper('core/unserializeArray')->unserialize($user->getExtra());
450450
$user->setExtra($unsterilizedData);
451-
} catch (Exception $e) {
451+
} catch (Exception) {
452452
$user->setExtra(false);
453453
}
454454
return $user;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,12 +229,12 @@ public function isAllowed($resource, $privilege = null)
229229

230230
try {
231231
return $acl->isAllowed($user->getAclRole(), $resource, $privilege);
232-
} catch (Exception $e) {
232+
} catch (Exception) {
233233
try {
234234
if (!$acl->has($resource)) {
235235
return $acl->isAllowed($user->getAclRole(), null, $privilege);
236236
}
237-
} catch (Exception $e) {
237+
} catch (Exception) {
238238
}
239239
}
240240
}
@@ -308,7 +308,7 @@ protected function _loginFailed($e, $request, $username, $message)
308308
'user_name' => $username,
309309
'exception' => $e,
310310
]);
311-
} catch (Exception $e) {
311+
} catch (Exception) {
312312
}
313313

314314
if ($request && !$request->getParam('messageSent')) {

app/code/core/Mage/AdminNotification/Model/Feed.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ public function getFeedData()
144144

145145
try {
146146
$xml = new SimpleXMLElement($data);
147-
} catch (Exception $e) {
147+
} catch (Exception) {
148148
return false;
149149
}
150150

@@ -159,7 +159,7 @@ public function getFeedXml()
159159
try {
160160
$data = $this->getFeedData();
161161
$xml = new SimpleXMLElement($data);
162-
} catch (Exception $e) {
162+
} catch (Exception) {
163163
$xml = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8" ?><feed />');
164164
}
165165

app/code/core/Mage/Adminhtml/Block/Page/Menu.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ protected function _checkAcl($resource)
214214
{
215215
try {
216216
$res = Mage::getSingleton('admin/session')->isAllowed($resource);
217-
} catch (Exception $e) {
217+
} catch (Exception) {
218218
return false;
219219
}
220220
return $res;

app/code/core/Mage/Adminhtml/Block/Report/Grid.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ protected function _prepareCollection()
150150
$to = $this->getLocale()->date($this->getFilter('report_to'), Zend_Date::DATE_SHORT, null, false);
151151

152152
$collection->setInterval($from, $to);
153-
} catch (Exception $e) {
153+
} catch (Exception) {
154154
$this->_errors[] = Mage::helper('reports')->__('Invalid date specified.');
155155
}
156156
}

app/code/core/Mage/Adminhtml/Block/Report/Sales/Grid/Column/Renderer/Date.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function _getFormat()
3434
Mage_Core_Model_Locale::FORMAT_TYPE_MEDIUM,
3535
),
3636
};
37-
} catch (Exception $e) {
37+
} catch (Exception) {
3838
}
3939
}
4040
$format = self::$_format;
@@ -61,7 +61,7 @@ public function render(Varien_Object $row)
6161
$data = ($this->getColumn()->getGmtoffset())
6262
? Mage::app()->getLocale()->date($data, $dateFormat)->toString($format)
6363
: Mage::getSingleton('core/locale')->date($data, $dateFormat, null, false)->toString($format);
64-
} catch (Exception $e) {
64+
} catch (Exception) {
6565
$data = ($this->getColumn()->getTimezone())
6666
? Mage::app()->getLocale()->date($data, $dateFormat)->toString($format)
6767
: Mage::getSingleton('core/locale')->date($data, $dateFormat, null, false)->toString($format);

app/code/core/Mage/Adminhtml/Block/Sales/Items/Column/Default.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public function getCustomizedOptionValue($optionInfo)
5454
try {
5555
$group = Mage::getModel('catalog/product_option')->groupFactory($optionInfo['option_type']);
5656
return $group->getCustomizedView($optionInfo);
57-
} catch (Exception $e) {
57+
} catch (Exception) {
5858
return $default;
5959
}
6060
}

app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ protected function _convertDate($date, $locale)
192192
$dateObj->setTimezone(Mage_Core_Model_Locale::DEFAULT_TIMEZONE);
193193

194194
return $dateObj;
195-
} catch (Exception $e) {
195+
} catch (Exception) {
196196
return null;
197197
}
198198
}

app/code/core/Mage/Adminhtml/Block/Widget/Grid/Column/Filter/Datetime.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protected function _convertDate($date, $locale)
7272
$dateObj->setTimezone(Mage_Core_Model_Locale::DEFAULT_TIMEZONE);
7373

7474
return $dateObj;
75-
} catch (Exception $e) {
75+
} catch (Exception) {
7676
return null;
7777
}
7878
}

0 commit comments

Comments
 (0)