@@ -32,11 +32,6 @@ class GraphQl
32
32
*/
33
33
private $ config ;
34
34
35
- /**
36
- * @var ResponseHttp
37
- */
38
- private $ response ;
39
-
40
35
/**
41
36
* @var HttpRequestProcessor
42
37
*/
@@ -55,7 +50,8 @@ class GraphQl
55
50
/**
56
51
* @param CacheableQuery $cacheableQuery
57
52
* @param Config $config
58
- * @param ResponseHttp $response
53
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
54
+ * @param ResponseHttp $response @deprecated do not use
59
55
* @param HttpRequestProcessor $requestProcessor
60
56
* @param Registry $registry
61
57
* @param CacheIdCalculator $cacheIdCalculator
@@ -70,7 +66,6 @@ public function __construct(
70
66
) {
71
67
$ this ->cacheableQuery = $ cacheableQuery ;
72
68
$ this ->config = $ config ;
73
- $ this ->response = $ response ;
74
69
$ this ->requestProcessor = $ requestProcessor ;
75
70
$ this ->registry = $ registry ;
76
71
$ this ->cacheIdCalculator = $ cacheIdCalculator ;
@@ -109,26 +104,22 @@ public function afterRenderResult(ResultInterface $subject, ResultInterface $res
109
104
/** @see \Magento\Framework\App\Http::launch */
110
105
/** @see \Magento\PageCache\Model\Controller\Result\BuiltinPlugin::afterRenderResult */
111
106
$ this ->registry ->register ('use_page_cache_plugin ' , true , true );
112
-
113
107
$ cacheId = $ this ->cacheIdCalculator ->getCacheId ();
114
108
if ($ cacheId ) {
115
- $ this -> response ->setHeader (CacheIdCalculator::CACHE_ID_HEADER , $ cacheId , true );
109
+ $ response ->setHeader (CacheIdCalculator::CACHE_ID_HEADER , $ cacheId , true );
116
110
}
117
-
118
111
if ($ this ->cacheableQuery ->shouldPopulateCacheHeadersWithTags ()) {
119
- $ this -> response ->setPublicHeaders ($ this ->config ->getTtl ());
120
- $ this -> response ->setHeader ('X-Magento-Tags ' , implode (', ' , $ this ->cacheableQuery ->getCacheTags ()), true );
112
+ $ response ->setPublicHeaders ($ this ->config ->getTtl ());
113
+ $ response ->setHeader ('X-Magento-Tags ' , implode (', ' , $ this ->cacheableQuery ->getCacheTags ()), true );
121
114
} else {
122
115
$ sendNoCacheHeaders = true ;
123
116
}
124
117
} else {
125
118
$ sendNoCacheHeaders = true ;
126
119
}
127
-
128
120
if ($ sendNoCacheHeaders ) {
129
- $ this -> response ->setNoCacheHeaders ();
121
+ $ response ->setNoCacheHeaders ();
130
122
}
131
-
132
123
return $ result ;
133
124
}
134
125
}
0 commit comments