|
7 | 7 |
|
8 | 8 | use Magento\Framework\App\ObjectManager;
|
9 | 9 | 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; |
10 | 13 |
|
11 | 14 | /**
|
12 | 15 | * Builtin cache processor
|
@@ -41,44 +44,44 @@ class Kernel
|
41 | 44 | private $serializer;
|
42 | 45 |
|
43 | 46 | /**
|
44 |
| - * @var \Magento\Framework\App\Http\Context |
| 47 | + * @var Context |
45 | 48 | */
|
46 | 49 | private $context;
|
47 | 50 |
|
48 | 51 | /**
|
49 |
| - * @var \Magento\Framework\App\Http\ContextFactory |
| 52 | + * @var ContextFactory |
50 | 53 | */
|
51 | 54 | private $contextFactory;
|
52 | 55 |
|
53 | 56 | /**
|
54 |
| - * @var \Magento\Framework\App\Response\HttpFactory |
| 57 | + * @var HttpFactory |
55 | 58 | */
|
56 | 59 | private $httpFactory;
|
57 | 60 |
|
58 | 61 | /**
|
59 | 62 | * @param Cache $cache
|
60 | 63 | * @param Identifier $identifier
|
61 | 64 | * @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 |
65 | 68 | * @param SerializerInterface|null $serializer
|
66 | 69 | */
|
67 | 70 | public function __construct(
|
68 | 71 | \Magento\Framework\App\PageCache\Cache $cache,
|
69 | 72 | \Magento\Framework\App\PageCache\Identifier $identifier,
|
70 | 73 | \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, |
74 | 77 | SerializerInterface $serializer = null
|
75 | 78 | ) {
|
76 | 79 | $this->cache = $cache;
|
77 | 80 | $this->identifier = $identifier;
|
78 | 81 | $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); |
82 | 85 | $this->serializer = $serializer ?: ObjectManager::getInstance()->get(SerializerInterface::class);
|
83 | 86 | }
|
84 | 87 |
|
|
0 commit comments