Skip to content
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
7,781 changes: 6,953 additions & 828 deletions .github/phpstan-baseline.neon

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ parameters:
# Too much noise from "Variable $this might not be defined"
- */app/code/core/*/*/data/*
- */app/code/core/*/*/sql/*
level: 1
level: 2
checkFunctionNameCase: true
checkInternalClassCaseSensitivity: true

Expand Down
3 changes: 0 additions & 3 deletions app/code/core/Mage/Admin/Model/Session.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,12 @@ class Mage_Admin_Model_Session extends Mage_Core_Model_Session_Abstract
*/
public function __construct($parameters = array())
{
/** @var Mage_Admin_Model_Redirectpolicy _urlPolicy */
$this->_urlPolicy = (!empty($parameters['redirectPolicy'])) ?
$parameters['redirectPolicy'] : Mage::getModel('admin/redirectpolicy');

/** @var Mage_Core_Controller_Response_Http _response */
$this->_response = (!empty($parameters['response'])) ?
$parameters['response'] : new Mage_Core_Controller_Response_Http();

/** @var Mage_Core_Model_Factory $user */
$this->_factory = (!empty($parameters['factory'])) ?
$parameters['factory'] : Mage::getModel('core/factory');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
*/

/** @var $installer Mage_Core_Model_Resource_Setup */
/** @var Mage_Core_Model_Resource_Setup $installer */
$installer = $this;
$installer->startSetup();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ protected function _prepareLayout()
}

$attributeSetId = $this->getCategory()->getDefaultAttributeSetId();
/** @var $groupCollection Mage_Eav_Model_Resource_Entity_Attribute_Group_Collection */
/** @var Mage_Eav_Model_Resource_Entity_Attribute_Group_Collection $groupCollection */
$groupCollection = Mage::getResourceModel('eav/entity_attribute_group_collection')
->setAttributeSetFilter($attributeSetId)
->setSortOrder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ protected function _construct()
/**
* Retrieve data object related with form
*
* @return Mage_Catalog_Model_Product || Mage_Catalog_Model_Category
* @return Mage_Catalog_Model_Product | Mage_Catalog_Model_Category
*/
public function getDataObject()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function getCustomerGroups($groupId = null)
$this->_customerGroups = $this->_getInitialCustomerGroups();

foreach ($collection as $item) {
/** @var $item Mage_Customer_Model_Group */
/** @var Mage_Customer_Model_Group $item */
$this->_customerGroups[$item->getId()] = $item->getCustomerGroupCode();
}
}
Expand Down Expand Up @@ -211,7 +211,7 @@ public function getWebsites()
);

if (!$this->isScopeGlobal() && $this->getProduct()->getStoreId()) {
/** @var $website Mage_Core_Model_Website */
/** @var Mage_Core_Model_Website $website */
$website = Mage::app()->getStore($this->getProduct()->getStoreId())->getWebsite();

$this->_websites[$website->getId()] = array(
Expand All @@ -222,7 +222,7 @@ public function getWebsites()
$websites = Mage::app()->getWebsites(false);
$productWebsiteIds = $this->getProduct()->getWebsiteIds();
foreach ($websites as $website) {
/** @var $website Mage_Core_Model_Website */
/** @var Mage_Core_Model_Website $website */
if (!in_array($website->getId(), $productWebsiteIds)) {
continue;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function getScopeLabel($attribute)
/**
* Retrieve data object related with form
*
* @return Mage_Catalog_Model_Product || Mage_Catalog_Model_Category
* @return Mage_Catalog_Model_Product | Mage_Catalog_Model_Category
*/
public function getDataObject()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ protected function _prepareLayout()

protected function _prepareForm()
{
/** @var $model Mage_Cms_Model_Page */
/** @var Mage_Cms_Model_Page $model */
$model = Mage::registry('cms_page');

/*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function initForm()

$customer = Mage::registry('current_customer');

/** @var $customerForm Mage_Customer_Model_Form */
/** @var Mage_Customer_Model_Form $customerForm */
$customerForm = Mage::getModel('customer/form');
$customerForm->setEntity($customer)
->setFormCode('adminhtml_customer')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ public function initForm()

$addressModel = Mage::getModel('customer/address');
$addressModel->setCountryId(Mage::helper('core')->getDefaultCountry($customer->getStore()));
/** @var $addressForm Mage_Customer_Model_Form */
/** @var Mage_Customer_Model_Form $addressForm */
$addressForm = Mage::getModel('customer/form');
$addressForm->setFormCode('adminhtml_customer_address')
->setEntity($addressModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function __construct()

protected function _prepareCollection()
{
/** @var $quote Mage_Sales_Model_Quote */
/** @var Mage_Sales_Model_Quote $quote */
$quote = Mage::getModel('sales/quote');
// set website to quote, if any
if ($this->getWebsiteId()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ protected function _construct()
public function getValidateButton()
{
if (is_null($this->_validateButton)) {
/** @var $form Varien_Data_Form */
/** @var Varien_Data_Form $form */
$form = $this->_element->getForm();

$vatElementId = $this->_element->getHtmlId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ class Mage_Adminhtml_Block_Newsletter_Queue_Edit_Form extends Mage_Adminhtml_Blo
* Form can be run from newsletter template grid by option "Queue newsletter"
* or from newsletter queue grid by edit option.
*
* @param void
* @return $this
*/
protected function _prepareForm()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function __construct()

$selrids = array();

/** @var $item Mage_Admin_Model_Rules */
/** @var Mage_Admin_Model_Rules $item */
foreach ($rules_set->getItems() as $item) {
$itemResourceId = $item->getResource_id();
if (array_key_exists(strtolower($itemResourceId), $resources)) {
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Promo/Catalog/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct()
*/
protected function _prepareCollection()
{
/** @var $collection Mage_CatalogRule_Model_Mysql4_Rule_Collection */
/** @var Mage_CatalogRule_Model_Mysql4_Rule_Collection $collection */
$collection = Mage::getModel('catalogrule/rule')
->getResourceCollection();
$collection->addWebsitesToResult();
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Promo/Quote/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function __construct()
*/
protected function _prepareCollection()
{
/** @var $collection Mage_SalesRule_Model_Mysql4_Rule_Collection */
/** @var Mage_SalesRule_Model_Mysql4_Rule_Collection $collection */
$collection = Mage::getModel('salesrule/rule')
->getResourceCollection();
$collection->addWebsitesToResult();
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Block/Report/Grid.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ protected function _prepareCollection()
} else if(count($this->_defaultFilter)) {
$this->_setFilterValues($this->_defaultFilter);
}
/** @var $collection Mage_Reports_Model_Resource_Report_Collection */
/** @var Mage_Reports_Model_Resource_Report_Collection $collection */
$collection = Mage::getResourceModel('reports/report_collection');

$collection->setPeriod($this->getFilter('report_period'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ protected function _prepareCollection()
$storeId = '';
}

/** @var $collection Mage_Reports_Model_Resource_Product_Lowstock_Collection */
/** @var Mage_Reports_Model_Resource_Product_Lowstock_Collection $collection */
$collection = Mage::getResourceModel('reports/product_lowstock_collection')
->addAttributeToSelect('*')
->setStoreId($storeId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct()

protected function _prepareCollection()
{
/** @var $collection Mage_Reports_Model_Resource_Quote_Collection */
/** @var Mage_Reports_Model_Resource_Quote_Collection $collection */
$collection = Mage::getResourceModel('reports/quote_collection');

$filter = $this->getParam($this->getVarNameFilter(), array());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct()

protected function _prepareCollection()
{
/** @var $collection Mage_Reports_Model_Resource_Quote_Collection */
/** @var Mage_Reports_Model_Resource_Quote_Collection $collection */
$collection = Mage::getResourceModel('reports/quote_collection');
$collection->prepareForProductsInCarts()
->setSelectCountSqlType(Mage_Reports_Model_Resource_Quote_Collection::SELECT_COUNT_SQL_TYPE_CART);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ protected function _addAttributesToForm($attributes, Varien_Data_Form_Abstract $
$renderers = $this->_getAdditionalFormElementRenderers();

foreach ($attributes as $attribute) {
/** @var $attribute Mage_Customer_Model_Attribute */
/** @var Mage_Customer_Model_Attribute $attribute */
$attribute->setStoreId(Mage::getSingleton('adminhtml/session_quote')->getStoreId());
$inputType = $attribute->getFrontend()->getInputType();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function isMethodActive($code)
/**
* Retrieve rate of active shipping method
*
* @return Mage_Sales_Model_Quote_Address_Rate || false
* @return Mage_Sales_Model_Quote_Address_Rate | false
*/
public function getActiveMethodRate()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class Mage_Adminhtml_Block_Sales_Order_Totals_Tax extends Mage_Tax_Block_Sales_O
*/
public function getFullTaxInfo()
{
/** @var $source Mage_Sales_Model_Order */
/** @var Mage_Sales_Model_Order $source */
$source = $this->getOrder();

$taxClassAmount = array();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ private static function _sortHistoryByTimestamp($a, $b)
$createdAtA = $a['created_at'];
$createdAtB = $b['created_at'];

/** @var $createdAta Zend_Date */
/** @var Zend_Date $createdAtA */
if ($createdAtA->getTimestamp() == $createdAtB->getTimestamp()) {
return 0;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function getConditionName()
*/
protected function _prepareCollection()
{
/** @var $collection Mage_Shipping_Model_Mysql4_Carrier_Tablerate_Collection */
/** @var Mage_Shipping_Model_Mysql4_Carrier_Tablerate_Collection $collection */
$collection = Mage::getResourceModel('shipping/carrier_tablerate_collection');
$collection->setConditionFilter($this->getConditionName())
->setWebsiteFilter($this->getWebsiteId());
Expand Down
1 change: 0 additions & 1 deletion app/code/core/Mage/Adminhtml/Block/System/Config/Form.php
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ public function __construct()
*/
protected function _initObjects()
{
/** @var $_configDataObject Mage_Adminhtml_Model_Config_Data */
$this->_configDataObject = Mage::getSingleton('adminhtml/config_data');
$this->_configRoot = $this->_configDataObject->getConfigRoot();
$this->_configData = $this->_configDataObject->load();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ protected function _toHtml()
$appEmulation = Mage::getSingleton('core/app_emulation');
$initialEnvironmentInfo = $appEmulation->startEnvironmentEmulation($defaultStoreId);

/** @var $template Mage_Core_Model_Email_Template */
/** @var Mage_Core_Model_Email_Template $template */
$template = Mage::getModel('core/email_template');
$id = (int)$this->getRequest()->getParam('id');
if ($id) {
Expand Down
6 changes: 3 additions & 3 deletions app/code/core/Mage/Adminhtml/Block/System/Store/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function getTableData()
{
$data = array();
foreach (Mage::getModel('core/website')->getCollection() as $website) {
/** @var $website Mage_Core_Model_Website */
/** @var Mage_Core_Model_Website $website */
$groupCollection = $website->getGroupCollection();
$data[$website->getId()] = array(
'object' => $website,
Expand All @@ -81,7 +81,7 @@ public function getTableData()
);
$defaultGroupId = $website->getDefaultGroupId();
foreach ($groupCollection as $storeGroup) {
/** @var $storeGroup Mage_Core_Model_Store_Group */
/** @var Mage_Core_Model_Store_Group $storeGroup */
$storeCollection = $storeGroup->getStoreCollection();
$storeGroupCount = max(1, $storeCollection->count());
$data[$website->getId()]['storeGroups'][$storeGroup->getId()] = array(
Expand All @@ -95,7 +95,7 @@ public function getTableData()
}
$defaultStoreId = $storeGroup->getDefaultStoreId();
foreach ($storeCollection as $store) {
/** @var $store Mage_Core_Model_Store */
/** @var Mage_Core_Model_Store $store */
$data[$website->getId()]['storeGroups'][$storeGroup->getId()]['stores'][$store->getId()] = array(
'object' => $store
);
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Helper/Catalog.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public function setCategoryAttributeTabBlock($attributeTabBlock)
public function getSitemapValidPaths()
{
$path = Mage::getStoreConfig(self::XML_PATH_SITEMAP_VALID_PATHS);
/** @var $helper Mage_Core_Helper_Data */
/** @var Mage_Core_Helper_Data $helper */
$helper = Mage::helper('core');
$path = array_merge($path, $helper->getPublicFilesValidPath());
return $path;
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Model/Config/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public function save()
$backendClass = 'core/config_data';
}

/** @var $dataObject Mage_Core_Model_Config_Data */
/** @var Mage_Core_Model_Config_Data $dataObject */
$dataObject = Mage::getModel($backendClass);
if (!$dataObject instanceof Mage_Core_Model_Config_Data) {
Mage::throwException('Invalid config field backend model: '.$backendClass);
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Adminhtml/Model/Email/PathValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function isValid($value)
*/
protected function isEncryptedNodePath($path)
{
/** @var $configModel Mage_Adminhtml_Model_Config */
/** @var Mage_Adminhtml_Model_Config $configModel */
$configModel = Mage::getSingleton('adminhtml/config');

return in_array((string)$path, $configModel->getEncryptedNodeEntriesPaths());
Expand Down
16 changes: 8 additions & 8 deletions app/code/core/Mage/Adminhtml/Model/Sales/Order/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -1378,15 +1378,15 @@ protected function _setCustomerData(Mage_Customer_Model_Customer $customer)
*/
public function _prepareCustomer()
{
/** @var $quote Mage_Sales_Model_Quote */
/** @var Mage_Sales_Model_Quote $quote */
$quote = $this->getQuote();
if ($quote->getCustomerIsGuest()) {
return $this;
}

/** @var $customer Mage_Customer_Model_Customer */
/** @var Mage_Customer_Model_Customer $customer */
$customer = $this->getSession()->getCustomer();
/** @var $store Mage_Core_Model_Store */
/** @var Mage_Core_Model_Store $store */
$store = $this->getSession()->getStore();

$customerIsInStore = $this->_customerIsInStore($store);
Expand All @@ -1405,7 +1405,7 @@ public function _prepareCustomer()
}

if ($this->getBillingAddress()->getSaveInAddressBook()) {
/** @var $customerBillingAddress Mage_Customer_Model_Address */
/** @var Mage_Customer_Model_Address $customerBillingAddress */
$customerBillingAddress = $this->getBillingAddress()->exportCustomerAddress();
$customerAddressId = $this->getBillingAddress()->getCustomerAddressId();
if ($customerAddressId && $customer->getId()) {
Expand All @@ -1416,7 +1416,7 @@ public function _prepareCustomer()
}

if (!$this->getQuote()->isVirtual() && $this->getShippingAddress()->getSaveInAddressBook()) {
/** @var $customerShippingAddress Mage_Customer_Model_Address */
/** @var Mage_Customer_Model_Address $customerShippingAddress */
$customerShippingAddress = $this->getShippingAddress()->exportCustomerAddress();
$customerAddressId = $this->getShippingAddress()->getCustomerAddressId();
if ($customerAddressId && $customer->getId()) {
Expand Down Expand Up @@ -1444,7 +1444,7 @@ public function _prepareCustomer()
}
} else {
// Prepare new customer
/** @var $customerBillingAddress Mage_Customer_Model_Address */
/** @var Mage_Customer_Model_Address $customerBillingAddress */
$customerBillingAddress = $this->getBillingAddress()->exportCustomerAddress();
$customer->addData($customerBillingAddress->getData())
->setPassword($customer->generatePassword())
Expand All @@ -1457,13 +1457,13 @@ public function _prepareCustomer()
$customer->addAddress($customerBillingAddress);
}

/** @var $shippingAddress Mage_Sales_Model_Quote_Address */
/** @var Mage_Sales_Model_Quote_Address $shippingAddress */
$shippingAddress = $this->getShippingAddress();
if (!$this->getQuote()->isVirtual()
&& !$shippingAddress->getSameAsBilling()
&& $shippingAddress->getSaveInAddressBook()
) {
/** @var $customerShippingAddress Mage_Customer_Model_Address */
/** @var Mage_Customer_Model_Address $customerShippingAddress */
$customerShippingAddress = $shippingAddress->exportCustomerAddress();
$customerShippingAddress->setIsDefaultShipping(true);
$customer->addAddress($customerShippingAddress);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function afterCustomUrlChanged($observer)
return;
}

/** @var $adminSession Mage_Admin_Model_Session */
/** @var Mage_Admin_Model_Session $adminSession */
$adminSession = Mage::getSingleton('admin/session');
$adminSession->unsetAll();
$adminSession->getCookie()->delete($adminSession->getSessionName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ protected function _getUploadDir()
/**
* Return the root part of directory path for uploading
*
* @var string
* @param string $token
* @return string
*/
protected function _getUploadRoot($token)
Expand Down
Loading