66use FOS \HttpCache \Exception \InvalidArgumentException ;
77use FOS \HttpCache \Exception \ProxyResponseException ;
88use FOS \HttpCache \Exception \ProxyUnreachableException ;
9- use FOS \HttpCache \Exception \UnsupportedInvalidationMethodException ;
10- use FOS \HttpCache \Invalidation \ CacheProxyInterface ;
11- use FOS \HttpCache \Invalidation \ Method \BanInterface ;
12- use FOS \HttpCache \Invalidation \ Method \PurgeInterface ;
13- use FOS \HttpCache \Invalidation \ Method \RefreshInterface ;
9+ use FOS \HttpCache \Exception \UnsupportedProxyOperationException ;
10+ use FOS \HttpCache \ProxyClient \ ProxyClientInterface ;
11+ use FOS \HttpCache \ProxyClient \ Invalidation \BanInterface ;
12+ use FOS \HttpCache \ProxyClient \ Invalidation \PurgeInterface ;
13+ use FOS \HttpCache \ProxyClient \ Invalidation \RefreshInterface ;
1414use Symfony \Component \EventDispatcher \EventDispatcher ;
1515use Symfony \Component \EventDispatcher \EventDispatcherInterface ;
1616use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
@@ -38,7 +38,7 @@ class CacheInvalidator
3838 const INVALIDATE = 'invalidate ' ;
3939
4040 /**
41- * @var CacheProxyInterface
41+ * @var ProxyClientInterface
4242 */
4343 protected $ cache ;
4444
@@ -55,9 +55,9 @@ class CacheInvalidator
5555 /**
5656 * Constructor
5757 *
58- * @param CacheProxyInterface $cache HTTP cache
58+ * @param ProxyClientInterface $cache HTTP cache
5959 */
60- public function __construct (CacheProxyInterface $ cache )
60+ public function __construct (ProxyClientInterface $ cache )
6161 {
6262 $ this ->cache = $ cache ;
6363 }
@@ -159,14 +159,14 @@ public function getTagsHeader()
159159 *
160160 * @param string $path Path or URL
161161 *
162- * @throws UnsupportedInvalidationMethodException
162+ * @throws UnsupportedProxyOperationException
163163 *
164164 * @return $this
165165 */
166166 public function invalidatePath ($ path )
167167 {
168168 if (!$ this ->cache instanceof PurgeInterface) {
169- throw UnsupportedInvalidationMethodException ::cacheDoesNotImplement ('PURGE ' );
169+ throw UnsupportedProxyOperationException ::cacheDoesNotImplement ('PURGE ' );
170170 }
171171
172172 $ this ->cache ->purge ($ path );
@@ -182,14 +182,14 @@ public function invalidatePath($path)
182182 *
183183 * @see RefreshInterface::refresh()
184184 *
185- * @throws UnsupportedInvalidationMethodException
185+ * @throws UnsupportedProxyOperationException
186186 *
187187 * @return $this
188188 */
189189 public function refreshPath ($ path , array $ headers = array ())
190190 {
191191 if (!$ this ->cache instanceof RefreshInterface) {
192- throw UnsupportedInvalidationMethodException ::cacheDoesNotImplement ('REFRESH ' );
192+ throw UnsupportedProxyOperationException ::cacheDoesNotImplement ('REFRESH ' );
193193 }
194194
195195 $ this ->cache ->refresh ($ path , $ headers );
@@ -207,14 +207,14 @@ public function refreshPath($path, array $headers = array())
207207 *
208208 * @param array $headers HTTP headers that path must match to be banned.
209209 *
210- * @throws UnsupportedInvalidationMethodException If HTTP cache does not support BAN requests
210+ * @throws UnsupportedProxyOperationException If HTTP cache does not support BAN requests
211211 *
212212 * @return $this
213213 */
214214 public function invalidate (array $ headers )
215215 {
216216 if (!$ this ->cache instanceof BanInterface) {
217- throw UnsupportedInvalidationMethodException ::cacheDoesNotImplement ('BAN ' );
217+ throw UnsupportedProxyOperationException ::cacheDoesNotImplement ('BAN ' );
218218 }
219219
220220 $ this ->cache ->ban ($ headers );
@@ -240,14 +240,14 @@ public function invalidate(array $headers)
240240 * @param array|string $hosts Regular expression of a host name or list of
241241 * exact host names to limit banning.
242242 *
243- * @throws UnsupportedInvalidationMethodException If HTTP cache does not support BAN requests
243+ * @throws UnsupportedProxyOperationException If HTTP cache does not support BAN requests
244244 *
245245 * @return $this
246246 */
247247 public function invalidateRegex ($ path , $ contentType = null , $ hosts = null )
248248 {
249249 if (!$ this ->cache instanceof BanInterface) {
250- throw UnsupportedInvalidationMethodException ::cacheDoesNotImplement ('BAN ' );
250+ throw UnsupportedProxyOperationException ::cacheDoesNotImplement ('BAN ' );
251251 }
252252
253253 $ this ->cache ->banPath ($ path , $ contentType , $ hosts );
@@ -263,14 +263,14 @@ public function invalidateRegex($path, $contentType = null, $hosts = null)
263263 *
264264 * @param array $tags Cache tags
265265 *
266- * @throws UnsupportedInvalidationMethodException If HTTP cache does not support BAN requests
266+ * @throws UnsupportedProxyOperationException If HTTP cache does not support BAN requests
267267 *
268268 * @return $this
269269 */
270270 public function invalidateTags (array $ tags )
271271 {
272272 if (!$ this ->cache instanceof BanInterface) {
273- throw UnsupportedInvalidationMethodException ::cacheDoesNotImplement ('BAN ' );
273+ throw UnsupportedProxyOperationException ::cacheDoesNotImplement ('BAN ' );
274274 }
275275
276276 $ headers = array ($ this ->getTagsHeader () => '( ' .implode ('| ' , $ tags ).')(,.+)?$ ' );
0 commit comments