/**
* Provides a common base class for cacheable safe redirects.
*/
abstract class CacheableSecuredRedirectResponse extends SecuredRedirectResponse
implements CacheableResponseInterface
{ use CacheableResponseTrait;
/**
* {@inheritdoc}
*/
protected function fromResponse(RedirectResponse
$response) { parent::
fromResponse($response);
$metadata =
$this->
getCacheableMetadata();
if ($response instanceof CacheableResponseInterface
) { $metadata->
addCacheableDependency($response->
getCacheableMetadata());
} else { $metadata->
setCacheMaxAge(0
);
} }}