Skip to content

Commit e96697c

Browse files
MC-18527: Merge release branch into 2.3-develop
- minor code changes
1 parent 6b9339e commit e96697c

File tree

9 files changed

+40
-28
lines changed

9 files changed

+40
-28
lines changed

app/code/Magento/AdminAnalytics/Model/ResourceModel/Viewer/Logger.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
*/
1919
class Logger
2020
{
21+
/**
22+
* Admin Analytics usage version log table name
23+
*/
2124
const LOG_TABLE_NAME = 'admin_analytics_usage_version_log';
2225

2326
/**

app/code/Magento/CatalogRule/Controller/Adminhtml/Promo/Catalog/Save.php

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
use Magento\Framework\Registry;
1313
use Magento\Framework\Stdlib\DateTime\Filter\Date;
1414
use Magento\Framework\App\Request\DataPersistorInterface;
15-
use Magento\Framework\Stdlib\DateTime\TimezoneInterface;
1615

1716
/**
1817
* Save action for catalog rule
@@ -26,27 +25,19 @@ class Save extends \Magento\CatalogRule\Controller\Adminhtml\Promo\Catalog imple
2625
*/
2726
protected $dataPersistor;
2827

29-
/**
30-
* @var TimezoneInterface
31-
*/
32-
private $localeDate;
33-
3428
/**
3529
* @param Context $context
3630
* @param Registry $coreRegistry
3731
* @param Date $dateFilter
3832
* @param DataPersistorInterface $dataPersistor
39-
* @param TimezoneInterface $localeDate
4033
*/
4134
public function __construct(
4235
Context $context,
4336
Registry $coreRegistry,
4437
Date $dateFilter,
45-
DataPersistorInterface $dataPersistor,
46-
TimezoneInterface $localeDate
38+
DataPersistorInterface $dataPersistor
4739
) {
4840
$this->dataPersistor = $dataPersistor;
49-
$this->localeDate = $localeDate;
5041
parent::__construct($context, $coreRegistry, $dateFilter);
5142
}
5243

@@ -55,15 +46,16 @@ public function __construct(
5546
*
5647
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|void
5748
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
58-
* @SuppressWarnings(PHPMD.NPathComplexity)
5949
*/
6050
public function execute()
6151
{
6252
if ($this->getRequest()->getPostValue()) {
53+
6354
/** @var \Magento\CatalogRule\Api\CatalogRuleRepositoryInterface $ruleRepository */
6455
$ruleRepository = $this->_objectManager->get(
6556
\Magento\CatalogRule\Api\CatalogRuleRepositoryInterface::class
6657
);
58+
6759
/** @var \Magento\CatalogRule\Model\Rule $model */
6860
$model = $this->_objectManager->create(\Magento\CatalogRule\Model\Rule::class);
6961

@@ -73,9 +65,7 @@ public function execute()
7365
['request' => $this->getRequest()]
7466
);
7567
$data = $this->getRequest()->getPostValue();
76-
if (!$this->getRequest()->getParam('from_date')) {
77-
$data['from_date'] = $this->localeDate->formatDate();
78-
}
68+
7969
$filterValues = ['from_date' => $this->_dateFilter];
8070
if ($this->getRequest()->getParam('to_date')) {
8171
$filterValues['to_date'] = $this->_dateFilter;

app/code/Magento/CatalogRule/Model/Indexer/ReindexRuleProduct.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,7 @@ public function execute(Rule $rule, $batchCount, $useAdditionalTable = false)
101101
$scopeTz = new \DateTimeZone(
102102
$this->localeDate->getConfigTimezone(ScopeInterface::SCOPE_WEBSITE, $websiteId)
103103
);
104-
$fromTime = $rule->getFromDate()
105-
? (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp()
106-
: 0;
104+
$fromTime = (new \DateTime($rule->getFromDate(), $scopeTz))->getTimestamp();
107105
$toTime = $rule->getToDate()
108106
? (new \DateTime($rule->getToDate(), $scopeTz))->getTimestamp() + IndexBuilder::SECONDS_IN_DAY - 1
109107
: 0;

app/code/Magento/Customer/Model/Session.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,7 +441,7 @@ public function setCustomerAsLoggedIn($customer)
441441
}
442442

443443
/**
444-
* Sets customer data as logged in
444+
* Sets customer as logged in
445445
*
446446
* @param CustomerData $customer
447447
* @return $this
@@ -593,7 +593,7 @@ public function regenerateId()
593593
}
594594

595595
/**
596-
* Creates URL factory
596+
* Creates URL object
597597
*
598598
* @return \Magento\Framework\UrlInterface
599599
*/

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

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,34 @@
1515
/**
1616
* Class Downloadable
1717
*
18+
* phpcs:disable Magento2.Commenting.ConstantsPHPDocFormatting
1819
* @SuppressWarnings(PHPMD.TooManyFields)
1920
*/
2021
class Downloadable extends \Magento\CatalogImportExport\Model\Import\Product\Type\AbstractType
2122
{
23+
/**
24+
* Pair value separator.
25+
*/
2226
const PAIR_VALUE_SEPARATOR = '=';
2327

28+
/**
29+
* Default sort order
30+
*/
2431
const DEFAULT_SORT_ORDER = 0;
2532

33+
/**
34+
* Default number of downloads
35+
*/
2636
const DEFAULT_NUMBER_OF_DOWNLOADS = 0;
2737

38+
/**
39+
* Default is shareable
40+
*/
2841
const DEFAULT_IS_SHAREABLE = 2;
2942

43+
/**
44+
* Default website id
45+
*/
3046
const DEFAULT_WEBSITE_ID = 0;
3147

3248
/**
@@ -64,6 +80,9 @@ class Downloadable extends \Magento\CatalogImportExport\Model\Import\Product\Typ
6480
*/
6581
const COL_DOWNLOADABLE_LINKS = 'downloadable_links';
6682

83+
/**
84+
* Default group title
85+
*/
6786
const DEFAULT_GROUP_TITLE = '';
6887

6988
/**

app/code/Magento/ImportExport/Model/Import.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ class Import extends AbstractModel
107107
*/
108108
const DEFAULT_GLOBAL_MULTI_VALUE_SEPARATOR = ',';
109109

110+
/**
111+
* Import empty attribute default value
112+
*/
110113
const DEFAULT_EMPTY_ATTRIBUTE_VALUE_CONSTANT = '__EMPTY__VALUE__';
111114
const DEFAULT_SIZE = 50;
112115
const MAX_IMPORT_CHUNKS = 4;

dev/tests/integration/testsuite/Magento/Sales/_files/quotes.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
use Magento\Quote\Model\QuoteFactory;
99
use Magento\Quote\Model\QuoteRepository;
10+
use Magento\Store\Model\Store;
1011
use Magento\TestFramework\Helper\Bootstrap;
1112
use Magento\TestFramework\ObjectManager;
1213

@@ -18,13 +19,15 @@
1819
$quoteFactory = $objectManager->get(QuoteFactory::class);
1920
/** @var QuoteRepository $quoteRepository */
2021
$quoteRepository = $objectManager->get(QuoteRepository::class);
22+
/** @var Store $store */
23+
$store = $objectManager->get(Store::class);
2124

2225
$quotes = [
2326
'quote for first store' => [
24-
'store' => 1,
27+
'store' => $store->load('default', 'code')->getId(),
2528
],
2629
'quote for second store' => [
27-
'store' => $storeId,
30+
'store' => $store->load('test_second_store', 'code')->getId(),
2831
],
2932
];
3033

dev/tests/integration/testsuite/Magento/Store/_files/second_store.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88

99
/** @var \Magento\Store\Model\Store $store */
1010
$store = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create(\Magento\Store\Model\Store::class);
11-
$storeId = $store->load('fixture_second_store', 'code')->getId();
12-
if (!$storeId) {
11+
if (!$store->load('fixture_second_store', 'code')->getId()) {
1312
$websiteId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get(
1413
\Magento\Store\Model\StoreManagerInterface::class
1514
)->getWebsite()
@@ -31,6 +30,4 @@
3130
1
3231
);
3332
$store->save();
34-
35-
$storeId = $store->getId();
3633
}

lib/internal/Magento/Framework/App/ProductMetadata.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function __construct(
6767
CacheInterface $cache = null
6868
) {
6969
$this->composerJsonFinder = $composerJsonFinder;
70-
$this->cache = $cache ?? ObjectManager::getInstance()->get(CacheInterface::class);
70+
$this->cache = $cache ?: ObjectManager::getInstance()->get(CacheInterface::class);
7171
}
7272

7373
/**
@@ -77,8 +77,7 @@ public function __construct(
7777
*/
7878
public function getVersion()
7979
{
80-
$versionFromCache = $this->cache->load(self::VERSION_CACHE_KEY);
81-
$this->version = $this->version ?: $versionFromCache;
80+
$this->version = $this->version ?: $this->cache->load(self::VERSION_CACHE_KEY);
8281
if (!$this->version) {
8382
if (!($this->version = $this->getSystemPackageVersion())) {
8483
if ($this->getComposerInformation()->isMagentoRoot()) {

0 commit comments

Comments
 (0)