Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Oct 17, 2024
1 parent ac084d7 commit 4298305
Show file tree
Hide file tree
Showing 15 changed files with 23 additions and 70 deletions.
59 changes: 2 additions & 57 deletions .phpstan.dist.baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -117,22 +117,7 @@ parameters:

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Checkout/Agreement/Edit/Form.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Cms/Page/Edit/Tab/Main.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 4
count: 3
path: app/code/core/Mage/Adminhtml/Block/Customer/Edit/Tab/Account.php

-
Expand Down Expand Up @@ -190,31 +175,21 @@ parameters:
count: 1
path: app/code/core/Mage/Adminhtml/Block/Permissions/Usernroles.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Edit/Tab/Main.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Labels.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 2
count: 1
path: app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php

-
message: "#^Parameter \\#3 \\$refValues of method Mage_Adminhtml_Block_Widget_Form_Element_Dependence\\:\\:addFieldDependence\\(\\) expects array\\|string, int given\\.$#"
count: 3
path: app/code/core/Mage/Adminhtml/Block/Promo/Quote/Edit/Tab/Main.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Rating/Edit/Tab/Form.php

-
message: "#^Parameter \\#1 \\$collection of method Mage_Adminhtml_Block_Widget_Grid\\:\\:setCollection\\(\\) expects Varien_Data_Collection_Db, Mage_Reports_Model_Resource_Report_Collection given\\.$#"
count: 1
Expand Down Expand Up @@ -290,16 +265,6 @@ parameters:
count: 1
path: app/code/core/Mage/Adminhtml/Block/Report/Tag/Popular/Grid.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php

-
message: "#^Return type \\(int\\) of method Mage_Adminhtml_Block_Review_Grid_Filter_Type\\:\\:getCondition\\(\\) should be compatible with return type \\(array\\|null\\) of method Mage_Adminhtml_Block_Widget_Grid_Column_Filter_Select\\:\\:getCondition\\(\\)$#"
count: 1
Expand Down Expand Up @@ -475,11 +440,6 @@ parameters:
count: 1
path: app/code/core/Mage/Adminhtml/Block/Shipping/Carrier/Tablerate/Grid.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php

-
message: "#^Property Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset\\:\\:\\$_element \\(Varien_Data_Form_Element_Fieldset\\) does not accept Varien_Data_Form_Element_Abstract\\.$#"
count: 1
Expand Down Expand Up @@ -560,11 +520,6 @@ parameters:
count: 1
path: app/code/core/Mage/Adminhtml/Block/System/Currency/Rate/Matrix.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/System/Design/Edit/Tab/General.php

-
message: "#^Method Mage_Core_Model_Email_Template\\:\\:getProcessedTemplate\\(\\) invoked with 2 parameters, 0\\-1 required\\.$#"
count: 1
Expand All @@ -590,11 +545,6 @@ parameters:
count: 2
path: app/code/core/Mage/Adminhtml/Block/Tax/Rule/Grid.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php

-
message: "#^Method Mage_Adminhtml_Block_Widget_Container\\:\\:_addButtonChildBlock\\(\\) should return Mage_Adminhtml_Block_Widget_Button but returns Mage_Core_Block_Abstract\\|false\\.$#"
count: 1
Expand Down Expand Up @@ -7370,11 +7320,6 @@ parameters:
count: 1
path: app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php

-
message: "#^Parameter \\#1 \\$renderer of method Varien_Data_Form_Element_Abstract\\:\\:setRenderer\\(\\) expects Varien_Data_Form_Element_Renderer_Interface, Mage_Core_Block_Abstract\\|false given\\.$#"
count: 1
path: app/code/core/Mage/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php

-
message: "#^Variable \\$productsOptions might not be defined\\.$#"
count: 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ protected function _prepareForm()
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
} else {
$fieldset->addField('store_id', 'hidden', [
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Cms/Block/Edit/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ protected function _prepareForm()
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
} else {
$fieldset->addField('store_id', 'hidden', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ protected function _prepareForm()
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
'disabled' => $isElementDisabled,
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
} else {
$fieldset->addField('store_id', 'hidden', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function(v, elem){
);
// @codingStandardsIgnoreEnd
}
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$form->getElement('website_id')->setRenderer($renderer);

$customerStoreId = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ protected function _prepareForm()
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm()
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function _prepareForm()
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getWebsiteValuesForForm()
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function _prepareForm()
'name' => 'stores[]',
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm()
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);

$fieldset->addField('position', 'text', [
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Review/Add/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function _prepareForm()
'name' => 'select_stores[]',
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(),
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Review/Edit/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ protected function _prepareForm()
'name' => 'stores[]',
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(),
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
$review->setSelectStores($review->getStores());
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Sitemap/Edit/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ protected function _prepareForm()
'value' => $model->getStoreId(),
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(),
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
} else {
$fieldset->addField('store_id', 'hidden', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected function _prepareForm()
'name' => 'store_id',
'required' => true,
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
} else {
$fieldset->addField('store_id', 'hidden', [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ protected function _prepareForm()
'disabled' => true,
'value' => $formValues['store_id'],
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$element->setRenderer($renderer);
if ($noStoreError) {
$element->setAfterElementHtml($noStoreError);
Expand Down
8 changes: 8 additions & 0 deletions app/code/core/Mage/Adminhtml/Block/Widget/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -238,8 +238,16 @@ protected function _getAdditionalElementTypes()
* @param Varien_Data_Form_Element_Abstract $element
* @return string
*/
// phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClass
protected function _getAdditionalElementHtml($element)
{
return '';
}

protected function getStoreSwitcherRenderer(): Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset_Element
{
/** @var Mage_Adminhtml_Block_Store_Switcher_Form_Renderer_Fieldset_Element $renderer */
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
return $renderer;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ protected function _prepareForm()
'required' => true,
'values' => Mage::getSingleton('adminhtml/system_store')->getStoreValuesForForm(false, true),
]);
$renderer = $this->getLayout()->createBlock('adminhtml/store_switcher_form_renderer_fieldset_element');
$renderer = $this->getStoreSwitcherRenderer();
$field->setRenderer($renderer);
}

Expand Down

0 comments on commit 4298305

Please sign in to comment.