Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPMD: suppressed warning for unused parameters #2786

Closed
wants to merge 11 commits into from
4 changes: 4 additions & 0 deletions app/code/core/Mage/Admin/Model/Acl/Assert/Ip.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class Mage_Admin_Model_Acl_Assert_Ip implements Zend_Acl_Assert_Interface
* @param Mage_Admin_Model_Acl_Resource|null $resource
* @param string|null $privilege
* @return bool|null
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function assert(
Mage_Admin_Model_Acl $acl,
Expand All @@ -48,6 +50,8 @@ public function assert(

/**
* @param string|false $ip
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _isCleanIP($ip)
{
Expand Down
4 changes: 4 additions & 0 deletions app/code/core/Mage/Admin/Model/Acl/Assert/Time.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class Mage_Admin_Model_Acl_Assert_Time implements Zend_Acl_Assert_Interface
* @param Mage_Admin_Model_Acl_Resource|null $resource
* @param string|null $privilege
* @return bool|null
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function assert(
Mage_Admin_Model_Acl $acl,
Expand All @@ -48,6 +50,8 @@ public function assert(

/**
* @param int $time
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _isCleanTime($time)
{
Expand Down
4 changes: 4 additions & 0 deletions app/code/core/Mage/Admin/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ class Mage_Admin_Model_Observer
* Handler for controller_action_predispatch event
*
* @param Varien_Event_Observer $observer
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function actionPreDispatchAdmin($observer)
{
Expand Down Expand Up @@ -112,6 +114,8 @@ public function actionPreDispatchAdmin($observer)
*
* @deprecated after 1.4.0.1, logic moved to admin session
* @param Varien_Event_Observer $event
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function actionPostDispatchAdmin($event)
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/AdminNotification/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ public function getUnreadNoticeCount($severity)
* @param bool $withExt
* @return string
* @deprecated v19.4.16
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getPopupObjectUrl($withExt = false)
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/AdminNotification/Model/Observer.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ class Mage_AdminNotification_Model_Observer
* Predispath admin action controller
*
* @param Varien_Event_Observer $observer
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function preDispatch(Varien_Event_Observer $observer)
{
Expand Down
4 changes: 4 additions & 0 deletions app/code/core/Mage/AdminNotification/Model/Resource/Inbox.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ public function loadLatestNotice(Mage_AdminNotification_Model_Inbox $object)
*
* @param Mage_AdminNotification_Model_Inbox $object
* @return array
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getNoticeStatus(Mage_AdminNotification_Model_Inbox $object)
{
Expand All @@ -87,6 +89,8 @@ public function getNoticeStatus(Mage_AdminNotification_Model_Inbox $object)
*
* @param Mage_AdminNotification_Model_Inbox $object
* @param array $data
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function parse(Mage_AdminNotification_Model_Inbox $object, array $data)
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Cache/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ protected function _prepareColumns()
* Decorate status column values
*
* @return string
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function decorateStatus($value, $row, $column, $isExport)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ public function setPreconfiguredValue()
*
* @param Mage_Catalog_Model_Product $product
* @return bool
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getCanShowProductPrice($product)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ class Mage_Adminhtml_Block_Catalog_Product_Frontend_Product_Watermark extends Ma
{
public const XML_PATH_IMAGE_TYPES = 'global/catalog/product/media/image_types';

/**
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
public function render(Varien_Data_Form_Element_Abstract $element)
{
$html = $this->_getHeaderHtml($element);
Expand Down Expand Up @@ -75,6 +79,11 @@ public function render(Varien_Data_Form_Element_Abstract $element)
return $html;
}

/**
* @param Varien_Data_Form_Element_Abstract $element
* @return string
* @throws Exception
*/
protected function _getHeaderHtml($element)
{
$id = $element->getHtmlId();
Expand All @@ -94,6 +103,12 @@ protected function _getHeaderHtml($element)
return $html;
}

/**
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getFooterHtml($element)
{
return '</tbody></table></fieldset>';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ protected function _getTaxObservingCode($attribute)
/**
* @param null $index deprecated
* @return string|null
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function getEscapedValue($index = null)
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Report/Grid/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ protected function _addOrderStatusFilter($collection, $filterData)
* @param Mage_Reports_Model_Resource_Report_Collection_Abstract $collection
* @param Varien_Object $filterData
* @return $this
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _addCustomFilter($collection, $filterData)
{
Expand Down
12 changes: 12 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Review/Rating/Detailed.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
class Mage_Adminhtml_Block_Review_Rating_Detailed extends Mage_Adminhtml_Block_Template
{
protected $_voteCollection = false;

public function __construct()
{
parent::__construct();
Expand All @@ -38,6 +39,10 @@ public function __construct()
}
}

/**
* @return Mage_Rating_Model_Resource_Rating_Collection
* @throws Mage_Core_Exception
*/
public function getRating()
{
if (!$this->getRatingCollection()) {
Expand Down Expand Up @@ -94,12 +99,19 @@ public function getRating()
return $this->getRatingCollection();
}

/**
* @return $this
*/
public function setIndependentMode()
{
$this->setIsIndependentMode(true);
return $this;
}

/**
* @return bool
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function isSelected($option, $rating)
{
if ($this->getIsIndependentMode()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ abstract class Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract extends Mag
* Prepare global layout
* Add renderers to Varien_Data_Form
*
* @return Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract
* @return $this
*/
protected function _prepareLayout()
{
Expand Down Expand Up @@ -76,7 +76,7 @@ public function getForm()
/**
* Prepare Form and add elements to form
*
* @return Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract
* @return $this
*/
abstract protected function _prepareForm();

Expand Down Expand Up @@ -110,7 +110,9 @@ protected function _getAdditionalFormElementRenderers()
* Add additional data to form element
*
* @param Varien_Data_Form_Element_Abstract $element
* @return Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract
* @return $this
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _addAdditionalFormElementData(Varien_Data_Form_Element_Abstract $element)
{
Expand All @@ -122,7 +124,7 @@ protected function _addAdditionalFormElementData(Varien_Data_Form_Element_Abstra
*
* @param array|Varien_Data_Collection $attributes
* @param Varien_Data_Form_Abstract $form
* @return Mage_Adminhtml_Block_Sales_Order_Create_Form_Abstract
* @return $this
*/
protected function _addAttributesToForm($attributes, Varien_Data_Form_Abstract $form)
{
Expand Down
12 changes: 12 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Sales/Order/Status/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ public function __construct()
$this->setDefaultDir('DESC');
}

/**
* @return $this
* @throws Exception
*/
protected function _prepareCollection()
{
$collection = Mage::getResourceModel('sales/order_status_collection');
Expand All @@ -47,6 +51,9 @@ protected function _prepareCollection()
return $this;
}

/**
* @inheritDoc
*/
protected function _prepareColumns()
{
$this->addColumn('label', [
Expand Down Expand Up @@ -96,6 +103,8 @@ protected function _prepareColumns()
* Decorate status column values
*
* @return string
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function decorateState($value, $row, $column, $isExport)
{
Expand All @@ -107,6 +116,9 @@ public function decorateState($value, $row, $column, $isExport)
return $cell;
}

/**
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function decorateAction($value, $row, $column, $isExport)
{
$cell = '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element)
* Prepare existing row data object
*
* @param Varien_Object $row
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _prepareArrayRow(Varien_Object $row)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,8 @@ protected function _getFooterHtml($element)
* @param Varien_Data_Form_Element_Abstract $element
* @param bool $tooltipsExist Init tooltips observer or not
* @return string
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getExtraJs($element, $tooltipsExist = false)
{
Expand Down
2 changes: 2 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Widget/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ protected function _getAdditionalElementTypes()
/**
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
protected function _getAdditionalElementHtml($element)
{
Expand Down
Loading