Skip to content

Commit

Permalink
Removed dead code (#2339)
Browse files Browse the repository at this point in the history
* Removed dead code

* phpstan fix

* Add logging to empty try/catch
  • Loading branch information
sreichel authored Jul 30, 2022
1 parent 1ae890b commit 1699468
Show file tree
Hide file tree
Showing 85 changed files with 33 additions and 726 deletions.
5 changes: 0 additions & 5 deletions .github/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -1495,11 +1495,6 @@ parameters:
count: 1
path: ../app/code/core/Mage/Adminhtml/Helper/Dashboard/Abstract.php

-
message: "#^Method Mage_Adminhtml_Helper_Data\\:\\:prepareFilterString\\(\\) has invalid return type data\\.$#"
count: 1
path: ../app/code/core/Mage/Adminhtml/Helper/Data.php

-
message: "#^Method Mage_Adminhtml_Model_Config\\:\\:getSection\\(\\) should return Varien_Simplexml_Element but return statement is missing\\.$#"
count: 1
Expand Down
20 changes: 1 addition & 19 deletions app/code/core/Mage/Admin/Model/Resource/Acl.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,26 +145,8 @@ public function loadRules(Mage_Admin_Model_Acl $acl, array $rulesArr)
$acl->deny($role, $resource, $privileges, $assert);
}
} catch (Exception $e) {
//$m = $e->getMessage();
//if ( eregi("^Resource '(.*)' not found", $m) ) {
// Deleting non existent resource rule from rules table
//$cond = $this->_write->quoteInto('resource_id = ?', $resource);
//$this->_write->delete(Mage::getSingleton('core/resource')->getTableName('admin/rule'), $cond);
//} else {
//TODO: We need to log such exceptions to somewhere like a system/errors.log
//}
Mage::logException($e);
}
/*
switch ($rule['permission']) {
case Mage_Admin_Model_Acl::RULE_PERM_ALLOW:
$acl->allow($role, $resource, $privileges, $assert);
break;
case Mage_Admin_Model_Acl::RULE_PERM_DENY:
$acl->deny($role, $resource, $privileges, $assert);
break;
}
*/
}
return $this;
}
Expand Down
4 changes: 0 additions & 4 deletions app/code/core/Mage/AdminNotification/Model/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ public function getFrequency()
public function getLastUpdate()
{
return Mage::app()->loadCache('admin_notifications_lastcheck');
// return Mage::getStoreConfig(self::XML_LAST_UPDATE_PATH);
}

/**
Expand All @@ -142,9 +141,6 @@ public function getLastUpdate()
public function setLastUpdate()
{
Mage::app()->saveCache(time(), 'admin_notifications_lastcheck');
// $config = Mage::getModel('core/config');
// /* @var $config Mage_Core_Model_Config */
// $config->saveConfig(self::XML_LAST_UPDATE_PATH, time());
return $this;
}

Expand Down
21 changes: 1 addition & 20 deletions app/code/core/Mage/Adminhtml/Block/Cache/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,24 +101,6 @@ protected function _prepareColumns()
'frame_callback' => array($this, 'decorateStatus')
));

// $this->addColumn('action',
// array(
// 'header' => $this->__('Action'),
// 'width' => '100',
// 'type' => 'action',
// 'getter' => 'getId',
// 'actions' => array(
// array(
// 'caption' => $this->__('Refresh'),
// 'url' => array('base'=> '*/*/refresh'),
// 'field' => 'type'
// ),
// ),
// 'filter' => false,
// 'sortable' => false,
// 'is_system' => true,
// ));

return parent::_prepareColumns();
}

Expand All @@ -145,12 +127,11 @@ public function decorateStatus($value, $row, $column, $isExport)
/**
* Get row edit url
*
* @return string
* @return false
*/
public function getRowUrl($row)
{
return false;
//return $this->getUrl('*/*/edit', array('type'=>$row->getId()));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function getStoreConfigurationUrl()
{
$storeId = (int) $this->getRequest()->getParam('store');
$params = array();
// $params = array('section'=>'catalog');

if ($storeId) {
$store = Mage::app()->getStore($storeId);
$params['website'] = $store->getWebsite()->getCode();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,16 +60,6 @@ public function _prepareLayout()
$fieldset = $form->addFieldset('base_fieldset', array('legend'=>Mage::helper('catalog')->__('General Information')));

if (!$this->getCategory()->getId()) {
// $fieldset->addField('path', 'select', array(
// 'name' => 'path',
// 'label' => Mage::helper('catalog')->__('Parent Category'),
// 'value' => base64_decode($this->getRequest()->getParam('parent')),
// 'values'=> $this->_getParentCategoryOptions(),
// //'required' => true,
// //'class' => 'required-entry'
// ),
// 'name'
// );
$parentId = $this->getRequest()->getParam('parent');
if (!$parentId) {
$parentId = Mage_Catalog_Model_Category::TREE_ROOT_ID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,12 @@ protected function _prepareForm()
),
));

// if ($model->getIsUserDefined() || !$model->getId()) {
$fieldset->addField('is_visible_on_front', 'select', array(
'name' => 'is_visible_on_front',
'label' => Mage::helper('catalog')->__('Visible on Catalog Pages on Front-end'),
'title' => Mage::helper('catalog')->__('Visible on Catalog Pages on Front-end'),
'values' => $yesno,
));
// }
$fieldset->addField('is_visible_on_front', 'select', array(
'name' => 'is_visible_on_front',
'label' => Mage::helper('catalog')->__('Visible on Catalog Pages on Front-end'),
'title' => Mage::helper('catalog')->__('Visible on Catalog Pages on Front-end'),
'values' => $yesno,
));

$form->setValues($model->getData());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,6 @@ public function getTemplatesHtml()
public function getOptionValues()
{
$optionsArr = array_reverse($this->getProduct()->getOptions(), true);
// $optionsArr = $this->getProduct()->getOptions();

if (!$this->_values) {
$showPrice = $this->getCanReadPrice();
Expand Down Expand Up @@ -245,9 +244,6 @@ public function getOptionValues()
}

if ($option->getGroupByType() == Mage_Catalog_Model_Product_Option::OPTION_GROUP_SELECT) {

// $valuesArr = array_reverse($option->getValues(), true);

$i = 0;
$itemCount = 0;
foreach ($option->getValues() as $_value) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,26 +35,12 @@ class Mage_Adminhtml_Block_Catalog_Product_Edit_Tabs_Configurable extends Mage_A
{
protected function _prepareLayout()
{
// $product = $this->getProduct();
$this->addTab('super_settings', array(
'label' => Mage::helper('catalog')->__('Configurable Product Settings'),
'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_super_settings')->toHtml(),
'active' => true
));

// if (!($superAttributes = $product->getTypeInstance()->getUsedProductAttributeIds())) {
$this->addTab('super_settings', array(
'label' => Mage::helper('catalog')->__('Configurable Product Settings'),
'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_super_settings')->toHtml(),
'active' => true
));

// } else {
// parent::_prepareLayout();
//
// $this->addTab('configurable', array(
// 'label' => Mage::helper('catalog')->__('Associated Products'),
// 'content' => $this->getLayout()->createBlock('adminhtml/catalog_product_edit_tab_super_config', 'admin.super.config.product')
// ->setProductId($this->getRequest()->getParam('id'))
// ->toHtml(),
// ));
// $this->bindShadowTabs('configurable', 'customer_options');
// }
return $this;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,6 @@ function(v, elem){
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$form->getElement('website_id')->setRenderer($renderer);

// if (Mage::app()->isSingleStoreMode()) {
// $fieldset->removeField('website_id');
// $fieldset->addField('website_id', 'hidden', array(
// 'name' => 'website_id'
// ));
// $customer->setWebsiteId(Mage::app()->getStore(true)->getWebsiteId());
// }

$customerStoreId = null;
if ($customer->getId()) {
$customerStoreId = Mage::app()->getWebsite($customer->getWebsiteId())->getDefaultStore()->getId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,6 @@ protected function _prepareColumns()
'header' => Mage::helper('customer')->__('Type'),
'type' => 'options',
'options' => $typeOptions,
// 'renderer' => 'adminhtml/customer_online_grid_renderer_type',
'index' => 'visitor_type'
));

Expand Down
2 changes: 0 additions & 2 deletions app/code/core/Mage/Adminhtml/Block/Notification/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ protected function _prepareMassaction()
'confirm' => Mage::helper('adminnotification')->__('Are you sure?')
));

// $this->getColumn('massaction')->setWidth('30px');

return $this;
}

Expand Down
3 changes: 0 additions & 3 deletions app/code/core/Mage/Adminhtml/Block/Page/Menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,6 @@ protected function _getHelperValue(Varien_Simplexml_Element $child)
if (isset($childAttributes['module'])) {
$helperName = (string)$childAttributes['module'];
}
// if (isset($childAttributes['translate'])) {
// $titleNodeName = (string)$childAttributes['translate'];
// }

return Mage::helper($helperName)->__((string)$child->$titleNodeName);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,6 @@ public function getShipment()

protected function _prepareLayout()
{
// $infoBlock = $this->getLayout()->createBlock('adminhtml/sales_order_view_info')
// ->setOrder($this->getShipment()->getOrder());
// $this->setChild('order_info', $infoBlock);

$this->setChild(
'items',
$this->getLayout()->createBlock('adminhtml/sales_order_shipment_create_items')
Expand All @@ -78,11 +74,7 @@ protected function _prepareLayout()
'tracking',
$this->getLayout()->createBlock('adminhtml/sales_order_shipment_create_tracking')
);
// $paymentInfoBlock = $this->getLayout()->createBlock('adminhtml/sales_order_payment')
// ->setPayment($this->getShipment()->getOrder()->getPayment());
// $this->setChild('payment_info', $paymentInfoBlock);

// return parent::_prepareLayout();
return $this;
}

Expand Down
25 changes: 0 additions & 25 deletions app/code/core/Mage/Adminhtml/Block/Sales/Order/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,29 +325,4 @@ public function getHeaderHtml()
{
return '<h3 class="' . $this->getHeaderCssClass() . '">' . $this->escapeHtml($this->getHeaderText()) . '</h3>';
}
//
// /**
// * Return URL for accept payment action
// *
// * @return string
// */
// public function getAcceptPaymentUrl()
// {
// return $this->getUrl('*/*/reviewPayment', array('action' => 'accept'));
// }
//
// /**
// * Return URL for deny payment action
// *
// * @return string
// */
// public function getDenyPaymentUrl()
// {
// return $this->getUrl('*/*/reviewPayment', array('action' => 'deny'));
// }
//
// public function getPaymentReviewUpdateUrl()
// {
// return $this->getUrl('*/*/reviewPaymentUpdate');
// }
}
5 changes: 1 addition & 4 deletions app/code/core/Mage/Adminhtml/Block/Tag/Grid/All.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ public function __construct()

protected function _prepareCollection()
{
$collection = Mage::getResourceModel('tag/tag_collection')
// ->addStoreFilter(Mage::app()->getStore()->getId())
->addStoresVisibility()
;
$collection = Mage::getResourceModel('tag/tag_collection')->addStoresVisibility();
$this->setCollection($collection);
return parent::_prepareCollection();
}
Expand Down
39 changes: 1 addition & 38 deletions app/code/core/Mage/Adminhtml/Block/Tag/Grid/Customers.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,7 @@ protected function _prepareCollection()
$collection = Mage::getResourceModel('tag_customer/collection')
->addAttributeToSelect('firstname')
->addAttributeToSelect('middlename')
->addAttributeToSelect('lastname')
// ->addAttributeToSelect('email')
// ->addAttributeToSelect('created_at')
// ->joinAttribute('billing_postcode', 'customer_address/postcode', 'default_billing')
// ->joinAttribute('billing_city', 'customer_address/city', 'default_billing')
// ->joinAttribute('billing_telephone', 'customer_address/telephone', 'default_billing')
// ->joinAttribute('billing_country_id', 'customer_address/country_id', 'default_billing')
// ->joinField('billing_country_name', 'directory/country_name', 'name',
// 'country_id=billing_country_id', array('language_code'=>'en'))
;
->addAttributeToSelect('lastname');

if ($productId = $this->getRequest()->getParam('product_id')) {
$collection->addProductFilter($productId);
Expand Down Expand Up @@ -83,32 +74,6 @@ protected function _prepareColumns()
'header' => Mage::helper('tag')->__('Last Name'),
'index' => 'lastname',
));
// $this->addColumn('email', array(
// 'header' =>Mage::helper('tag')->__('Email'),
// 'align' =>'center',
// 'index' =>'email'
// ));
// $this->addColumn('Telephone', array(
// 'header' =>Mage::helper('tag')->__('Telephone'),
// 'align' =>'center',
// 'index' =>'billing_telephone'
// ));
// $this->addColumn('billing_postcode', array(
// 'header' =>Mage::helper('tag')->__('ZIP/Post Code'),
// 'index' =>'billing_postcode',
// ));
// $this->addColumn('billing_country_name', array(
// 'header' =>Mage::helper('tag')->__('Country'),
// #'filter' => 'adminhtml/customer_grid_filter_country',
// 'index' =>'billing_country_name',
// ));
// $this->addColumn('customer_since', array(
// 'header' =>Mage::helper('tag')->__('Customer Since'),
// 'type' => 'date',
// 'align' => 'center',
// #'format' => 'Y.m.d',
// 'index' =>'created_at',
// ));
$this->addColumn('tags', array(
'header' => Mage::helper('tag')->__('Tags'),
'index' => 'tags',
Expand All @@ -132,8 +97,6 @@ protected function _prepareColumns()
->setColumnFilter('middlename')
->setColumnFilter('lastname');

// $this->addExportType('*/*/exportCsv', Mage::helper('tag')->__('CSV'));
// $this->addExportType('*/*/exportXml', Mage::helper('tag')->__('XML'));
return parent::_prepareColumns();
}

Expand Down
6 changes: 1 addition & 5 deletions app/code/core/Mage/Adminhtml/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,6 @@ public static function getUrl($route='', $params=array())
return Mage::getModel('adminhtml/url')->getUrl($route, $params);
}

// public function getCurrentUserId()
// {
// return Mage::getSingleton('admin/session')->getUser()->getId();
// }
public function getCurrentUserId()
{
if (Mage::getSingleton('admin/session')->getUser()) {
Expand All @@ -129,7 +125,7 @@ public function getCurrentUserId()
* Decode filter string
*
* @param string $filterString
* @return data
* @return array
*/
public function prepareFilterString($filterString)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,6 @@ class Mage_Adminhtml_Model_System_Config_Backend_Seo_Product extends Mage_Core_M
*/
protected function _afterSave()
{
/**
* Index model responsible for rewrites index
*/
// if ($this->isValueChanged()) {
// Mage::getSingleton('catalog/url')->refreshRewrites();
// }
return $this;
}
}
Loading

0 comments on commit 1699468

Please sign in to comment.