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
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public function getStoreSwitcherHtml()
public function getLoadTreeUrl($expanded = null)
{
$params = ['_current' => true, 'id' => null, 'store' => null];
if (is_null($expanded) && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
if ($expanded === null && $this->_backendSession->getIsTreeWasExpanded() || $expanded == true) {
$params['expand_all'] = true;
}
return $this->getUrl('*/*/categoriesJson', $params);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,9 @@ public function getOptionValues()
$value['checkboxScopeTitle'] = $this->getCheckboxScopeHtml(
$option->getOptionId(),
'title',
is_null($option->getStoreTitle())
$option->getStoreTitle() === null
);
$value['scopeTitleDisabled'] = is_null($option->getStoreTitle()) ? 'disabled' : null;
$value['scopeTitleDisabled'] = $option->getStoreTitle() === null ? 'disabled' : null;
}

if ($option->getGroupByType() == ProductCustomOptionInterface::OPTION_GROUP_SELECT) {
Expand All @@ -341,22 +341,22 @@ public function getOptionValues()
$value['optionValues'][$i]['checkboxScopeTitle'] = $this->getCheckboxScopeHtml(
$_value->getOptionId(),
'title',
is_null($_value->getStoreTitle()),
$_value->getStoreTitle() === null,
$_value->getOptionTypeId()
);
$value['optionValues'][$i]['scopeTitleDisabled'] = is_null(
$_value->getStoreTitle()
$value['optionValues'][$i]['scopeTitleDisabled'] = (
$_value->getStoreTitle() === null
) ? 'disabled' : null;
if ($scope == \Magento\Store\Model\Store::PRICE_SCOPE_WEBSITE) {
$value['optionValues'][$i]['checkboxScopePrice'] = $this->getCheckboxScopeHtml(
$_value->getOptionId(),
'price',
is_null($_value->getstorePrice()),
$_value->getstorePrice() === null,
$_value->getOptionTypeId(),
['$(this).up(1).previous()']
);
$value['optionValues'][$i]['scopePriceDisabled'] = is_null(
$_value->getStorePrice()
$value['optionValues'][$i]['scopePriceDisabled'] = (
$_value->getStorePrice() === null
) ? 'disabled' : null;
}
}
Expand All @@ -379,9 +379,9 @@ public function getOptionValues()
$value['checkboxScopePrice'] = $this->getCheckboxScopeHtml(
$option->getOptionId(),
'price',
is_null($option->getStorePrice())
$option->getStorePrice() === null
);
$value['scopePriceDisabled'] = is_null($option->getStorePrice()) ? 'disabled' : null;
$value['scopePriceDisabled'] = $option->getStorePrice() === null ? 'disabled' : null;
}
}
$values[] = new \Magento\Framework\DataObject($value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public function getItems()
* getIdentities() depends on _itemCollection populated, but it can be empty if the block is hidden
* @see https://github.com/magento/magento2/issues/5897
*/
if (is_null($this->_itemCollection)) {
if ($this->_itemCollection === null) {
$this->_prepareData();
}
return $this->_itemCollection;
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ public function getItemCollection()
* getIdentities() depends on _itemCollection populated, but it can be empty if the block is hidden
* @see https://github.com/magento/magento2/issues/5897
*/
if (is_null($this->_itemCollection)) {
if ($this->_itemCollection === null) {
$this->_prepareData();
}
return $this->_itemCollection;
Expand All @@ -151,7 +151,7 @@ public function getItemCollection()
*/
public function getItems()
{
if (is_null($this->_items)) {
if ($this->_items === null) {
$this->_items = $this->getItemCollection()->getItems();
}
return $this->_items;
Expand Down
6 changes: 3 additions & 3 deletions app/code/Magento/Catalog/Model/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ public function getSourceOptionId($source, $value)
*/
public function getProductAttributes()
{
if (is_null($this->_productAttributes)) {
if ($this->_productAttributes === null) {
$this->_productAttributes = array_keys($this->getAttributesUsedInProductListing());
}
return $this->_productAttributes;
Expand All @@ -430,7 +430,7 @@ protected function _getResource()
*/
public function getAttributesUsedInProductListing()
{
if (is_null($this->_usedInProductListing)) {
if ($this->_usedInProductListing === null) {
$this->_usedInProductListing = [];
$entityType = \Magento\Catalog\Model\Product::ENTITY;
$attributesData = $this->_getResource()->setStoreId($this->getStoreId())->getAttributesUsedInListing();
Expand All @@ -453,7 +453,7 @@ public function getAttributesUsedInProductListing()
*/
public function getAttributesUsedForSortBy()
{
if (is_null($this->_usedForSortBy)) {
if ($this->_usedForSortBy === null) {
$this->_usedForSortBy = [];
$entityType = \Magento\Catalog\Model\Product::ENTITY;
$attributesData = $this->_getResource()->getAttributesUsedForSortBy();
Expand Down
4 changes: 2 additions & 2 deletions app/code/Magento/Catalog/Model/Layer/Filter/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function apply(\Magento\Framework\App\RequestInterface $request)
public function getCustomerGroupId()
{
$customerGroupId = $this->_getData('customer_group_id');
if (is_null($customerGroupId)) {
if ($customerGroupId === null) {
$customerGroupId = $this->_customerSession->getCustomerGroupId();
}

Expand All @@ -176,7 +176,7 @@ public function setCustomerGroupId($customerGroupId)
public function getCurrencyRate()
{
$rate = $this->_getData('currency_rate');
if (is_null($rate)) {
if ($rate === null) {
$rate = $this->_storeManager->getStore($this->getStoreId())
->getCurrentCurrencyRate();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ public function __construct(
*/
protected function _getWebsiteCurrencyRates()
{
if (is_null($this->_rates)) {
if ($this->_rates === null) {
$this->_rates = [];
$baseCurrency = $this->_config->getValue(
\Magento\Directory\Model\Currency::XML_PATH_CURRENCY_BASE,
Expand Down
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Model/Product/Option/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public function setProduct($product)
*/
public function getProduct()
{
if (is_null($this->_product)) {
if ($this->_product === null) {
$this->_product = $this->getOption()->getProduct();
}
return $this->_product;
Expand Down
20 changes: 10 additions & 10 deletions app/code/Magento/Catalog/Model/ResourceModel/Product/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -1092,7 +1092,7 @@ public function getSelectCountSql()
protected function _getSelectCountSql($select = null, $resetLeftJoins = true)
{
$this->_renderFilters();
$countSelect = is_null($select) ? $this->_getClearSelect() : $this->_buildClearSelect($select);
$countSelect = $select === null ? $this->_getClearSelect() : $this->_buildClearSelect($select);
$countSelect->columns('COUNT(DISTINCT e.entity_id)');
if ($resetLeftJoins) {
$countSelect->resetJoinLeft();
Expand Down Expand Up @@ -1435,7 +1435,7 @@ public function getAllIdsCache($resetCache = false)
$ids = $this->_allIdsCache;
}

if (is_null($ids)) {
if ($ids === null) {
$ids = $this->getAllIds();
$this->setAllIdsCache($ids);
}
Expand Down Expand Up @@ -1466,17 +1466,17 @@ public function addPriceData($customerGroupId = null, $websiteId = null)
{
$this->_productLimitationFilters->setUsePriceIndex(true);

if (!isset($this->_productLimitationFilters['customer_group_id']) && is_null($customerGroupId)) {
if (!isset($this->_productLimitationFilters['customer_group_id']) && $customerGroupId === null) {
$customerGroupId = $this->_customerSession->getCustomerGroupId();
}
if (!isset($this->_productLimitationFilters['website_id']) && is_null($websiteId)) {
if (!isset($this->_productLimitationFilters['website_id']) && $websiteId === null) {
$websiteId = $this->_storeManager->getStore($this->getStoreId())->getWebsiteId();
}

if (!is_null($customerGroupId)) {
if ($customerGroupId !== null) {
$this->_productLimitationFilters['customer_group_id'] = $customerGroupId;
}
if (!is_null($websiteId)) {
if ($websiteId !== null) {
$this->_productLimitationFilters['website_id'] = $websiteId;
}

Expand Down Expand Up @@ -2347,7 +2347,7 @@ public function setOrder($attribute, $dir = Select::SQL_DESC)
*/
public function getMaxPrice()
{
if (is_null($this->_maxPrice)) {
if ($this->_maxPrice === null) {
$this->_prepareStatisticsData();
}

Expand All @@ -2361,7 +2361,7 @@ public function getMaxPrice()
*/
public function getMinPrice()
{
if (is_null($this->_minPrice)) {
if ($this->_minPrice === null) {
$this->_prepareStatisticsData();
}

Expand All @@ -2375,7 +2375,7 @@ public function getMinPrice()
*/
public function getPriceStandardDeviation()
{
if (is_null($this->_priceStandardDeviation)) {
if ($this->_priceStandardDeviation === null) {
$this->_prepareStatisticsData();
}

Expand All @@ -2389,7 +2389,7 @@ public function getPriceStandardDeviation()
*/
public function getPricesCount()
{
if (is_null($this->_pricesCount)) {
if ($this->_pricesCount === null) {
$this->_prepareStatisticsData();
}

Expand Down