Skip to content

Commit a22a6b5

Browse files
committed
MAGETWO-62514: Remove uses of serialize/unserialize in \Magento\Framework\App\PageCache\Kernel
1 parent aa56b87 commit a22a6b5

File tree

1 file changed

+15
-12
lines changed
  • lib/internal/Magento/Framework/App/PageCache

1 file changed

+15
-12
lines changed

lib/internal/Magento/Framework/App/PageCache/Kernel.php

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77

88
use Magento\Framework\App\ObjectManager;
99
use Magento\Framework\Serialize\SerializerInterface;
10+
use Magento\Framework\App\Http\Context;
11+
use Magento\Framework\App\Http\ContextFactory;
12+
use Magento\Framework\App\Response\HttpFactory;
1013

1114
/**
1215
* Builtin cache processor
@@ -41,44 +44,44 @@ class Kernel
4144
private $serializer;
4245

4346
/**
44-
* @var \Magento\Framework\App\Http\Context
47+
* @var Context
4548
*/
4649
private $context;
4750

4851
/**
49-
* @var \Magento\Framework\App\Http\ContextFactory
52+
* @var ContextFactory
5053
*/
5154
private $contextFactory;
5255

5356
/**
54-
* @var \Magento\Framework\App\Response\HttpFactory
57+
* @var HttpFactory
5558
*/
5659
private $httpFactory;
5760

5861
/**
5962
* @param Cache $cache
6063
* @param Identifier $identifier
6164
* @param \Magento\Framework\App\Request\Http $request
62-
* @param \Magento\Framework\App\Http\Context $context
63-
* @param \Magento\Framework\App\Http\ContextFactory $contextFactory
64-
* @param \Magento\Framework\App\Response\HttpFactory $httpFactory
65+
* @param Context|null $context
66+
* @param ContextFactory|null $contextFactory
67+
* @param HttpFactory|null $httpFactory
6568
* @param SerializerInterface|null $serializer
6669
*/
6770
public function __construct(
6871
\Magento\Framework\App\PageCache\Cache $cache,
6972
\Magento\Framework\App\PageCache\Identifier $identifier,
7073
\Magento\Framework\App\Request\Http $request,
71-
\Magento\Framework\App\Http\Context $context,
72-
\Magento\Framework\App\Http\ContextFactory $contextFactory,
73-
\Magento\Framework\App\Response\HttpFactory $httpFactory,
74+
Context $context = null,
75+
ContextFactory $contextFactory = null,
76+
HttpFactory $httpFactory = null,
7477
SerializerInterface $serializer = null
7578
) {
7679
$this->cache = $cache;
7780
$this->identifier = $identifier;
7881
$this->request = $request;
79-
$this->context = $context;
80-
$this->contextFactory = $contextFactory;
81-
$this->httpFactory = $httpFactory;
82+
$this->context = $context ?: ObjectManager::getInstance()->get(Context::class);
83+
$this->contextFactory = $contextFactory ?: ObjectManager::getInstance()->get(ContextFactory::class);
84+
$this->httpFactory = $httpFactory ?: ObjectManager::getInstance()->get(HttpFactory::class);
8285
$this->serializer = $serializer ?: ObjectManager::getInstance()->get(SerializerInterface::class);
8386
}
8487

0 commit comments

Comments
 (0)