diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php index 983f1f45d7..64c187469e 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php @@ -12,8 +12,6 @@ namespace Symfony\Bridge\Doctrine\DependencyInjection\CompilerPass; use Symfony\Component\DependencyInjection\Exception\ParameterNotFoundException; -use Symfony\Component\HttpKernel\Kernel; - use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Definition; use Symfony\Component\DependencyInjection\Reference; diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php index ebe8f2c666..4cc8c585a8 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/ContainerBuilderTest.php @@ -13,10 +13,8 @@ namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests; require_once __DIR__ . '/Fixtures/includes/foo.php'; -use ProxyManager\Configuration; use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; /** * Integration tests for {@see \Symfony\Component\DependencyInjection\ContainerBuilder} combined diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php index f5025e70b7..a12ff2bcca 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Dumper/PhpDumperTest.php @@ -11,10 +11,8 @@ namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Dumper; -use ProxyManager\Configuration; use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper; use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Dumper\PhpDumper; /** @@ -46,7 +44,6 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase ); } - /** * Verifies that the generated container retrieves the same proxy instance on multiple subsequent requests */ diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php index f170a941c9..e2158b8f9b 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Fixtures/php/lazy_service.php @@ -194,5 +194,4 @@ class stdClass_c1d194250ee2e2b7d2eab8b8212368a8 extends \stdClass implements \Pr return $this->valueHolder5157dd96e88c0; } - } diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php index 1fb4c01c76..17d0deaf24 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/Instantiator/RuntimeInstantiatorTest.php @@ -11,7 +11,6 @@ namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Instantiator; -use ProxyManager\Configuration; use ProxyManager\Proxy\LazyLoadingInterface; use Symfony\Bridge\ProxyManager\LazyProxy\Instantiator\RuntimeInstantiator; use Symfony\Component\DependencyInjection\ContainerInterface; diff --git a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php index c21450a464..5fefbfac8c 100644 --- a/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php +++ b/src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/ProxyDumperTest.php @@ -11,9 +11,7 @@ namespace Symfony\Bridge\ProxyManager\LazyProxy\Tests\Instantiator; -use ProxyManager\Configuration; use Symfony\Bridge\ProxyManager\LazyProxy\PhpDumper\ProxyDumper; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; /** diff --git a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php index cc3aabf56a..3bf1d857f3 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php +++ b/src/Symfony/Bundle/FrameworkBundle/Command/TranslationUpdateCommand.php @@ -19,7 +19,6 @@ use Symfony\Component\Console\Output\OutputInterface; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Translation\MessageCatalogue; -use Symfony\Component\Yaml\Yaml; /** * A command that parse templates to extract translation messages and add them into the translation files. diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/SerializerPass.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/SerializerPass.php index 1a697c4bf0..aa449dd4c8 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/SerializerPass.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Compiler/SerializerPass.php @@ -41,11 +41,11 @@ class SerializerPass implements CompilerPassInterface private function findAndSortTaggedServices($tagName, ContainerBuilder $container) { $services = $container->findTaggedServiceIds($tagName); - + if (empty($services)) { - throw new \RuntimeException(sprintf('You must tag at least one service as "%s" to use the Serializer service', $tagName)); + throw new \RuntimeException(sprintf('You must tag at least one service as "%s" to use the Serializer service', $tagName)); } - + $sortedServices = array(); foreach ($services as $serviceId => $tags) { foreach ($tags as $tag) { diff --git a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php index 29220af5ab..8ae77f50ba 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php +++ b/src/Symfony/Bundle/FrameworkBundle/Templating/Helper/FormHelper.php @@ -138,7 +138,6 @@ class FormHelper extends Helper { // Uncomment this as soon as the deprecation note should be shown // trigger_error('The form helper $view[\'form\']->enctype() is deprecated since version 2.3 and will be removed in 3.0. Use $view[\'form\']->start() instead.', E_USER_DEPRECATED); - return $this->renderer->searchAndRenderBlock($view, 'enctype'); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php index a65d069c0b..5a048ed411 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Compiler/SerializerPassTest.php @@ -17,7 +17,7 @@ use Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass; /** * Tests for the SerializerPass class - * + * * @author Javier Lopez */ class SerializerPassTest extends \PHPUnit_Framework_TestCase @@ -26,50 +26,50 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase public function testThrowExceptionWhenNoNormalizers() { $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - + $container->expects($this->once()) ->method('hasDefinition') ->with('serializer') ->will($this->returnValue(true)); - + $container->expects($this->once()) ->method('findTaggedServiceIds') ->with('serializer.normalizer') ->will($this->returnValue(array())); - + $this->setExpectedException('RuntimeException'); - + $serializerPass = new SerializerPass(); $serializerPass->process($container); } - + public function testThrowExceptionWhenNoEncoders() { $definition = $this->getMock('Symfony\Component\DependencyInjection\Definition'); $container = $this->getMock('Symfony\Component\DependencyInjection\ContainerBuilder'); - + $container->expects($this->once()) ->method('hasDefinition') ->with('serializer') ->will($this->returnValue(true)); - + $container->expects($this->any()) ->method('findTaggedServiceIds') ->will($this->onConsecutiveCalls( array('n' => array('serializer.normalizer')), array() )); - + $container->expects($this->once()) ->method('getDefinition') ->will($this->returnValue($definition)); - + $this->setExpectedException('RuntimeException'); - + $serializerPass = new SerializerPass(); $serializerPass->process($container); } - + public function testServicesAreOrderedAccordingToPriority() { $services = array( @@ -77,7 +77,7 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase 'n1' => array('tag' => array('priority' => 200)), 'n2' => array('tag' => array('priority' => 100)) ); - + $expected = array( new Reference('n1'), new Reference('n2'), @@ -91,15 +91,15 @@ class SerializerPassTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($services)); $serializerPass = new SerializerPass(); - + $method = new \ReflectionMethod( - 'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass', + 'Symfony\Bundle\FrameworkBundle\DependencyInjection\Compiler\SerializerPass', 'findAndSortTaggedServices' ); $method->setAccessible(TRUE); - + $actual = $method->invoke($serializerPass, 'tag', $container); - + $this->assertEquals($expected, $actual); } } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 55c9b55bd5..9c9aa83b9a 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -128,7 +128,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase 'debug' => '%kernel.debug%', ), 'serializer' => array( - 'enabled' => false + 'enabled' => false ) ); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php new file mode 100644 index 0000000000..7c8a4b48ad --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/FragmentController.php @@ -0,0 +1,46 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Functional\Bundle\TestBundle\Controller; + +use Symfony\Component\HttpFoundation\Request; +use Symfony\Component\HttpFoundation\Response; +use Symfony\Component\DependencyInjection\ContainerAware; + +class FragmentController extends ContainerAware +{ + public function indexAction() + { + $actions = $this->container->get('templating')->get('actions'); + + return new Response($actions->render($actions->controller('TestBundle:Fragment:inlined', array( + 'options' => array( + 'bar' => new Bar(), + 'eleven' => 11, + ), + )))); + } + + public function inlinedAction($options, $_format) + { + return new Response($options['bar']->getBar().' '.$_format); + } +} + +class Bar +{ + private $bar = 'bar'; + + public function getBar() + { + return $this->bar; + } +} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php index 598ecc0833..95f5dfa76f 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Controller/SubRequestController.php @@ -45,7 +45,6 @@ class SubRequestController extends ContainerAware // The RouterListener is also tested as if it does not keep the right // Request in the context, a 301 would be generated - return new Response($content); } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml index 6a9f5a8f8b..57d83eb9c6 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/Bundle/TestBundle/Resources/config/routing.yml @@ -36,3 +36,11 @@ subrequest_fragment: path: /subrequest/fragment/{_locale}.{_format} defaults: { _controller: TestBundle:SubRequest:fragment, _format: "html" } schemes: [http] + +fragment_home: + path: /fragment_home + defaults: { _controller: TestBundle:Fragment:index, _format: txt } + +fragment_inlined: + path: /fragment_inlined + defaults: { _controller: TestBundle:Fragment:inlined } diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php new file mode 100644 index 0000000000..a054d7c2e2 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/FragmentTest.php @@ -0,0 +1,41 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Bundle\FrameworkBundle\Tests\Functional; + +/** + * @group functional + */ +class FragmentTest extends WebTestCase +{ + /** + * @dataProvider getConfigs + */ + public function testFragment($insulate) + { + $client = $this->createClient(array('test_case' => 'Fragment', 'root_config' => 'config.yml')); + if ($insulate) { + $client->insulate(); + } + + $client->request('GET', '/fragment_home'); + + $this->assertEquals('bar txt', $client->getResponse()->getContent()); + } + + public function getConfigs() + { + return array( + array(false), + array(true), + ); + } +} diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php new file mode 100644 index 0000000000..351cf79d43 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Fragment/bundles.php @@ -0,0 +1,9 @@ +getTranslator($this->getLoader()); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es')); + $translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR')); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); $this->assertEquals('foobar (ES)', $translator->trans('foobar')); $this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0)); $this->assertEquals('no translation', $translator->trans('no translation')); + $this->assertEquals('foobarfoo (PT-PT)', $translator->trans('foobarfoo')); + $this->assertEquals('other choice 1 (PT-BR)', $translator->transChoice('other choice', 1)); } public function testTransWithCaching() @@ -59,25 +61,29 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase // prime the cache $translator = $this->getTranslator($this->getLoader(), array('cache_dir' => $this->tmpDir)); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es')); + $translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR')); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); $this->assertEquals('foobar (ES)', $translator->trans('foobar')); $this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0)); $this->assertEquals('no translation', $translator->trans('no translation')); + $this->assertEquals('foobarfoo (PT-PT)', $translator->trans('foobarfoo')); + $this->assertEquals('other choice 1 (PT-BR)', $translator->transChoice('other choice', 1)); // do it another time as the cache is primed now $loader = $this->getMock('Symfony\Component\Translation\Loader\LoaderInterface'); $translator = $this->getTranslator($loader, array('cache_dir' => $this->tmpDir)); $translator->setLocale('fr'); - $translator->setFallbackLocales(array('en', 'es')); + $translator->setFallbackLocale(array('en', 'es', 'pt-PT', 'pt_BR')); $this->assertEquals('foo (FR)', $translator->trans('foo')); $this->assertEquals('bar (EN)', $translator->trans('bar')); $this->assertEquals('foobar (ES)', $translator->trans('foobar')); $this->assertEquals('choice 0 (EN)', $translator->transChoice('choice', 0)); $this->assertEquals('no translation', $translator->trans('no translation')); + $this->assertEquals('foobarfoo (PT-PT)', $translator->trans('foobarfoo')); + $this->assertEquals('other choice 1 (PT-BR)', $translator->transChoice('other choice', 1)); } public function testGetLocale() @@ -155,6 +161,20 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase 'foobar' => 'foobar (ES)', )))) ; + $loader + ->expects($this->at(3)) + ->method('load') + ->will($this->returnValue($this->getCatalogue('pt-PT', array( + 'foobarfoo' => 'foobarfoo (PT-PT)', + )))) + ; + $loader + ->expects($this->at(4)) + ->method('load') + ->will($this->returnValue($this->getCatalogue('pt_BR', array( + 'other choice' => '{0} other choice 0 (PT-BR)|{1} other choice 1 (PT-BR)|]1,Inf] other choice inf (PT-BR)', + )))) + ; return $loader; } @@ -183,6 +203,8 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase $translator->addResource('loader', 'foo', 'fr'); $translator->addResource('loader', 'foo', 'en'); $translator->addResource('loader', 'foo', 'es'); + $translator->addResource('loader', 'foo', 'pt-PT'); // European Portuguese + $translator->addResource('loader', 'foo', 'pt_BR'); // Brazilian Portuguese return $translator; } diff --git a/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php b/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php index efb40aa4a6..1705c1ac06 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php +++ b/src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php @@ -98,6 +98,8 @@ class Translator extends BaseTranslator $fallbackContent = ''; $current = ''; foreach ($this->computeFallbackLocales($locale) as $fallback) { + $fallbackSuffix = ucfirst(str_replace('-', '_', $fallback)); + $fallbackContent .= sprintf(<<addFallbackCatalogue(\$catalogue%s); @@ -105,11 +107,11 @@ class Translator extends BaseTranslator EOF , - ucfirst($fallback), + $fallbackSuffix, $fallback, var_export($this->catalogues[$fallback]->all(), true), - ucfirst($current), - ucfirst($fallback) + ucfirst(str_replace('-', '_', $current)), + $fallbackSuffix ); $current = $fallback; } diff --git a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php index a0a1ca2d4a..bb16373c1b 100644 --- a/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php +++ b/src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php @@ -91,12 +91,14 @@ class SecurityRoutingIntegrationTest extends WebTestCase $this->assertRestricted($barredClient, '/secured-by-two-ips'); } - private function assertAllowed($client, $path) { + private function assertAllowed($client, $path) + { $client->request('GET', $path); $this->assertEquals(404, $client->getResponse()->getStatusCode()); } - private function assertRestricted($client, $path) { + private function assertRestricted($client, $path) + { $client->request('GET', $path); $this->assertEquals(302, $client->getResponse()->getStatusCode()); } diff --git a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php index 97021c8a46..d05bcf8a0f 100644 --- a/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php +++ b/src/Symfony/Bundle/WebProfilerBundle/Controller/ExceptionController.php @@ -93,10 +93,10 @@ class ExceptionController if (!$this->templateExists($template)) { $handler = new ExceptionHandler(); - return new Response($handler->getStylesheet($exception)); + return new Response($handler->getStylesheet($exception), 200, array('Content-Type' => 'text/css')); } - return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, 'text/css'); + return new Response($this->twig->render('@WebProfiler/Collector/exception.css.twig'), 200, array('Content-Type' => 'text/css')); } protected function getTemplate() diff --git a/src/Symfony/Component/BrowserKit/Client.php b/src/Symfony/Component/BrowserKit/Client.php index dcffdd6e13..fa470ae0f0 100644 --- a/src/Symfony/Component/BrowserKit/Client.php +++ b/src/Symfony/Component/BrowserKit/Client.php @@ -78,7 +78,7 @@ abstract class Client { $this->followRedirects = (Boolean) $followRedirect; } - + /** * Sets the maximum number of requests that crawler can follow. * @@ -329,7 +329,7 @@ abstract class Client $this->cookieJar->updateFromResponse($this->internalResponse, $uri); $status = $this->internalResponse->getStatus(); - + if ($status >= 300 && $status < 400) { $this->redirect = $this->internalResponse->getHeader('Location'); } else { diff --git a/src/Symfony/Component/BrowserKit/CookieJar.php b/src/Symfony/Component/BrowserKit/CookieJar.php index 90571b2d53..e6b61d24ed 100644 --- a/src/Symfony/Component/BrowserKit/CookieJar.php +++ b/src/Symfony/Component/BrowserKit/CookieJar.php @@ -59,7 +59,7 @@ class CookieJar } // avoid relying on this behavior that is mainly here for BC reasons - foreach ($this->cookieJar as $domain => $cookies) { + foreach ($this->cookieJar as $cookies) { if (isset($cookies[$path][$name])) { return $cookies[$path][$name]; } diff --git a/src/Symfony/Component/BrowserKit/Tests/ClientTest.php b/src/Symfony/Component/BrowserKit/Tests/ClientTest.php index d0609a64a3..1d653b4b18 100644 --- a/src/Symfony/Component/BrowserKit/Tests/ClientTest.php +++ b/src/Symfony/Component/BrowserKit/Tests/ClientTest.php @@ -367,7 +367,7 @@ class ClientTest extends \PHPUnit_Framework_TestCase $this->assertInstanceof('LogicException', $e, '->followRedirect() throws a \LogicException if the request did not respond with 30x HTTP Code'); } } - + public function testFollowRedirectWithMaxRedirects() { $client = new TestClient(); diff --git a/src/Symfony/Component/Console/Application.php b/src/Symfony/Component/Console/Application.php index a3998a82e7..138248d87b 100644 --- a/src/Symfony/Component/Console/Application.php +++ b/src/Symfony/Component/Console/Application.php @@ -859,9 +859,7 @@ class Application if (true === $input->hasParameterOption(array('--no-interaction', '-n'))) { $input->setInteractive(false); - } - - if (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) { + } elseif (function_exists('posix_isatty') && $this->getHelperSet()->has('dialog')) { $inputStream = $this->getHelperSet()->get('dialog')->getInputStream(); if (!posix_isatty($inputStream)) { $input->setInteractive(false); diff --git a/src/Symfony/Component/Console/Helper/DescriptorHelper.php b/src/Symfony/Component/Console/Helper/DescriptorHelper.php index b897a33fec..0317d5d08d 100644 --- a/src/Symfony/Component/Console/Helper/DescriptorHelper.php +++ b/src/Symfony/Component/Console/Helper/DescriptorHelper.php @@ -11,16 +11,11 @@ namespace Symfony\Component\Console\Helper; -use Symfony\Component\Console\Application; -use Symfony\Component\Console\Command\Command; use Symfony\Component\Console\Descriptor\DescriptorInterface; use Symfony\Component\Console\Descriptor\JsonDescriptor; use Symfony\Component\Console\Descriptor\MarkdownDescriptor; use Symfony\Component\Console\Descriptor\TextDescriptor; use Symfony\Component\Console\Descriptor\XmlDescriptor; -use Symfony\Component\Console\Input\InputArgument; -use Symfony\Component\Console\Input\InputDefinition; -use Symfony\Component\Console\Input\InputOption; use Symfony\Component\Console\Output\OutputInterface; /** diff --git a/src/Symfony/Component/Console/Helper/DialogHelper.php b/src/Symfony/Component/Console/Helper/DialogHelper.php index 7fc2b3a739..98d37ad254 100644 --- a/src/Symfony/Component/Console/Helper/DialogHelper.php +++ b/src/Symfony/Component/Console/Helper/DialogHelper.php @@ -57,7 +57,7 @@ class DialogHelper extends Helper if ($multiselect) { // Check for a separated comma values - if(!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) { + if (!preg_match('/^[a-zA-Z0-9_-]+(?:,[a-zA-Z0-9_-]+)*$/', $selectedChoices, $matches)) { throw new \InvalidArgumentException(sprintf($errorMessage, $picked)); } $selectedChoices = explode(",", $selectedChoices); @@ -74,10 +74,10 @@ class DialogHelper extends Helper array_push($multiselectChoices, $value); } - if ($multiselect){ + if ($multiselect) { return $multiselectChoices; - } - + } + return $picked; }, $attempts, $default); diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index bc1f038bc6..a557261144 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -63,7 +63,7 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase { $application = new Application('foo', 'bar'); $this->assertEquals('foo', $application->getName(), '__construct() takes the application name as its first argument'); - $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its first argument'); + $this->assertEquals('bar', $application->getVersion(), '__construct() takes the application version as its second argument'); $this->assertEquals(array('help', 'list'), array_keys($application->all()), '__construct() registered the help and list commands by default'); } diff --git a/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php b/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php index d60f3e4a67..ea69c8ba3b 100644 --- a/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php +++ b/src/Symfony/Component/Console/Tests/Command/HelpCommandTest.php @@ -53,7 +53,6 @@ class HelpCommandTest extends \PHPUnit_Framework_TestCase $this->assertRegExp('/list \[--xml\] \[--raw\] \[--format="\.\.\."\] \[namespace\]/', $commandTester->getDisplay(), '->execute() returns a text help for the given command'); } - public function testExecuteForApplicationCommandWithXmlOption() { $application = new Application(); diff --git a/src/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php b/src/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php index 296efed5c0..aab1cf3761 100644 --- a/src/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php +++ b/src/Symfony/Component/Console/Tests/Descriptor/AbstractDescriptorTest.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Console\Tests\Descriptor; use Symfony\Component\Console\Application; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Descriptor\DescriptorInterface; use Symfony\Component\Console\Input\InputArgument; use Symfony\Component\Console\Input\InputDefinition; use Symfony\Component\Console\Input\InputOption; diff --git a/src/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php b/src/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php index a367321746..a3c49d74fe 100644 --- a/src/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php +++ b/src/Symfony/Component/Console/Tests/Descriptor/ObjectsProvider.php @@ -18,7 +18,6 @@ use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication1; use Symfony\Component\Console\Tests\Fixtures\DescriptorApplication2; use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand1; use Symfony\Component\Console\Tests\Fixtures\DescriptorCommand2; -use Symfony\Component\Finder\Shell\Command; /** * @author Jean-François Simon diff --git a/src/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php b/src/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php index 8c8f6f1ee8..5cc6693a01 100644 --- a/src/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php +++ b/src/Symfony/Component/CssSelector/XPath/Extension/FunctionExtension.php @@ -90,7 +90,7 @@ class FunctionExtension extends AbstractExtension if (0 !== $b) { $expr .= ' - '.$b; } - + $conditions = array(sprintf('%s %s 0', $expr, $sign)); if (1 !== $a && -1 !== $a) { @@ -98,7 +98,7 @@ class FunctionExtension extends AbstractExtension } return $xpath->addCondition(implode(' and ', $conditions)); - + // todo: handle an+b, odd, even // an+b means every-a, plus b, e.g., 2n+1 means odd // 0n+b means b diff --git a/src/Symfony/Component/Debug/ErrorHandler.php b/src/Symfony/Component/Debug/ErrorHandler.php index 07ee7c1b6c..dfb7dad003 100644 --- a/src/Symfony/Component/Debug/ErrorHandler.php +++ b/src/Symfony/Component/Debug/ErrorHandler.php @@ -104,6 +104,7 @@ class ErrorHandler $stack = array_map( function ($row) { unset($row['args']); + return $row; }, array_slice(debug_backtrace(false), 0, 10) diff --git a/src/Symfony/Component/Debug/Exception/ContextErrorException.php b/src/Symfony/Component/Debug/Exception/ContextErrorException.php index 1d145f8531..54f0198f1b 100644 --- a/src/Symfony/Component/Debug/Exception/ContextErrorException.php +++ b/src/Symfony/Component/Debug/Exception/ContextErrorException.php @@ -19,18 +19,18 @@ namespace Symfony\Component\Debug\Exception; class ContextErrorException extends \ErrorException { private $context = array(); - + public function __construct($message, $code, $severity, $filename, $lineno, $context = array()) { parent::__construct($message, $code, $severity, $filename, $lineno); $this->context = $context; } - + /** * @return array Array of variables that existed when the exception occurred */ public function getContext() { return $this->context; - } + } } diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index a78acef486..e5c3fd22eb 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -853,7 +853,11 @@ EOF; private function addAliases() { if (!$aliases = $this->container->getAliases()) { - return ''; + if ($this->container->isFrozen()) { + return "\n \$this->aliases = array();\n"; + } else { + return ''; + } } $code = " \$this->aliases = array(\n"; diff --git a/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php b/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php index d8d5dac470..475d26f3a1 100644 --- a/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php +++ b/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/DumperInterface.php @@ -11,7 +11,6 @@ namespace Symfony\Component\DependencyInjection\LazyProxy\PhpDumper; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; /** diff --git a/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php b/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php index e1d4ff4dea..83a2909fc2 100644 --- a/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php +++ b/src/Symfony/Component/DependencyInjection/LazyProxy/PhpDumper/NullDumper.php @@ -11,7 +11,6 @@ namespace Symfony\Component\DependencyInjection\LazyProxy\PhpDumper; -use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\Definition; /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php index b12d74ea9e..2185acf183 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Dumper/PhpDumperTest.php @@ -134,6 +134,18 @@ class PhpDumperTest extends \PHPUnit_Framework_TestCase $this->assertSame($foo, $container->get('alias_for_alias')); } + public function testFrozenContainerWithoutAliases() + { + $container = new ContainerBuilder(); + $container->compile(); + + $dumper = new PhpDumper($container); + eval('?>'.$dumper->dump(array('class' => 'Symfony_DI_PhpDumper_Test_Frozen_No_Aliases'))); + + $container = new \Symfony_DI_PhpDumper_Test_Frozen_No_Aliases(); + $this->assertFalse($container->has('foo')); + } + public function testOverrideServiceWhenUsingADumpedContainer() { require_once self::$fixturesPath.'/php/services9.php'; diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php index 15c16709d3..8796df8ae5 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services10.php @@ -36,6 +36,8 @@ class ProjectServiceContainer extends Container $this->methodMap = array( 'test' => 'getTestService', ); + + $this->aliases = array(); } /** diff --git a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php index 89856038b2..e6aa3410a2 100644 --- a/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php +++ b/src/Symfony/Component/DependencyInjection/Tests/Fixtures/php/services11.php @@ -34,6 +34,8 @@ class ProjectServiceContainer extends Container $this->methodMap = array( 'foo' => 'getFooService', ); + + $this->aliases = array(); } /** diff --git a/src/Symfony/Component/DomCrawler/Form.php b/src/Symfony/Component/DomCrawler/Form.php index d30a8b1ddc..936a5941b3 100644 --- a/src/Symfony/Component/DomCrawler/Form.php +++ b/src/Symfony/Component/DomCrawler/Form.php @@ -351,6 +351,7 @@ class Form extends Link implements \ArrayAccess throw new \LogicException(sprintf('The selected node has an invalid form attribute (%s).', $formId)); } $this->node = $form; + return; } // we loop until we find a form ancestor diff --git a/src/Symfony/Component/DomCrawler/Tests/LinkTest.php b/src/Symfony/Component/DomCrawler/Tests/LinkTest.php index 136723a668..e051f142ad 100644 --- a/src/Symfony/Component/DomCrawler/Tests/LinkTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/LinkTest.php @@ -122,7 +122,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase array('../bar/./../../foo', 'http://localhost/bar/foo/', 'http://localhost/foo'), array('../../', 'http://localhost/', 'http://localhost/'), array('../../', 'http://localhost', 'http://localhost/'), - + array('/foo', 'file:///', 'file:///foo'), array('/foo', 'file:///bar/baz', 'file:///foo'), array('foo', 'file:///', 'file:///foo'), diff --git a/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php b/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php index f044c34315..65edb1e465 100644 --- a/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php +++ b/src/Symfony/Component/Finder/Tests/Iterator/RealIteratorTestCase.php @@ -88,7 +88,6 @@ abstract class RealIteratorTestCase extends IteratorTestCase } if (is_string($files)) { - return self::$tmpDir.DIRECTORY_SEPARATOR.str_replace('/', DIRECTORY_SEPARATOR, $files); } diff --git a/src/Symfony/Component/Form/ButtonBuilder.php b/src/Symfony/Component/Form/ButtonBuilder.php index 2a19d58e06..3addedbde9 100644 --- a/src/Symfony/Component/Form/ButtonBuilder.php +++ b/src/Symfony/Component/Form/ButtonBuilder.php @@ -446,7 +446,7 @@ class ButtonBuilder implements \IteratorAggregate, FormBuilderInterface * This method should not be invoked. * * @param FormFactoryInterface $formFactory - * + * * @return void * * @throws BadMethodCallException diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php index b6f8fb70cb..4d0bdfaae0 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/MergeCollectionListener.php @@ -124,7 +124,6 @@ class MergeCollectionListener implements EventSubscriberInterface $event->setData($dataToMergeInto); } - /** * Alias of {@link onSubmit()}. * diff --git a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php index fabeb3664a..f1c39db245 100644 --- a/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php +++ b/src/Symfony/Component/Form/Extension/Core/EventListener/ResizeFormListener.php @@ -149,7 +149,6 @@ class ResizeFormListener implements EventSubscriberInterface $event->setData($data); } - /** * Alias of {@link preSubmit()}. * diff --git a/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php b/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php index c9c979a6e6..3482ba6634 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/CountryType.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Intl\Intl; -use Symfony\Component\Locale\Locale; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class CountryType extends AbstractType diff --git a/src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php b/src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php index 07b820d823..3a925e3a3d 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/CurrencyType.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Intl\Intl; -use Symfony\Component\Locale\Locale; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class CurrencyType extends AbstractType diff --git a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php index eb1897cee4..0c39d3eb6c 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/FormType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/FormType.php @@ -156,7 +156,6 @@ class FormType extends BaseType if (null !== $options['virtual']) { // Uncomment this as soon as the deprecation note should be shown // trigger_error('The form option "virtual" is deprecated since version 2.3 and will be removed in 3.0. Use "inherit_data" instead.', E_USER_DEPRECATED); - return $options['virtual']; } diff --git a/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php b/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php index 04994a0775..37b2bf3300 100644 --- a/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php +++ b/src/Symfony/Component/Form/Extension/Core/Type/LanguageType.php @@ -13,7 +13,6 @@ namespace Symfony\Component\Form\Extension\Core\Type; use Symfony\Component\Form\AbstractType; use Symfony\Component\Intl\Intl; -use Symfony\Component\Locale\Locale; use Symfony\Component\OptionsResolver\OptionsResolverInterface; class LanguageType extends AbstractType diff --git a/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php b/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php index dcb6ede2b3..cc4851566d 100644 --- a/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php +++ b/src/Symfony/Component/Form/Extension/HttpFoundation/HttpFoundationRequestHandler.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Form\Extension\HttpFoundation; -use Symfony\Component\Form\Exception\InvalidArgumentException; use Symfony\Component\Form\Exception\UnexpectedTypeException; use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\RequestHandlerInterface; diff --git a/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php b/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php index 2105997242..344bddadc1 100644 --- a/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php +++ b/src/Symfony/Component/Form/Extension/Validator/Type/FormTypeValidatorExtension.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Form\Extension\Validator\Type; -use Symfony\Component\Form\AbstractTypeExtension; use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper; use Symfony\Component\Form\Extension\Validator\EventListener\ValidationListener; diff --git a/src/Symfony/Component/Form/FormConfigBuilder.php b/src/Symfony/Component/Form/FormConfigBuilder.php index dc9c8f038e..1015da4f51 100644 --- a/src/Symfony/Component/Form/FormConfigBuilder.php +++ b/src/Symfony/Component/Form/FormConfigBuilder.php @@ -358,7 +358,6 @@ class FormConfigBuilder implements FormConfigBuilderInterface { // Uncomment this as soon as the deprecation note should be shown // trigger_error('getVirtual() is deprecated since version 2.3 and will be removed in 3.0. Use getInheritData() instead.', E_USER_DEPRECATED); - return $this->getInheritData(); } diff --git a/src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTest.php b/src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTest.php index ef36f1c052..bfa1e21805 100644 --- a/src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTest.php +++ b/src/Symfony/Component/Form/Tests/Extension/Core/Type/BaseTypeTest.php @@ -130,6 +130,6 @@ abstract class BaseTypeTest extends \Symfony\Component\Form\Test\TypeTestCase $this->assertFalse($view->vars['multipart']); } - + abstract protected function getTestedType(); } diff --git a/src/Symfony/Component/HttpFoundation/JsonResponse.php b/src/Symfony/Component/HttpFoundation/JsonResponse.php index eafccaa844..7284be3985 100644 --- a/src/Symfony/Component/HttpFoundation/JsonResponse.php +++ b/src/Symfony/Component/HttpFoundation/JsonResponse.php @@ -89,7 +89,7 @@ class JsonResponse extends Response public function setData($data = array()) { // Encode <, >, ', &, and " for RFC4627-compliant JSON, which may also be embedded into HTML. - $this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT); + $this->data = json_encode($data, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_NUMERIC_CHECK); return $this->update(); } diff --git a/src/Symfony/Component/HttpFoundation/RequestMatcher.php b/src/Symfony/Component/HttpFoundation/RequestMatcher.php index 769ca66ecd..da95c3acc1 100644 --- a/src/Symfony/Component/HttpFoundation/RequestMatcher.php +++ b/src/Symfony/Component/HttpFoundation/RequestMatcher.php @@ -155,7 +155,6 @@ class RequestMatcher implements RequestMatcherInterface // Note to future implementors: add additional checks above the // foreach above or else your check might not be run! - return count($this->ips) === 0; } } diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php index bf515c79a6..14ae52f97b 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/NativeSessionStorageTest.php @@ -13,11 +13,8 @@ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage; use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler; use Symfony\Component\HttpFoundation\Session\Storage\NativeSessionStorage; -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeFileSessionHandler; -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NullSessionHandler; use Symfony\Component\HttpFoundation\Session\Flash\FlashBag; use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; -use Symfony\Component\HttpFoundation\Session\Storage\Proxy\AbstractProxy; use Symfony\Component\HttpFoundation\Session\Storage\Proxy\NativeProxy; use Symfony\Component\HttpFoundation\Session\Storage\Proxy\SessionHandlerProxy; diff --git a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php index a0663910ca..d5a66d61ef 100644 --- a/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php +++ b/src/Symfony/Component/HttpFoundation/Tests/Session/Storage/PhpBridgeSessionStorageTest.php @@ -11,7 +11,6 @@ namespace Symfony\Component\HttpFoundation\Tests\Session\Storage; -use Symfony\Component\HttpFoundation\Session\Storage\Handler\NativeSessionHandler; use Symfony\Component\HttpFoundation\Session\Storage\PhpBridgeSessionStorage; use Symfony\Component\HttpFoundation\Session\Attribute\AttributeBag; diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php b/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php index 7e036fdf0f..1a24da0270 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/ConfigurableExtension.php @@ -32,7 +32,7 @@ abstract class ConfigurableExtension extends Extension */ final public function load(array $configs, ContainerBuilder $container) { - $this->loadInternal($this->processConfiguration($this->getConfiguration(array(), $container), $configs), $container); + $this->loadInternal($this->processConfiguration($this->getConfiguration($configs, $container), $configs), $container); } /** diff --git a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php index 1f059da94a..4f237c2215 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php +++ b/src/Symfony/Component/HttpKernel/Fragment/HIncludeFragmentRenderer.php @@ -110,7 +110,7 @@ class HIncludeFragmentRenderer extends RoutableFragmentRenderer } $renderedAttributes = ''; if (count($attributes) > 0) { - foreach($attributes as $attribute => $value) { + foreach ($attributes as $attribute => $value) { $renderedAttributes .= sprintf( ' %s="%s"', htmlspecialchars($attribute, ENT_QUOTES | ENT_SUBSTITUTE, $this->charset, false), diff --git a/src/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php b/src/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php index 1cbdeab18e..9725a5cd64 100644 --- a/src/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php +++ b/src/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php @@ -52,7 +52,15 @@ class InlineFragmentRenderer extends RoutableFragmentRenderer $reference = null; if ($uri instanceof ControllerReference) { $reference = $uri; + + // Remove attributes from the genereated URI because if not, the Symfony + // routing system will use them to populate the Request attributes. We don't + // want that as we want to preserve objects (so we manually set Request attributes + // below instead) + $attributes = $reference->attributes; + $reference->attributes = array(); $uri = $this->generateFragmentUri($uri, $request); + $reference->attributes = $attributes; } $subRequest = $this->createSubRequest($uri, $request); diff --git a/src/Symfony/Component/HttpKernel/HttpKernel.php b/src/Symfony/Component/HttpKernel/HttpKernel.php index ae7a44cd4d..837a16ff37 100644 --- a/src/Symfony/Component/HttpKernel/HttpKernel.php +++ b/src/Symfony/Component/HttpKernel/HttpKernel.php @@ -52,7 +52,7 @@ class HttpKernel implements HttpKernelInterface, TerminableInterface /** * {@inheritdoc} - * + * * @api */ public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true) diff --git a/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php index c6efa91b76..a5f507cd4e 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Debug/TraceableEventDispatcherTest.php @@ -16,9 +16,6 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\Event; use Symfony\Component\HttpKernel\Debug\TraceableEventDispatcher; use Symfony\Component\HttpKernel\HttpKernel; -use Symfony\Component\HttpKernel\HttpKernelInterface; -use Symfony\Component\HttpKernel\Event\GetResponseEvent; -use Symfony\Component\HttpKernel\KernelEvents; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\Stopwatch\Stopwatch; @@ -194,7 +191,6 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase ->method('isStarted') ->will($this->returnValue(false)); - $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), $stopwatch); $kernel = $this->getHttpKernel($dispatcher, function () { return new Response(); }); diff --git a/src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php b/src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php index c7ae7dd9aa..a6cfba211a 100644 --- a/src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php +++ b/src/Symfony/Component/HttpKernel/Tests/Fragment/InlineFragmentRendererTest.php @@ -51,11 +51,7 @@ class InlineFragmentRendererTest extends \PHPUnit_Framework_TestCase $object = new \stdClass(); $subRequest = Request::create('/_fragment?_path=_format%3Dhtml%26_controller%3Dmain_controller'); - $subRequest->attributes->replace(array( - 'object' => $object, - '_format' => 'html', - '_controller' => 'main_controller', - )); + $subRequest->attributes->replace(array('object' => $object)); $subRequest->headers->set('x-forwarded-for', array('127.0.0.1')); $subRequest->server->set('HTTP_X_FORWARDED_FOR', '127.0.0.1'); diff --git a/src/Symfony/Component/Intl/Intl.php b/src/Symfony/Component/Intl/Intl.php index 71ffca6caa..c13899a441 100644 --- a/src/Symfony/Component/Intl/Intl.php +++ b/src/Symfony/Component/Intl/Intl.php @@ -16,15 +16,8 @@ use Symfony\Component\Icu\IcuData; use Symfony\Component\Icu\IcuLanguageBundle; use Symfony\Component\Icu\IcuLocaleBundle; use Symfony\Component\Icu\IcuRegionBundle; -use Symfony\Component\Intl\Exception\InvalidArgumentException; -use Symfony\Component\Intl\ResourceBundle\Reader\BinaryBundleReader; use Symfony\Component\Intl\ResourceBundle\Reader\BufferedBundleReader; -use Symfony\Component\Intl\ResourceBundle\Reader\PhpBundleReader; use Symfony\Component\Intl\ResourceBundle\Reader\StructuredBundleReader; -use Symfony\Component\Intl\ResourceBundle\Stub\StubCurrencyBundle; -use Symfony\Component\Intl\ResourceBundle\Stub\StubLanguageBundle; -use Symfony\Component\Intl\ResourceBundle\Stub\StubLocaleBundle; -use Symfony\Component\Intl\ResourceBundle\Stub\StubRegionBundle; /** * Gives access to internationalization data. diff --git a/src/Symfony/Component/Intl/Locale/Locale.php b/src/Symfony/Component/Intl/Locale/Locale.php index 1217f97ba5..cca4e9e4f1 100644 --- a/src/Symfony/Component/Intl/Locale/Locale.php +++ b/src/Symfony/Component/Intl/Locale/Locale.php @@ -11,7 +11,6 @@ namespace Symfony\Component\Intl\Locale; -use Symfony\Component\Intl\Exception\NotImplementedException; use Symfony\Component\Intl\Exception\MethodNotImplementedException; /** diff --git a/src/Symfony/Component/Intl/ResourceBundle/Reader/BufferedBundleReader.php b/src/Symfony/Component/Intl/ResourceBundle/Reader/BufferedBundleReader.php index ad17f9b49b..e44074b168 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Reader/BufferedBundleReader.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Reader/BufferedBundleReader.php @@ -23,7 +23,6 @@ class BufferedBundleReader implements BundleReaderInterface */ private $reader; - private $buffer; /** diff --git a/src/Symfony/Component/Intl/ResourceBundle/Writer/PhpBundleWriter.php b/src/Symfony/Component/Intl/ResourceBundle/Writer/PhpBundleWriter.php index 5738f1daff..d2688b49bc 100644 --- a/src/Symfony/Component/Intl/ResourceBundle/Writer/PhpBundleWriter.php +++ b/src/Symfony/Component/Intl/ResourceBundle/Writer/PhpBundleWriter.php @@ -21,7 +21,7 @@ class PhpBundleWriter implements BundleWriterInterface /** * {@inheritdoc} */ - function write($path, $locale, $data) + public function write($path, $locale, $data) { $template = <<