Skip to content

Commit b6025fc

Browse files
committed
Make required changes after cherry-picking commits over from the 2.2-develop branch to the 2.3-develop branch
1 parent eaeafea commit b6025fc

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

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

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66

77
namespace Magento\Customer\Model;
88

9-
use Magento\Framework\Indexer\StateInterface;
10-
119
/**
1210
* Class Visitor
1311
* @package Magento\Customer\Model
@@ -67,6 +65,11 @@ class Visitor extends \Magento\Framework\Model\AbstractModel
6765
*/
6866
protected $indexerRegistry;
6967

68+
/**
69+
* @var \Magento\Framework\App\RequestSafetyInterface
70+
*/
71+
private $requestSafety;
72+
7073
/**
7174
* @param \Magento\Framework\Model\Context $context
7275
* @param \Magento\Framework\Registry $registry
@@ -80,6 +83,7 @@ class Visitor extends \Magento\Framework\Model\AbstractModel
8083
* @param array $ignoredUserAgents
8184
* @param array $ignores
8285
* @param array $data
86+
* @param \Magento\Framework\App\RequestSafetyInterface|null $requestSafety
8387
*
8488
* @SuppressWarnings(PHPMD.ExcessiveParameterList)
8589
*/
@@ -95,7 +99,8 @@ public function __construct(
9599
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
96100
array $ignoredUserAgents = [],
97101
array $ignores = [],
98-
array $data = []
102+
array $data = [],
103+
\Magento\Framework\App\RequestSafetyInterface $requestSafety = null
99104
) {
100105
$this->session = $session;
101106
$this->httpHeader = $httpHeader;
@@ -105,6 +110,7 @@ public function __construct(
105110
$this->scopeConfig = $scopeConfig;
106111
$this->dateTime = $dateTime;
107112
$this->indexerRegistry = $indexerRegistry;
113+
$this->requestSafety = $requestSafety;
108114
}
109115

110116
/**
@@ -312,11 +318,9 @@ public function clean()
312318
*/
313319
public function getOnlineInterval()
314320
{
315-
$configValue = intval(
316-
$this->scopeConfig->getValue(
317-
static::XML_PATH_ONLINE_INTERVAL,
318-
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
319-
)
321+
$configValue = (int) $this->scopeConfig->getValue(
322+
static::XML_PATH_ONLINE_INTERVAL,
323+
\Magento\Store\Model\ScopeInterface::SCOPE_STORE
320324
);
321325
return $configValue ?: static::DEFAULT_ONLINE_MINUTES_INTERVAL;
322326
}
@@ -332,7 +336,7 @@ private function getRequest()
332336
{
333337
if (null === $this->requestSafety) {
334338
$this->requestSafety = \Magento\Framework\App\ObjectManager::getInstance()->create(
335-
\Magento\Framework\App\RequestInterface::class
339+
\Magento\Framework\App\RequestSafetyInterface::class
336340
);
337341
}
338342
return $this->requestSafety;

0 commit comments

Comments
 (0)