Skip to content
Merged
Show file tree
Hide file tree
Changes from 4 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
420 changes: 0 additions & 420 deletions .phpstan.dist.baseline.neon

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ public function setEntity(Varien_Object $entity)
public function getEntity()
{
if (is_null($this->_entity)) {
$this->setEntity(Mage::getModel('giftmessage/message')->getEntityModelByType('order'));
/** @var Mage_Sales_Model_Order $model */
$model = Mage::getModel('giftmessage/message')->getEntityModelByType('order');
$this->setEntity($model);
$this->getEntity()->load($this->getRequest()->getParam('entity'));
}

Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Bundle/Model/Product/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ public function getSelectionFinalPrice(
*
* @param Mage_Catalog_Model_Product $bundleProduct
* @param Mage_Catalog_Model_Product $selectionProduct
* @param float $bundleQty
* @param float|int $bundleQty
* @param null|float $selectionQty
* @param bool $multiplyQty
* @param bool $takeTierPrice
Expand Down
3 changes: 2 additions & 1 deletion app/code/core/Mage/Catalog/Block/Product/View/Attributes.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ public function getProduct()
* exclude them from additional data array
*
* @return array
* @throws Mage_Core_Model_Store_Exception
*/
public function getAdditionalData(array $excludeAttr = [])
{
Expand All @@ -48,7 +49,7 @@ public function getAdditionalData(array $excludeAttr = [])
} elseif (is_null($value) || $value === false || $value === '') {
$value = Mage::helper('catalog')->__('No');
} elseif ($attribute->getFrontendInput() == 'price' && is_string($value)) {
$value = Mage::app()->getStore()->convertPrice($value, true);
$value = Mage::app()->getStore()->convertPrice((float) $value, true);
}

if (is_string($value) && strlen($value)) {
Expand Down
9 changes: 6 additions & 3 deletions app/code/core/Mage/Catalog/Block/Widget/Link.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class Mage_Catalog_Block_Widget_Link extends Mage_Core_Block_Html_Link implement
* or return false if path was not found.
*
* @return false|string
* @throws Mage_Core_Exception
* @throws Mage_Core_Model_Store_Exception
*/
public function getHref()
{
Expand Down Expand Up @@ -89,6 +91,7 @@ public function getHref()
* If anchor text was not specified get entity name from DB.
*
* @return string
* @throws Mage_Core_Model_Store_Exception
*/
public function getAnchorText()
{
Expand All @@ -102,10 +105,10 @@ public function getAnchorText()
if (!$this->_getData('anchor_text')) {
$idPath = explode('/', $this->_getData('id_path'));
if (isset($idPath[1])) {
$id = $idPath[1];
if ($id) {
$entityId = $idPath[1];
if ($entityId) {
$this->_anchorText = $this->_entityResource
->getAttributeRawValue($id, 'name', $store);
->getAttributeRawValue((int) $entityId, 'name', $store);
}
}
} else {
Expand Down
10 changes: 8 additions & 2 deletions app/code/core/Mage/Catalog/Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ public function setStoreId($store)
* and creating array of categories|product paths for breadcrumbs
*
* @return array
* @throws Mage_Core_Exception
*/
public function getBreadcrumbPath()
{
Expand Down Expand Up @@ -118,8 +119,9 @@ public function getBreadcrumbPath()
/**
* Check is category link
*
* @param int $categoryId
* @param int|string $categoryId
* @return bool
* @throws Mage_Core_Exception
*/
protected function _isCategoryLink($categoryId)
{
Expand Down Expand Up @@ -158,6 +160,7 @@ public function getProduct()
* Retrieve Visitor/Customer Last Viewed URL
*
* @return string
* @throws Mage_Core_Exception
*/
public function getLastViewedUrl()
{
Expand Down Expand Up @@ -363,9 +366,11 @@ public function getMsrpExplanationMessageWhatsThis()
* in specific visibility
*
* @param int|Mage_Catalog_Model_Product $product
* @param int $visibility Check displaying price in concrete place (by default generally)
* @param Mage_Catalog_Model_Product_Attribute_Source_Msrp_Type::TYPE_* $visibility Check displaying price in concrete place (by default generally)
* @param bool $checkAssociatedItems
* @return bool
* @throws Mage_Core_Exception
* @throws Mage_Core_Model_Store_Exception
*/
public function canApplyMsrp($product, $visibility = null, $checkAssociatedItems = true)
{
Expand Down Expand Up @@ -419,6 +424,7 @@ public function canApplyMsrp($product, $visibility = null, $checkAssociatedItems
*
* @param Mage_Catalog_Model_Product $product
* @return bool
* @throws Mage_Core_Exception
*/
public function canApplyMsrpToProductType($product)
{
Expand Down
19 changes: 16 additions & 3 deletions app/code/core/Mage/Catalog/Helper/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ class Mage_Catalog_Helper_Product extends Mage_Core_Helper_Url
*
* @param int|Mage_Catalog_Model_Product|string $product
* @return false|string
* @throws Mage_Core_Exception
*/
public function getProductUrl($product)
{
Expand All @@ -62,9 +63,10 @@ public function getProductUrl($product)
/**
* Retrieve product view page url including provided category Id
*
* @param int $productId
* @param int $categoryId
* @param int|string $productId
* @param int|string $categoryId
* @return string
* @throws Mage_Core_Exception
*/
public function getFullProductUrl($productId, $categoryId = null)
{
Expand Down Expand Up @@ -104,6 +106,7 @@ public function getFinalPrice($product)
*
* @param Mage_Catalog_Model_Product $product
* @return string
* @throws Exception
*/
public function getImageUrl($product)
{
Expand All @@ -122,6 +125,8 @@ public function getImageUrl($product)
*
* @param Mage_Catalog_Model_Product $product
* @return string
* @throws Exception
* @throws Mage_Core_Exception
*/
public function getSmallImageUrl($product)
{
Expand All @@ -140,6 +145,8 @@ public function getSmallImageUrl($product)
*
* @param Mage_Catalog_Model_Product $product
* @return string
* @throws Exception
* @throws Mage_Core_Exception
*/
public function getThumbnailUrl($product)
{
Expand All @@ -156,6 +163,7 @@ public function getThumbnailUrl($product)
/**
* @param Mage_Catalog_Model_Product $product
* @return string
* @throws Mage_Core_Exception
*/
public function getEmailToFriendUrl($product)
{
Expand Down Expand Up @@ -188,6 +196,7 @@ public function getStatuses()
* @param int|Mage_Catalog_Model_Product $product
* @param string $where
* @return bool
* @throws Mage_Core_Exception
*/
public function canShow($product, $where = 'catalog')
{
Expand All @@ -196,7 +205,6 @@ public function canShow($product, $where = 'catalog')
}

/** @var Mage_Catalog_Model_Product $product */

if (!$product->getId()) {
return false;
}
Expand All @@ -209,6 +217,7 @@ public function canShow($product, $where = 'catalog')
*
* @param int $storeId
* @return string
* @throws Mage_Core_Model_Store_Exception
*/
public function getProductUrlSuffix($storeId = null)
{
Expand Down Expand Up @@ -308,6 +317,8 @@ public function getAttributeSourceModelByInputType($inputType)
* @param Varien_Object $params
*
* @return false|Mage_Catalog_Model_Product
* @throws Mage_Core_Exception
* @throws Mage_Core_Model_Store_Exception
*/
public function initProduct($productId, $controller, $params = null)
{
Expand Down Expand Up @@ -451,6 +462,8 @@ public function addParamsToBuyRequest($buyRequest, $params)
* @param null|int $store
* @param string $identifierType
* @return Mage_Catalog_Model_Product
* @throws Mage_Core_Exception
* @throws Mage_Core_Model_Store_Exception
*/
public function getProduct($productId, $store, $identifierType = null)
{
Expand Down
Loading
Loading