Skip to content

Commit b2951aa

Browse files
committed
Merge remote-tracking branch 'origin/MC-33007' into 2.3-develop-pr43
2 parents c695a36 + ae07dc8 commit b2951aa

File tree

5 files changed

+11
-15
lines changed

5 files changed

+11
-15
lines changed

dev/tests/integration/testsuite/Magento/Developer/Model/Logger/Handler/DebugTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ public function testDebugInDeveloperMode()
139139
{
140140
$message = 'test message';
141141
$this->reinitDebugHandler(State::MODE_DEVELOPER);
142-
142+
$this->deploymentConfig->resetData();
143143
$this->removeDebugLog();
144144
$this->logger->debug($message);
145145
$this->assertFileExists($this->getDebuggerLogPath());

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,6 @@ public function get($key = null, $defaultValue = null)
8686
*/
8787
public function isAvailable()
8888
{
89-
$this->data = null;
9089
$this->load();
9190
return isset($this->flatData[ConfigOptionsListConstants::CONFIG_PATH_INSTALL_DATE]);
9291
}
@@ -141,7 +140,7 @@ public function isDbAvailable()
141140
*/
142141
private function load()
143142
{
144-
if (null === $this->data) {
143+
if (empty($this->data)) {
145144
$this->data = $this->reader->load();
146145
if ($this->overrideData) {
147146
$this->data = array_replace($this->data, $this->overrideData);
@@ -173,10 +172,12 @@ private function flattenParams(array $params, $path = null)
173172
$newPath = $key;
174173
}
175174
if (isset($cache[$newPath])) {
175+
//phpcs:ignore Magento2.Exceptions.DirectThrow
176176
throw new \Exception("Key collision {$newPath} is already defined.");
177177
}
178178
$cache[$newPath] = $param;
179179
if (is_array($param)) {
180+
//phpcs:ignore Magento2.Performance.ForeachArrayMerge
180181
$cache = array_merge($cache, $this->flattenParams($param, $newPath));
181182
}
182183
}

lib/internal/Magento/Framework/Locale/Resolver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
class Resolver implements ResolverInterface
1616
{
1717
/**
18-
* Default locale
18+
* Resolver default locale
1919
*/
2020
const DEFAULT_LOCALE = 'en_US';
2121

@@ -79,7 +79,7 @@ public function __construct(
7979
$this->scopeConfig = $scopeConfig;
8080
$this->defaultLocalePath = $defaultLocalePath;
8181
$this->scopeType = $scopeType;
82-
$this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->create(DeploymentConfig::class);
82+
$this->deploymentConfig = $deploymentConfig ?: ObjectManager::getInstance()->get(DeploymentConfig::class);
8383
$this->setLocale($locale);
8484
}
8585

lib/internal/Magento/Framework/Module/ModuleList.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function __construct(DeploymentConfig $config, ModuleList\Loader $loader)
5959
}
6060

6161
/**
62-
* {@inheritdoc}
62+
* @inheritdoc
6363
*
6464
* Note that this triggers loading definitions of all existing modules in the system.
6565
* Use this method only when you actually need modules' declared meta-information.
@@ -84,7 +84,8 @@ public function getAll()
8484
}
8585

8686
/**
87-
* {@inheritdoc}
87+
* @inheritdoc
88+
*
8889
* @see has()
8990
*/
9091
public function getOne($name)
@@ -94,7 +95,7 @@ public function getOne($name)
9495
}
9596

9697
/**
97-
* {@inheritdoc}
98+
* @inheritdoc
9899
*/
99100
public function getNames()
100101
{
@@ -107,7 +108,7 @@ public function getNames()
107108
}
108109

109110
/**
110-
* {@inheritdoc}
111+
* @inheritdoc
111112
*/
112113
public function has($name)
113114
{
@@ -139,7 +140,6 @@ public function isModuleInfoAvailable()
139140
*/
140141
private function loadConfigData()
141142
{
142-
$this->config->resetData();
143143
if (null === $this->configData && null !== $this->config->get(ConfigOptionsListConstants::KEY_MODULES)) {
144144
$this->configData = $this->config->get(ConfigOptionsListConstants::KEY_MODULES);
145145
}

lib/internal/Magento/Framework/Module/Test/Unit/ModuleListTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ protected function setUp()
4747

4848
public function testGetAll()
4949
{
50-
$this->config->expects($this->exactly(2))->method('resetData');
5150
$this->setLoadAllExpectation();
5251
$this->setLoadConfigExpectation();
5352
$expected = ['foo' => self::$allFixture['foo']];
@@ -65,7 +64,6 @@ public function testGetAllNoData()
6564

6665
public function testGetOne()
6766
{
68-
$this->config->expects($this->exactly(2))->method('resetData');
6967
$this->setLoadAllExpectation();
7068
$this->setLoadConfigExpectation();
7169
$this->assertSame(['key' => 'value'], $this->model->getOne('foo'));
@@ -74,7 +72,6 @@ public function testGetOne()
7472

7573
public function testGetNames()
7674
{
77-
$this->config->expects($this->exactly(2))->method('resetData');
7875
$this->setLoadAllExpectation(false);
7976
$this->setLoadConfigExpectation();
8077
$this->assertSame(['foo'], $this->model->getNames());
@@ -83,7 +80,6 @@ public function testGetNames()
8380

8481
public function testHas()
8582
{
86-
$this->config->expects($this->exactly(2))->method('resetData');
8783
$this->setLoadAllExpectation(false);
8884
$this->setLoadConfigExpectation();
8985
$this->assertTrue($this->model->has('foo'));
@@ -92,7 +88,6 @@ public function testHas()
9288

9389
public function testIsModuleInfoAvailable()
9490
{
95-
$this->config->expects($this->once())->method('resetData');
9691
$this->setLoadConfigExpectation(true);
9792
$this->assertTrue($this->model->isModuleInfoAvailable());
9893
}

0 commit comments

Comments
 (0)