Skip to content

Commit f6ef5a8

Browse files
committed
33465 set getType method return type as int
1 parent 8192a2b commit f6ef5a8

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

app/code/Magento/PageCache/Model/App/CacheIdentifierPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function __construct(
4242
*/
4343
public function afterGetValue(\Magento\Framework\App\PageCache\Identifier $identifier, $result)
4444
{
45-
if ((int)$this->config->getType() === \Magento\PageCache\Model\Config::BUILT_IN && $this->config->isEnabled()) {
45+
if ($this->config->getType() === \Magento\PageCache\Model\Config::BUILT_IN && $this->config->isEnabled()) {
4646
$identifierPrefix = '';
4747

4848
$ruleDesignException = $this->designExceptions->getThemeByRequest($this->request);

app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function aroundDispatch(
6767
\Magento\Framework\App\RequestInterface $request
6868
) {
6969
$this->version->process();
70-
if (!$this->config->isEnabled() || (int)$this->config->getType() !== \Magento\PageCache\Model\Config::BUILT_IN) {
70+
if (!$this->config->isEnabled() || $this->config->getType() !== \Magento\PageCache\Model\Config::BUILT_IN) {
7171
return $proceed($request);
7272
}
7373
$result = $this->kernel->load();

app/code/Magento/PageCache/Model/App/FrontController/VarnishPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(Config $config, Version $version, AppState $state)
5656
*/
5757
public function afterDispatch(FrontControllerInterface $subject, $result)
5858
{
59-
if ((int)$this->config->getType() === Config::VARNISH && $this->config->isEnabled()
59+
if ($this->config->getType() === Config::VARNISH && $this->config->isEnabled()
6060
&& $result instanceof ResponseHttp
6161
) {
6262
$this->version->process();

app/code/Magento/PageCache/Model/Config.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ public function __construct(
116116
/**
117117
* Return currently selected cache type: built in or varnish
118118
*
119-
* @return int|string
119+
* @return int
120120
* @api
121121
*/
122122
public function getType()
123123
{
124-
return $this->_scopeConfig->getValue(self::XML_PAGECACHE_TYPE);
124+
return (int)$this->_scopeConfig->getValue(self::XML_PAGECACHE_TYPE);
125125
}
126126

127127
/**

app/code/Magento/PageCache/Model/Controller/Result/BuiltinPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public function afterRenderResult(ResultInterface $subject, ResultInterface $res
6969
{
7070
$usePlugin = $this->registry->registry('use_page_cache_plugin');
7171

72-
if (!$usePlugin || !$this->config->isEnabled() || (int)$this->config->getType() !== Config::BUILT_IN) {
72+
if (!$usePlugin || !$this->config->isEnabled() || $this->config->getType() !== Config::BUILT_IN) {
7373
return $result;
7474
}
7575

app/code/Magento/PageCache/Model/Controller/Result/VarnishPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function afterRenderResult(ResultInterface $subject, ResultInterface $res
6565
{
6666
$usePlugin = $this->registry->registry('use_page_cache_plugin');
6767

68-
if ((int)$this->config->getType() === Config::VARNISH && $this->config->isEnabled() && $usePlugin) {
68+
if ($this->config->getType() === Config::VARNISH && $this->config->isEnabled() && $usePlugin) {
6969
$this->version->process();
7070

7171
if ($this->state->getMode() == AppState::MODE_DEVELOPER) {

app/code/Magento/PageCache/Model/Layout/LayoutPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function afterGetOutput(Layout $subject, $result)
8585
{
8686
if ($subject->isCacheable() && $this->config->isEnabled()) {
8787
$tags = [];
88-
$isVarnish = (int)$this->config->getType() === Config::VARNISH;
88+
$isVarnish = $this->config->getType() === Config::VARNISH;
8989

9090
foreach ($subject->getAllBlocks() as $block) {
9191
if ($block instanceof IdentityInterface) {

app/code/Magento/PageCache/Observer/FlushAllCache.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function __construct(
6262
*/
6363
public function execute(Observer $observer)
6464
{
65-
if ((int)$this->_config->getType() === Config::BUILT_IN) {
65+
if ($this->_config->getType() === Config::BUILT_IN) {
6666
$this->fullPageCache->clean();
6767
}
6868
}

app/code/Magento/PageCache/Observer/FlushCacheByTags.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function __construct(
7373
*/
7474
public function execute(Observer $observer)
7575
{
76-
if ((int)$this->_config->getType() === Config::BUILT_IN && $this->_config->isEnabled()) {
76+
if ($this->_config->getType() === Config::BUILT_IN && $this->_config->isEnabled()) {
7777
$object = $observer->getEvent()->getObject();
7878
if (!is_object($object)) {
7979
return;

app/code/Magento/PageCache/Observer/ProcessLayoutRenderElement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ private function isFullPageCacheEnabled()
120120
private function isVarnishEnabled()
121121
{
122122
if ($this->isVarnishEnabled === null) {
123-
$this->isVarnishEnabled = ((int)$this->_config->getType() === \Magento\PageCache\Model\Config::VARNISH);
123+
$this->isVarnishEnabled = ($this->_config->getType() === \Magento\PageCache\Model\Config::VARNISH);
124124
}
125125
return $this->isVarnishEnabled;
126126
}

0 commit comments

Comments
 (0)