diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php index 8ae77f50ba..060a6ce6bf 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php @@ -146,13 +146,13 @@ class FormHelper extends Helper * * Example usage: * - * widget($form) ?> + * widget($form) ?> * * You can pass options during the call: * - * widget($form, array('attr' => array('class' => 'foo'))) ?> + * widget($form, array('attr' => array('class' => 'foo'))) ?> * - * widget($form, array('separator' => '+++++')) ?> + * widget($form, array('separator' => '+++++')) ?> * * @param FormView $view The view for which to render the widget * @param array $variables Additional variables passed to the template diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index 138248d87b..0f4a6ef134 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -861,7 +861,7 @@ class Application $input->setInteractive(false); } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) { $inputStream = $this->getHelperSet()->get('dialog')->getInputStream(); - if (!posix_isatty($inputStream)) { + if (!@posix_isatty($inputStream)) { $input->setInteractive(false); } } diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php index 934c8477a5..f66cb1598f 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/RequestDataCollector.php @@ -51,10 +51,14 @@ class RequestDataCollector extends DataCollector implements EventSubscriberInter $attributes = array(); foreach ($request->attributes->all() as $key => $value) { if ('_route' == $key && is_object($value)) { - $value = $value->getPath(); + $attributes['_route'] = $this->varToString($value->getPath()); + } elseif ('_route_params' == $key) { + foreach ($value as $key => $v) { + $attributes['_route_params'][$key] = $this->varToString($v); + } + } else { + $attributes[$key] = $this->varToString($value); } - - $attributes[$key] = $this->varToString($value); } $content = null; diff --git a/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php b/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php index 80e250ad0f..e44da38d3b 100644 --- a/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php +++ b/src/Symfony/Component/HttpKernel/DataCollector/RouterDataCollector.php @@ -50,6 +50,8 @@ class RouterDataCollector extends DataCollector $this->data['route'] = $this->guessRoute($request, $this->controllers[$request]); } } + + unset($this->controllers[$request]); } protected function guessRoute(Request $request, $controller) diff --git a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php index 5b2228ba1a..43dfaff5c5 100644 --- a/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php +++ b/src/Symfony/Component/HttpKernel/EventListener/ProfilerListener.php @@ -135,6 +135,8 @@ class ProfilerListener implements EventSubscriberInterface if ($master) { $this->saveProfiles($profile); + + unset($this->children); } } diff --git a/src/Symfony/Component/PropertyAccess/StringUtil.php b/src/Symfony/Component/PropertyAccess/StringUtil.php index cc2fda3e1d..509bce4b92 100644 --- a/src/Symfony/Component/PropertyAccess/StringUtil.php +++ b/src/Symfony/Component/PropertyAccess/StringUtil.php @@ -63,10 +63,13 @@ class StringUtil // babies (baby) array('sei', 3, false, true, 'y'), + // accesses (access), addresses (address), kisses (kiss) + array('sess', 4, true, false, 'ss'), + // analyses (analysis), ellipses (ellipsis), funguses (fungus), // neuroses (neurosis), theses (thesis), emphases (emphasis), // oases (oasis), crises (crisis), houses (house), bases (base), - // atlases (atlas), kisses (kiss) + // atlases (atlas) array('ses', 3, true, true, array('s', 'se', 'sis')), // objectives (objective), alternative (alternatives) diff --git a/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php b/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php index 6fc3d9a27b..e33f01dd9c 100644 --- a/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php +++ b/src/Symfony/Component/PropertyAccess/Tests/StringUtilTest.php @@ -75,7 +75,9 @@ class StringUtilTest extends \PHPUnit_Framework_TestCase array('heroes', array('hero', 'heroe')), array('hoaxes', 'hoax'), array('irises', array('iris', 'irise', 'irisis')), - array('kisses', array('kiss', 'kisse', 'kissis')), + array('kisses', 'kiss'), + array('addresses', 'address'), + array('accesses', 'access'), array('knives', 'knife'), array('lives', 'life'), array('lice', 'louse'), diff --git a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php index 9831d85a09..7abab5a631 100644 --- a/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php +++ b/src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php @@ -180,7 +180,7 @@ abstract class AnnotationClassLoader implements LoaderInterface $defaults = array_replace($globals['defaults'], $annot->getDefaults()); foreach ($method->getParameters() as $param) { - if ($param->isOptional()) { + if (!isset($defaults[$param->getName()]) && $param->isOptional()) { $defaults[$param->getName()] = $param->getDefaultValue(); } } diff --git a/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php b/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php index 31c43f58c6..5b7325c317 100644 --- a/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php +++ b/src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php @@ -11,6 +11,8 @@ namespace Symfony\Component\Routing\Tests\Loader; +use Symfony\Component\Routing\Annotation\Route; + class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest { protected $loader; @@ -71,13 +73,18 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest return array( array( 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', - array('name'=>'route1'), - array('arg2' => 'defaultValue2', 'arg3' =>'defaultValue3') + array('name' => 'route1'), + array('arg2' => 'defaultValue2', 'arg3' => 'defaultValue3') ), array( 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', - array('name'=>'route1', 'defaults' => array('arg2' => 'foo')), - array('arg2' => 'defaultValue2', 'arg3' =>'defaultValue3') + array('name' => 'route1', 'defaults' => array('arg2' => 'foo')), + array('arg2' => 'defaultValue2', 'arg3' => 'defaultValue3') + ), + array( + 'Symfony\Component\Routing\Tests\Fixtures\AnnotatedClasses\BarClass', + array('name' => 'route1', 'defaults' => array('arg2' => 'foobar')), + array('arg2' => false, 'arg3' => 'defaultValue3') ), ); } @@ -108,12 +115,11 @@ class AnnotationClassLoaderTest extends AbstractAnnotationLoaderTest $this->assertSame($routeDatas['path'], $route->getPath(), '->load preserves path annotation'); $this->assertSame($routeDatas['requirements'],$route->getRequirements(), '->load preserves requirements annotation'); $this->assertCount(0, array_intersect($route->getOptions(), $routeDatas['options']), '->load preserves options annotation'); - $this->assertSame(array_replace($routeDatas['defaults'], $methodArgs), $route->getDefaults(), '->load preserves defaults annotation'); + $this->assertSame(array_replace($methodArgs, $routeDatas['defaults']), $route->getDefaults(), '->load preserves defaults annotation'); } private function getAnnotatedRoute($datas) { - return new \Symfony\Component\Routing\Annotation\Route($datas); + return new Route($datas); } - } diff --git a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php index 8c718768fe..81ccbdc0dd 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ContextListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ContextListener.php @@ -38,6 +38,7 @@ class ContextListener implements ListenerInterface private $logger; private $userProviders; private $dispatcher; + private $registered; public function __construct(SecurityContextInterface $context, array $userProviders, $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null) { @@ -65,8 +66,9 @@ class ContextListener implements ListenerInterface */ public function handle(GetResponseEvent $event) { - if (null !== $this->dispatcher && HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { + if (!$this->registered && null !== $this->dispatcher && HttpKernelInterface::MASTER_REQUEST === $event->getRequestType()) { $this->dispatcher->addListener(KernelEvents::RESPONSE, array($this, 'onKernelResponse')); + $this->registered = true; } $request = $event->getRequest(); diff --git a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php index 655459523a..abbb4606a6 100644 --- a/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php +++ b/src/Symfony/Component/Security/Http/Firewall/ExceptionListener.php @@ -76,6 +76,10 @@ class ExceptionListener */ public function onKernelException(GetResponseForExceptionEvent $event) { + // we need to remove ourselves as the exception listener can be + // different depending on the Request + $event->getDispatcher()->removeListener(KernelEvents::EXCEPTION, array($this, 'onKernelException')); + $exception = $event->getException(); $request = $event->getRequest();