Skip to content

Commit e4c9861

Browse files
committed
Replace 'static::' with 'self::' when accessing private const.
This will prevent 'Undefined class constant' error if a plugin will be added for one of these classes.
1 parent 632a7c6 commit e4c9861

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

app/code/Magento/Backend/Model/Dashboard/Period.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,11 @@ public function getDatePeriods(): array
4646
public function getPeriodChartUnits(): array
4747
{
4848
return [
49-
static::PERIOD_24_HOURS => static::PERIOD_UNIT_HOUR,
50-
static::PERIOD_7_DAYS => static::PERIOD_UNIT_DAY,
51-
static::PERIOD_1_MONTH => static::PERIOD_UNIT_DAY,
52-
static::PERIOD_1_YEAR => static::PERIOD_UNIT_MONTH,
53-
static::PERIOD_2_YEARS => static::PERIOD_UNIT_MONTH
49+
static::PERIOD_24_HOURS => self::PERIOD_UNIT_HOUR,
50+
static::PERIOD_7_DAYS => self::PERIOD_UNIT_DAY,
51+
static::PERIOD_1_MONTH => self::PERIOD_UNIT_DAY,
52+
static::PERIOD_1_YEAR => self::PERIOD_UNIT_MONTH,
53+
static::PERIOD_2_YEARS => self::PERIOD_UNIT_MONTH
5454
];
5555
}
5656
}

app/code/Magento/Backend/ViewModel/ChartDisabled.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public function __construct(
5757
public function getConfigUrl(): string
5858
{
5959
return $this->urlBuilder->getUrl(
60-
static::ROUTE_SYSTEM_CONFIG,
60+
self::ROUTE_SYSTEM_CONFIG,
6161
['section' => 'admin', '_fragment' => 'admin_dashboard-link']
6262
);
6363
}
@@ -70,7 +70,7 @@ public function getConfigUrl(): string
7070
public function isChartEnabled(): bool
7171
{
7272
return $this->scopeConfig->isSetFlag(
73-
static::XML_PATH_ENABLE_CHARTS,
73+
self::XML_PATH_ENABLE_CHARTS,
7474
ScopeInterface::SCOPE_STORE
7575
);
7676
}

app/code/Magento/Catalog/Model/Config/LayerCategoryConfig.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ public function isCategoryFilterVisibleInLayerNavigation(
6060
}
6161

6262
return $this->scopeConfig->isSetFlag(
63-
static::XML_PATH_CATALOG_LAYERED_NAVIGATION_DISPLAY_CATEGORY,
63+
self::XML_PATH_CATALOG_LAYERED_NAVIGATION_DISPLAY_CATEGORY,
6464
$scopeType,
6565
$scopeCode
6666
);

app/code/Magento/DownloadableImportExport/Model/Import/Product/Type/Downloadable.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -370,12 +370,12 @@ protected function isRowValidSample(array $rowData)
370370

371371
foreach ($sampleData as $link) {
372372
if ($this->hasDomainNotInWhitelist($link, 'link_type', 'link_url')) {
373-
$this->_entityModel->addRowError(static::ERROR_LINK_URL_NOT_IN_DOMAIN_WHITELIST, $this->rowNum);
373+
$this->_entityModel->addRowError(self::ERROR_LINK_URL_NOT_IN_DOMAIN_WHITELIST, $this->rowNum);
374374
$result = true;
375375
}
376376

377377
if ($this->hasDomainNotInWhitelist($link, 'sample_type', 'sample_url')) {
378-
$this->_entityModel->addRowError(static::ERROR_SAMPLE_URL_NOT_IN_DOMAIN_WHITELIST, $this->rowNum);
378+
$this->_entityModel->addRowError(self::ERROR_SAMPLE_URL_NOT_IN_DOMAIN_WHITELIST, $this->rowNum);
379379
$result = true;
380380
}
381381
}
@@ -406,12 +406,12 @@ protected function isRowValidLink(array $rowData)
406406

407407
foreach ($linkData as $link) {
408408
if ($this->hasDomainNotInWhitelist($link, 'link_type', 'link_url')) {
409-
$this->_entityModel->addRowError(static::ERROR_LINK_URL_NOT_IN_DOMAIN_WHITELIST, $this->rowNum);
409+
$this->_entityModel->addRowError(self::ERROR_LINK_URL_NOT_IN_DOMAIN_WHITELIST, $this->rowNum);
410410
$result = true;
411411
}
412412

413413
if ($this->hasDomainNotInWhitelist($link, 'sample_type', 'sample_url')) {
414-
$this->_entityModel->addRowError(static::ERROR_SAMPLE_URL_NOT_IN_DOMAIN_WHITELIST, $this->rowNum);
414+
$this->_entityModel->addRowError(self::ERROR_SAMPLE_URL_NOT_IN_DOMAIN_WHITELIST, $this->rowNum);
415415
$result = true;
416416
}
417417
}

0 commit comments

Comments
 (0)