Skip to content

Commit 51e42bb

Browse files
author
chorgues
committed
Cleanup usage of "new" and unused "use"
1 parent db2cde9 commit 51e42bb

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Plugin/Magento/Framework/App/AreaList.php

+10-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99
namespace Magento\UpwardConnector\Plugin\Magento\Framework\App;
1010

1111
use Magento\Framework\App\Config\ScopeConfigInterface;
12+
use Magento\Framework\App\Request\Http as Request;
1213
use Magento\Framework\App\ObjectManager;
1314
use Magento\Store\Model\ScopeInterface;
14-
use Magento\Upward\Resolver\Proxy;
1515
use Magento\UpwardConnector\Api\UpwardPathManagerInterface;
1616

1717
class AreaList
@@ -20,6 +20,11 @@ class AreaList
2020

2121
public const UPWARD_ENV_HEADER = 'UPWARD_PHP_PROXY_HEADER';
2222

23+
/**
24+
* @var \Magento\Framework\App\Request\Http
25+
*/
26+
private $request;
27+
2328
/**
2429
* @var ScopeConfigInterface
2530
*/
@@ -36,13 +41,16 @@ class AreaList
3641
const UPWARD_CONFIG_PATH_FRONT_NAMES_TO_SKIP = 'web/upward/front_names_to_skip';
3742

3843
/**
44+
* @param Request $httpRequest
3945
* @param \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig
4046
* @param \Magento\UpwardConnector\Api\UpwardPathManagerInterface|null $pathManager
4147
*/
4248
public function __construct(
49+
Request $httpRequest,
4350
ScopeConfigInterface $scopeConfig,
4451
?UpwardPathManagerInterface $pathManager = null
4552
) {
53+
$this->request = $httpRequest;
4654
$this->scopeConfig = $scopeConfig;
4755
$this->pathManager = $pathManager ?: ObjectManager::getInstance()->get(UpwardPathManagerInterface::class);
4856
}
@@ -78,11 +86,10 @@ public function afterGetCodeByFrontName(
7886
) ?? ''
7987
);
8088

81-
$request = new \Laminas\Http\PhpEnvironment\Request();
8289
$upwardProxyEnv = getenv(self::UPWARD_ENV_HEADER);
8390

8491
/** $upwardProxyEnv needs to be truthy because getenv returns "false" if it didn't find it */
85-
if ($upwardProxyEnv && $request->getHeader(self::UPWARD_HEADER) === $upwardProxyEnv) {
92+
if ($upwardProxyEnv && $this->request->getHeader(self::UPWARD_HEADER) === $upwardProxyEnv) {
8693
return $result;
8794
}
8895

0 commit comments

Comments
 (0)