Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
sreichel committed Sep 19, 2024
1 parent a7f4fbe commit 693a02e
Show file tree
Hide file tree
Showing 15 changed files with 7 additions and 43 deletions.
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ public function getStockItem()
*/
public function hasStockItem()
{
return !!$this->_stockItem;
return (bool) $this->_stockItem;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion app/code/core/Mage/Catalog/Model/Product/Type/Abstract.php
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,7 @@ public function checkProductBuyState($product = null)
if ($option->getIsRequire()) {
$customOption = $this->getProduct($product)
->getCustomOption(self::OPTION_PREFIX . $option->getId());
if (!$customOption || $customOption->getValue() === null || strlen($customOption->getValue()) === 0) {
if (!$customOption || $customOption->getValue() === null || (string) $customOption->getValue() === '') {
$this->getProduct($product)->setSkipCheckRequiredOption(true);
Mage::throwException(
Mage::helper('catalog')->__('The product has required options')
Expand Down
5 changes: 0 additions & 5 deletions app/code/core/Mage/Cms/Model/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ public function checkIdentifier($identifier, $storeId)

/**
* Retrieves cms page title from DB by passed identifier.
*
* @param string $identifier
* @return string
*/
public function getCmsPageTitleByIdentifier(string $identifier): string
{
Expand All @@ -139,7 +136,6 @@ public function getCmsPageTitleByIdentifier(string $identifier): string
* Retrieves cms page title from DB by passed id.
*
* @param string|int $id
* @return string
*/
public function getCmsPageTitleById($id): string
{
Expand All @@ -150,7 +146,6 @@ public function getCmsPageTitleById($id): string
* Retrieves cms page identifier from DB by passed id.
*
* @param string|int $id
* @return string
*/
public function getCmsPageIdentifierById($id): string
{
Expand Down
10 changes: 5 additions & 5 deletions app/code/core/Mage/GoogleAnalytics/Block/Ga.php
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ protected function _getEnhancedEcommerceDataForAnalytics4()
if ($productViewed->getAttributeText('manufacturer')) {
$_item['item_brand'] = $productViewed->getAttributeText('manufacturer');
}
array_push($eventData['items'], $_item);
$eventData['items'][] = $_item;
$result[] = ['view_item', $eventData];
} elseif ($moduleName == 'catalog' && $controllerName == 'category') {
// Log this event when the user has been presented with a list of items of a certain category.
Expand Down Expand Up @@ -241,7 +241,7 @@ protected function _getEnhancedEcommerceDataForAnalytics4()
if ($productViewed->getCategory()->getName()) {
$_item['item_category'] = $productViewed->getCategory()->getName();
}
array_push($eventData['items'], $_item);
$eventData['items'][] = $_item;
$index++;
$eventData['value'] += $productViewed->getFinalPrice();
}
Expand Down Expand Up @@ -274,7 +274,7 @@ protected function _getEnhancedEcommerceDataForAnalytics4()
if ($itemCategory) {
$_item['item_category'] = $itemCategory;
}
array_push($eventData['items'], $_item);
$eventData['items'][] = $_item;
$eventData['value'] += $_product->getFinalPrice() * $productInCart->getQty();
}
$eventData['value'] = $helper->formatPrice($eventData['value']);
Expand Down Expand Up @@ -306,7 +306,7 @@ protected function _getEnhancedEcommerceDataForAnalytics4()
if ($itemCategory) {
$_item['item_category'] = $itemCategory;
}
array_push($eventData['items'], $_item);
$eventData['items'][] = $_item;
$eventData['value'] += $_product->getFinalPrice();
}
$eventData['value'] = $helper->formatPrice($eventData['value']);
Expand Down Expand Up @@ -352,7 +352,7 @@ protected function _getEnhancedEcommerceDataForAnalytics4()
if ($itemCategory) {
$_item['item_category'] = $itemCategory;
}
array_push($orderData['items'], $_item);
$orderData['items'][] = $_item;
}
$result[] = ['purchase', $orderData];
}
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/AdminNotification/Model/FeedTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

class FeedTest extends TestCase
{
/**
* @var Mage_AdminNotification_Model_Feed
*/
public Mage_AdminNotification_Model_Feed $subject;

public function setUp(): void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ public function setUp(): void
}

/**
* @return void
*
* @group Mage_Adminhtml
* @group Mage_Adminhtml_Block
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Cms/Block/Widget/BlockTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

class BlockTest extends TestCase
{
/**
* @var Mage_Cms_Block_Widget_Block
*/
public Mage_Cms_Block_Widget_Block $subject;

public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Cms/Block/Widget/Page/LinkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

class LinkTest extends TestCase
{
/**
* @var Mage_Cms_Block_Widget_Page_Link
*/
public Mage_Cms_Block_Widget_Page_Link $subject;

public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Cms/Helper/Wysiwyg/ImagesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ class ImagesTest extends TestCase
{
public const TEST_STRING = '0123456789';

/**
* @var Mage_Cms_Helper_Wysiwyg_Images
*/
public Mage_Cms_Helper_Wysiwyg_Images $subject;

public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Cms/Model/PageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

class PageTest extends TestCase
{
/**
* @var Mage_Cms_Model_Page
*/
public Mage_Cms_Model_Page $subject;

public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Cms/Model/Wysiwyg/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@ class ConfigTest extends TestCase
{
public const TEST_STRING = '0123456789';

/**
* @var Mage_Cms_Model_Wysiwyg_Config
*/
public Mage_Cms_Model_Wysiwyg_Config $subject;

public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Cms/Model/Wysiwyg/Images/StorageTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ class StorageTest extends TestCase
{
public const TEST_STRING = '0123456789';

/**
* @var Mage_Cms_Model_Wysiwyg_Images_Storage
*/
public Mage_Cms_Model_Wysiwyg_Images_Storage $subject;

public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Customer/Model/CustomerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@

class CustomerTest extends TestCase
{
/**
* @var Mage_Customer_Model_Customer
*/
public Mage_Customer_Model_Customer $subject;

public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Log/Model/AggregationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

class AggregationTest extends TestCase
{
/**
* @var Mage_Log_Model_Aggregation
*/
public Mage_Log_Model_Aggregation $subject;

public function setUp(): void
Expand Down
3 changes: 0 additions & 3 deletions tests/unit/Mage/Log/Model/CustomerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@

class CustomerTest extends TestCase
{
/**
* @var Mage_Log_Model_Customer
*/
public Mage_Log_Model_Customer $subject;

public function setUp(): void
Expand Down

0 comments on commit 693a02e

Please sign in to comment.