From 58b0aefa1636a9d32be064bd917cfbd0d771872f Mon Sep 17 00:00:00 2001 From: Tony Cosentino Date: Fri, 23 May 2014 13:34:06 +0200 Subject: [PATCH] Added phpdoc for Cache-Control directives methods --- .../Component/HttpFoundation/HeaderBag.php | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/src/Symfony/Component/HttpFoundation/HeaderBag.php b/src/Symfony/Component/HttpFoundation/HeaderBag.php index 756f1679b9..4cae5058ec 100644 --- a/src/Symfony/Component/HttpFoundation/HeaderBag.php +++ b/src/Symfony/Component/HttpFoundation/HeaderBag.php @@ -242,6 +242,14 @@ class HeaderBag implements \IteratorAggregate, \Countable return $date; } + /** + * Adds a custom Cache-Control directive. + * + * @param string $key The Cache-Control directive name + * @param mixed $value The Cache-Control directive value + * + * @api + */ public function addCacheControlDirective($key, $value = true) { $this->cacheControl[$key] = $value; @@ -249,16 +257,41 @@ class HeaderBag implements \IteratorAggregate, \Countable $this->set('Cache-Control', $this->getCacheControlHeader()); } + /** + * Returns true if the Cache-Control directive is defined. + * + * @param string $key The Cache-Control directive + * + * @return bool true if the directive exists, false otherwise + * + * @api + */ public function hasCacheControlDirective($key) { return array_key_exists($key, $this->cacheControl); } + /** + * Returns a Cache-Control directive value by name. + * + * @param string $key The directive name + * + * @return mixed|null The directive value if defined, null otherwise + * + * @api + */ public function getCacheControlDirective($key) { return array_key_exists($key, $this->cacheControl) ? $this->cacheControl[$key] : null; } + /** + * Removes a Cache-Control directive. + * + * @param string $key The Cache-Control directive + * + * @api + */ public function removeCacheControlDirective($key) { unset($this->cacheControl[$key]);