Skip to content

Commit e0075aa

Browse files
#22891: Static tests fix.
1 parent 9d39fa2 commit e0075aa

File tree

2 files changed

+21
-14
lines changed

2 files changed

+21
-14
lines changed

app/code/Magento/Config/Model/Config/Reader/Source/Deployed/SettingChecker.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,11 @@
55
*/
66
namespace Magento\Config\Model\Config\Reader\Source\Deployed;
77

8-
use Magento\Config\Model\Config\Reader;
9-
use Magento\Framework\App\Config\ScopeConfigInterface;
10-
use Magento\Framework\App\DeploymentConfig;
11-
use Magento\Config\Model\Placeholder\PlaceholderInterface;
128
use Magento\Config\Model\Placeholder\PlaceholderFactory;
9+
use Magento\Config\Model\Placeholder\PlaceholderInterface;
1310
use Magento\Framework\App\Config\ScopeCodeResolver;
11+
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
use Magento\Framework\App\DeploymentConfig;
1413

1514
/**
1615
* Class for checking settings that defined in config file
@@ -65,13 +64,13 @@ public function isReadOnly($path, $scope, $scopeCode = null)
6564
);
6665

6766
if (null === $config) {
68-
$config = $this->config->get(
69-
$this->resolvePath(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null) . "/" . $path
70-
);
67+
$config = $this->config->get($this->resolvePath($scope, $scopeCode) . "/" . $path);
7168
}
7269

7370
if (null === $config) {
74-
$config = $this->config->get($this->resolvePath($scope, $scopeCode) . "/" . $path);
71+
$config = $this->config->get(
72+
$this->resolvePath(ScopeConfigInterface::SCOPE_TYPE_DEFAULT, null) . "/" . $path
73+
);
7574
}
7675

7776
return $config !== null;
@@ -84,7 +83,6 @@ public function isReadOnly($path, $scope, $scopeCode = null)
8483
*
8584
* @param string $path
8685
* @param string $scope
87-
* @param string $scopeCode
8886
* @param string|null $scopeCode
8987
* @return string|null
9088
* @since 100.1.2
@@ -103,9 +101,11 @@ public function getPlaceholderValue($path, $scope, $scopeCode = null)
103101
*/
104102
public function getEnvValue($placeholder)
105103
{
104+
// phpcs:disable Magento2.Security.Superglobal
106105
if ($this->placeholder->isApplicable($placeholder) && isset($_ENV[$placeholder])) {
107106
return $_ENV[$placeholder];
108107
}
108+
// phpcs:enable
109109

110110
return null;
111111
}

app/code/Magento/Config/Test/Unit/Model/Config/Reader/Source/Deployed/SettingCheckerTest.php

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
67
namespace Magento\Config\Test\Unit\Model\Config\Reader\Source\Deployed;
78

8-
use Magento\Config\Model\Config\Reader;
99
use Magento\Config\Model\Config\Reader\Source\Deployed\SettingChecker;
10+
use Magento\Config\Model\Placeholder\PlaceholderFactory;
11+
use Magento\Config\Model\Placeholder\PlaceholderInterface;
1012
use Magento\Framework\App\Config;
1113
use Magento\Framework\App\DeploymentConfig;
12-
use Magento\Config\Model\Placeholder\PlaceholderInterface;
13-
use Magento\Config\Model\Placeholder\PlaceholderFactory;
1414

1515
/**
1616
* Test class for checking settings that defined in config file
@@ -75,8 +75,15 @@ public function setUp()
7575
* @param bool $expectedResult
7676
* @dataProvider isReadonlyDataProvider
7777
*/
78-
public function testIsReadonly($path, $scope, $scopeCode, $confValue, array $variables, array $configMap, $expectedResult)
79-
{
78+
public function testIsReadonly(
79+
$path,
80+
$scope,
81+
$scopeCode,
82+
$confValue,
83+
array $variables,
84+
array $configMap,
85+
$expectedResult
86+
) {
8087
$this->placeholderMock->expects($this->any())
8188
->method('isApplicable')
8289
->willReturn(true);

0 commit comments

Comments
 (0)