Skip to content

PHPStan: some fixes #4328

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

Merged
merged 1 commit into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
786 changes: 23 additions & 763 deletions .phpstan.dist.baseline.neon

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@
*/
class Mage_Adminhtml_Block_Sales_Order_Creditmemo_Create_Adjustments extends Mage_Adminhtml_Block_Template
{
/**
* @var Mage_Sales_Model_Order_Creditmemo
*/
protected $_source;

/**
* Initialize creditmemo adjustment totals
*
Expand All @@ -40,6 +44,9 @@ public function initTotals()
return $this;
}

/**
* @return Mage_Sales_Model_Order_Creditmemo
*/
public function getSource()
{
return $this->_source;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ public function getValue($key, $default = '', $defaultNew = null)

/**
* @param string $key
* @param string $value
* @param string|bool|int $value
* @return string
*
* @todo check remove int from param value
*/
public function getSelected($key, $value)
{
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Wishlist/Block/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public function getItemConfigureUrl($product)
/**
* Retrieve Escaped Description for Wishlist Item
*
* @param Mage_Catalog_Model_Product $item
* @param Mage_Wishlist_Model_Item $item
* @return string
*/
public function getEscapedDescription($item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
/** @var $this Mage_Api2_Block_Adminhtml_Attribute_Buttons */

/** @var Mage_Api2_Block_Adminhtml_Attribute_Buttons $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

?>

<script type="text/javascript">
//<![CDATA[
<?php
/** @var $myBlock Mage_Api2_Block_Adminhtml_Roles_Tab_Users */
/** @var Mage_Api2_Block_Adminhtml_Roles_Tab_Users $myBlock */
$myBlock = $this->getLayout()->getBlock('adminhtml.role.edit.tab.users');
$name = $myBlock->getJsObjectName();
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Catalog_Category_Edit_Form $this */
?>

<div class="content-header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@
* @copyright Copyright (c) 2021-2023 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php

/**
* Template for Mage_Adminhtml_Block_Catalog_Product_Edit
*
* @var Mage_Adminhtml_Block_Catalog_Product_Edit $this
*/
?>

<div class="content-header">
<h3 class="icon-head head-products"><?php echo $this->getHeader() ?></h3>
<p class="content-buttons form-buttons"><?php echo $this->getBackButtonHtml() ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2018-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Catalog_Product_Helper_Form_Gallery_Content $this */
?>
<div id="<?php echo $this->getHtmlId() ?>">
<ul class="messages">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset_Element $this */
?>
<?php $_element = $this->getElement() ?>
<?php if (!$_element->getNoDisplay()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,12 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
/*

/** @see Mage_Adminhtml_Block_Dashboard_Tab_Amounts */
/** @see Mage_Adminhtml_Block_Dashboard_Tab_Orders */
/** @var Mage_Adminhtml_Block_Dashboard_Graph $this */
?>
<div style="width:587px;margin:20px;position:relative;margin-left:-294px;left:50%">
<div style="position:absolute;right:1px;top:0px;left: expression(parentNode.offsetWidth - offsetWidth - 1 + 'px');">
<div style="padding:5px;height:15px;width:15px;background-color:#F4F4F4" id="dashboard_<?php echo $this->getHtmlId() ?>_cal_div"><img src="<?php echo Mage::getDesign()->getSkinUrl('images/grid-cal.gif') ?>" onclick="toggleCal('<?php echo $this->getHtmlId() ?>')" /></div>
<div style="padding:5px;display:none;width:200px;" id="dashboard_<?php echo $this->getHtmlId() ?>_range_div" class="switcher">
<?php echo $this->__('Select Range') ?>:
<select name="period" id="order_<?php echo $this->getHtmlId() ?>_period" onchange="changePeriod(this)">
<?php foreach ($this->helper('adminhtml/dashboard_data')->getDatePeriods() as $_value=>$_label): ?>
<?php if(in_array($_value, array('custom'))) continue; ?>
<option value="<?php echo $_value ?>" <?php if($this->getRequest()->getParam('period')==$_value): ?> selected<?php endif ?>><?php echo $_label ?></option>
<?php endforeach ?>
</select>
<img src="<?php echo Mage::getDesign()->getSkinUrl('images/dashboard-close.gif') ?>" onclick="toggleCal('<?php echo $this->getHtmlId() ?>')" />
</div>
</div>
<?php if($this->getCount()): ?>
<img src="<?php echo $this->getChartUrl() ?>" />
<?php else: ?>
<div align="center" style="width:587px;height:300px;"><?php echo $this->__('No Data Found') ?></div>
<?php endif ?>
</div>
<?php */ ?>

<div style="margin:20px;">
<p class="switcher a-right" style="padding:5px 10px;"><?php echo $this->__('Select Range') ?>:
<select name="period" id="order_<?php echo $this->getHtmlId() ?>_period" onchange="changeDiagramsPeriod(this);">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/
?>
<?php

/** @var Mage_Adminhtml_Block_Widget_Grid $this */

$numColumns = count($this->getColumns());
?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Dashboard $this */
?>

<?php if (is_array($this->getChild('diagrams')->getTabsIds())) : ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Dashboard_Sales $this */
?>
<?php if(count($this->getTotals()) > 0): ?>
<?php foreach( $this->getTotals() as $_total ): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Dashboard_Totals $this */
?>
<?php if(count($this->getTotals()) > 0): ?>
<div class="box" id="dashboard_diagram_totals">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Downloadable_Block_Adminhtml_Sales_Items_Column_Downloadable_Name $this */
?>

<?php if ($_item = $this->getItem()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Downloadable_Block_Adminhtml_Sales_Items_Column_Downloadable_Name $this */
?>

<?php if ($_item = $this->getItem()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Downloadable_Block_Adminhtml_Sales_Items_Column_Downloadable_Name $this */
?>

<?php if ($_item = $this->getItem()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Index_Block_Adminhtml_Notifications $this */
?>
<?php $_processes = $this->getProcessesForReindex()?>
<?php if($_processes):?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Store_Switcher $this */
?>

<?php if ($websites = $this->getWebsites()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Newsletter_Problem $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @copyright Copyright (c) 2022-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Newsletter_Queue_Edit $this */
?>
<div class="content-header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Newsletter_Queue_Edit $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Core_Block_Template $this */
?>
<!DOCTYPE html>
<html lang="en">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Newsletter_Subscriber $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
* @copyright Copyright (c) 2021-2024 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Newsletter_Template_Edit $this */
?>
<div class="content-header">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Newsletter_Template $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022-2023 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Core_Block_Template $this */
?>
<!DOCTYPE html>
<html lang="en">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,18 @@
* Calendar localization script. Should be put into page header.
*
* @see Mage_Core_Block_Html_Calendar
* @var Mage_Core_Block_Html_Calendar $this
* @var Mage_Core_Block_Html_Calendar $this
* @var string $enUS
* @var array $days
* @var string $firstDay
* @var array $months
* @var string $am
* @var string $pm
* @var string $today
* @var string $weekendDays
* @var string $defaultFormat
* @var string $toolTipFormat
* @var string $week
*/
?>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
?>
<?php
/**
* @see Mage_Adminhtml_Page_Block_Notices
* @var Mage_Adminhtml_Page_Block_Notices $this
* @see Mage_Adminhtml_Block_Page_Notices
* @var Mage_Adminhtml_Block_Page_Notices $this
*/
?>
<?php if ($this->displayNoscriptNotice()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
*/

/**
* @see Saas_Payment_Block_Form_Cashondelivery
* @var Saas_Payment_Block_Form_Cashondelivery $this
* @see Mage_Payment_Block_Form_Cashondelivery
* @var Mage_Payment_Block_Form_Cashondelivery $this
*/
?>
<?php if ($this->getInstructions()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
?>
<?php
/**
* @see Mage_Paypal_Block_System_Config_Fieldset_Hint
* @var Mage_Paypal_Block_System_Config_Fieldset_Hint $this
* @see Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Hint
* @var Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Hint $this
*/
?>
<?php if ($this->getHelpLink()): ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
?>
<?php
/**
* @see Mage_Paypal_Block_System_Config_Fieldset_Store
* @var Mage_Paypal_Block_System_Config_Fieldset_Store $this
* @see Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Store
* @var Mage_Paypal_Block_Adminhtml_System_Config_Fieldset_Store $this
*/
?>
<script type="text/javascript">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Permissions_Buttons $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
* @copyright Copyright (c) 2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Permissions_Roles $this */
?>
<div class="content-header">
<table cellspacing="0">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* @copyright Copyright (c) 2021-2022 The OpenMage Contributors (https://www.openmage.org)
* @license https://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
*/

/** @var Mage_Adminhtml_Block_Widget_Form_Renderer_Fieldset $this */
/** @var Varien_Data_Form_Element_Fieldset $_element */
?>
<?php $_element = $this->getElement() ?>
<div class="rule-tree">
Expand Down
Loading
Loading