From aee033699bd3aeeaba12d5ac1192b4f9d176c786 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Thu, 6 Dec 2012 09:58:41 +0100 Subject: [PATCH] fixed CS --- .../Controller/TemplateController.php | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php b/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php index 4357e76ad4..105d14a8fe 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Controller/TemplateController.php @@ -24,10 +24,10 @@ class TemplateController extends ContainerAware /** * Renders a template. * - * @param string $template The template name - * @param int|null $maxAge Max age for client caching - * @param int|null $sharedAge Max age for shared (proxy) caching - * @param Boolean|null $private Whether or not caching should apply for client caches only + * @param string $template The template name + * @param int|null $maxAge Max age for client caching + * @param int|null $sharedAge Max age for shared (proxy) caching + * @param Boolean|null $private Whether or not caching should apply for client caches only * * @return Response A Response instance */ @@ -35,18 +35,21 @@ class TemplateController extends ContainerAware { /** @var $response \Symfony\Component\HttpFoundation\Response */ $response = $this->container->get('templating')->renderResponse($template); + if ($maxAge) { $response->setMaxAge($maxAge); } + if ($sharedAge) { $response->setSharedMaxAge($sharedAge); } if ($private) { $response->setPrivate(); - } else if ($private === false || (is_null($private) && ($maxAge || $sharedAge))) { + } elseif ($private === false || (null === $private && ($maxAge || $sharedAge))) { $response->setPublic($private); } + return $response; } }