From 3e7eebd91f77d6703d329c28d44c1ac73b2ee9ef Mon Sep 17 00:00:00 2001 From: Joe Lencioni Date: Wed, 21 Mar 2012 15:35:20 -0500 Subject: [PATCH 1/3] [TwigBundle] Improved ExceptionController docblocks Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/lencioni/symfony.png)](http://travis-ci.org/lencioni/symfony) Fixes the following tickets: - Todo: - --- .../TwigBundle/Controller/ExceptionController.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index e4ca988f51..41ae9a06ed 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -31,6 +31,8 @@ class ExceptionController extends ContainerAware * @param DebugLoggerInterface $logger A DebugLoggerInterface instance * @param string $format The format to use for rendering (html, xml, ...) * + * @return Response + * * @throws \InvalidArgumentException When the exception template does not exist */ public function showAction(FlattenException $exception, DebugLoggerInterface $logger = null, $format = 'html') @@ -59,6 +61,9 @@ class ExceptionController extends ContainerAware return $response; } + /** + * @return string + */ protected function getAndCleanOutputBuffering() { // the count variable avoids an infinite loop on @@ -74,6 +79,14 @@ class ExceptionController extends ContainerAware return $currentContent; } + /** + * @param Symfony\Bundle\TwigBundle\TwigEngine $templating + * @param string $format + * @param integer $code An HTTP response status code + * @param Boolean $debug + * + * @return TemplateReference + */ protected function findTemplate($templating, $format, $code, $debug) { $name = $debug ? 'exception' : 'error'; From 5910ac91d7b146d933d32e6f09d6aa3f03973dd6 Mon Sep 17 00:00:00 2001 From: Joe Lencioni Date: Wed, 21 Mar 2012 16:57:29 -0500 Subject: [PATCH 2/3] [TwigBundle] Added a use statement to shorten class name in a docblock Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/lencioni/symfony.png)](http://travis-ci.org/lencioni/symfony) Fixes the following tickets: - Todo: - --- .../Bundle/TwigBundle/Controller/ExceptionController.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index 41ae9a06ed..a308b0ad7e 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -16,6 +16,7 @@ use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpFoundation\Response; +use Symfony\Bundle\TwigBundle\TwigEngine; /** * ExceptionController. @@ -80,10 +81,10 @@ class ExceptionController extends ContainerAware } /** - * @param Symfony\Bundle\TwigBundle\TwigEngine $templating - * @param string $format - * @param integer $code An HTTP response status code - * @param Boolean $debug + * @param TwigEngine $templating + * @param string $format + * @param integer $code An HTTP response status code + * @param Boolean $debug * * @return TemplateReference */ From 1422133ad0d2fb2d427ee79c8e93ebbf6f9ca24d Mon Sep 17 00:00:00 2001 From: Joe Lencioni Date: Thu, 22 Mar 2012 07:58:46 -0500 Subject: [PATCH 3/3] [TwigBundle] Made docblock for findTemplate() more general and accurate Bug fix: no Feature addition: no Backwards compatibility break: no Symfony2 tests pass: [![Build Status](https://secure.travis-ci.org/lencioni/symfony.png)](http://travis-ci.org/lencioni/symfony) Fixes the following tickets: - Todo: - --- .../TwigBundle/Controller/ExceptionController.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php index a308b0ad7e..538621b2cc 100644 --- a/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/TwigBundle/Controller/ExceptionController.php @@ -11,12 +11,12 @@ namespace Symfony\Bundle\TwigBundle\Controller; +use Symfony\Bundle\FrameworkBundle\Templating\EngineInterface; use Symfony\Bundle\FrameworkBundle\Templating\TemplateReference; use Symfony\Component\DependencyInjection\ContainerAware; use Symfony\Component\HttpKernel\Exception\FlattenException; use Symfony\Component\HttpKernel\Log\DebugLoggerInterface; use Symfony\Component\HttpFoundation\Response; -use Symfony\Bundle\TwigBundle\TwigEngine; /** * ExceptionController. @@ -81,10 +81,10 @@ class ExceptionController extends ContainerAware } /** - * @param TwigEngine $templating - * @param string $format - * @param integer $code An HTTP response status code - * @param Boolean $debug + * @param EngineInterface $templating + * @param string $format + * @param integer $code An HTTP response status code + * @param Boolean $debug * * @return TemplateReference */