From b272419ab99e761321a8fe1d00ce64d0ec2c17b9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Girard?= Date: Wed, 19 Jun 2013 15:25:31 +0200 Subject: [PATCH 01/15] Fixed variable name used in translation cache --- .../Tests/Translation/TranslatorTest.php | 28 +++++++++++++++++-- .../Translation/Translator.php | 8 ++++-- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php index 99751d1239..de918c85f0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Translation/TranslatorTest.php @@ -45,13 +45,15 @@ class TranslatorTest extends \PHPUnit_Framework_TestCase { $translator = $this->getTranslator($this->getLoader()); $translator->setLocale('fr'); - $translator->setFallbackLocale(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->setFallbackLocale(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->setFallbackLocale(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; } From c60bdf545934e16ba04fca16810525d38ee4952d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Wed, 26 Jun 2013 10:23:02 +0200 Subject: [PATCH 02/15] removed unused code --- .../CompilerPass/RegisterMappingsPass.php | 2 -- src/Symfony/Component/Intl/Util/IntlTestHelper.php | 8 ++++---- 2 files changed, 4 insertions(+), 6 deletions(-) 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/Component/Intl/Util/IntlTestHelper.php b/src/Symfony/Component/Intl/Util/IntlTestHelper.php index 6b4bd096c7..cace36c6f5 100644 --- a/src/Symfony/Component/Intl/Util/IntlTestHelper.php +++ b/src/Symfony/Component/Intl/Util/IntlTestHelper.php @@ -39,11 +39,11 @@ class IntlTestHelper // * the intl extension is loaded with version Intl::getIcuStubVersion() // * the intl extension is not loaded - if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) { + if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', 1)) { $testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion()); } - if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) { + if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', 1)) { $testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.' . IcuVersion::normalize(Intl::getIcuStubVersion(), 1) . '.x'); } @@ -75,12 +75,12 @@ class IntlTestHelper } // ... and only if the version is *one specific version* ... - if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) { + if (IcuVersion::compare(Intl::getIcuVersion(), Intl::getIcuStubVersion(), '!=', 1)) { $testCase->markTestSkipped('Please change ICU version to ' . Intl::getIcuStubVersion()); } // ... and only if the data in the Icu component matches that version. - if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', $precision = 1)) { + if (IcuVersion::compare(Intl::getIcuDataVersion(), Intl::getIcuStubVersion(), '!=', 1)) { $testCase->markTestSkipped('Please change the Icu component to version 1.0.x or 1.' . IcuVersion::normalize(Intl::getIcuStubVersion(), 1) . '.x'); } From a830001ca31f6c1a7453a3ab713e2e7b173965f1 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Wed, 26 Jun 2013 14:56:23 +0200 Subject: [PATCH 03/15] Passed the config when building the Configuration in ConfigurableExtension --- .../HttpKernel/DependencyInjection/ConfigurableExtension.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } /** From 1b0f69373c787705d67380dfbef01d0af095a3ab Mon Sep 17 00:00:00 2001 From: Luis Cordova Date: Wed, 26 Jun 2013 18:04:51 -0500 Subject: [PATCH 04/15] typo first->second --- src/Symfony/Component/Console/Tests/ApplicationTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Console/Tests/ApplicationTest.php b/src/Symfony/Component/Console/Tests/ApplicationTest.php index 7ab65a2381..f78d8de107 100644 --- a/src/Symfony/Component/Console/Tests/ApplicationTest.php +++ b/src/Symfony/Component/Console/Tests/ApplicationTest.php @@ -57,7 +57,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'); } From 0cc8872cab6d15112408f24cb58def50fe9bf6c6 Mon Sep 17 00:00:00 2001 From: Christophe Coevoet Date: Thu, 27 Jun 2013 13:04:11 +0200 Subject: [PATCH 05/15] Added missing French validator translations --- .../Resources/translations/validators.fr.xlf | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index 3a6b59eae6..caa457823d 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -242,6 +242,42 @@ This value is not a valid ISSN. Cette valeur n'est pas un code ISSN valide. + + This value is not a valid currency. + Cette valeur n'est pas une devise valide. + + + This value should be equal to {{ compared_value }}. + Cette valeur doit être égale à {{ compared_value }}. + + + This value should be greater than {{ compared_value }}. + Cette valeur doit être supérieure à {{ compared_value }}. + + + This value should be greater than or equal to {{ compared_value }}. + Cette valeur doit être supérieure ou égale à {{ compared_value }}. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Cette valeur doit être identique à {{ compared_value_type }} {{ compared_value }}. + + + This value should be less than {{ compared_value }}. + Cette valeur doit être inférieure à {{ compared_value }}. + + + This value should be less than or equal to {{ compared_value }}. + Cette valeur doit être inférieure ou égale à {{ compared_value }}. + + + This value should not be equal to {{ compared_value }}. + Cette valeur ne doit pas être égale à {{ compared_value }}. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Cette valeur ne doit pas être identique à {{ compared_value_type }} {{ compared_value }}. + From e46fd4e8fa48f7b4adf358727755b280f7b32c5d Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Sun, 30 Jun 2013 20:29:16 +0200 Subject: [PATCH 06/15] [Console] Avoided an unnecessary check. It only makes sense to do the second check if the --no-interaction option was not passed. Running posix_isatty() raises a warning with some stream types (like MEMORY). With this patch, warning could be avoided by passing the --no-interaction option. --- src/Symfony/Component/Console/Application.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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); From fdf2d6228c7920c51c16668324aec150a27d823d Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 1 Jul 2013 14:15:46 +0200 Subject: [PATCH 07/15] fixed CS --- src/Symfony/Component/CssSelector/Node/FunctionNode.php | 2 +- src/Symfony/Component/DomCrawler/Tests/LinkTest.php | 2 +- .../Component/Finder/Tests/Iterator/RealIteratorTestCase.php | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/CssSelector/Node/FunctionNode.php b/src/Symfony/Component/CssSelector/Node/FunctionNode.php index 4cc3a949d4..2041e886c3 100644 --- a/src/Symfony/Component/CssSelector/Node/FunctionNode.php +++ b/src/Symfony/Component/CssSelector/Node/FunctionNode.php @@ -129,7 +129,7 @@ class FunctionNode implements NodeInterface if (0 !== $b) { $expr .= ' - '.$b; } - + $conditions = array(sprintf('%s %s 0', $expr, $sign)); if (1 !== $a && -1 !== $a) { diff --git a/src/Symfony/Component/DomCrawler/Tests/LinkTest.php b/src/Symfony/Component/DomCrawler/Tests/LinkTest.php index be1c22c3f4..c5af655a53 100644 --- a/src/Symfony/Component/DomCrawler/Tests/LinkTest.php +++ b/src/Symfony/Component/DomCrawler/Tests/LinkTest.php @@ -118,7 +118,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 6f45708016..aef3096267 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); } From 4c0bfd3313615195cde3d66fcf256cca5beddee7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 1 Jul 2013 14:24:43 +0200 Subject: [PATCH 08/15] fixed CS --- .../CompilerPass/RegisterMappingsPass.php | 1 - .../Tests/LazyProxy/ContainerBuilderTest.php | 2 -- .../Tests/LazyProxy/Dumper/PhpDumperTest.php | 3 -- .../LazyProxy/Fixtures/php/lazy_service.php | 1 - .../Instantiator/RuntimeInstantiatorTest.php | 1 - .../LazyProxy/PhpDumper/ProxyDumperTest.php | 2 -- .../Command/TranslationUpdateCommand.php | 1 - .../Compiler/SerializerPass.php | 6 ++-- .../Templating/Helper/FormHelper.php | 1 - .../Compiler/SerializerPassTest.php | 34 +++++++++---------- .../DependencyInjection/ConfigurationTest.php | 2 +- .../Controller/SubRequestController.php | 1 - .../Tests/Templating/TimedPhpEngineTest.php | 2 -- .../SecurityRoutingIntegrationTest.php | 6 ++-- src/Symfony/Component/BrowserKit/Client.php | 4 +-- .../Component/BrowserKit/Tests/ClientTest.php | 2 +- .../Console/Event/ConsoleCommandEvent.php | 2 -- .../Console/Helper/DescriptorHelper.php | 5 --- .../Component/Console/Helper/DialogHelper.php | 8 ++--- .../Console/Tests/Command/HelpCommandTest.php | 1 - .../Descriptor/AbstractDescriptorTest.php | 1 - .../Tests/Descriptor/ObjectsProvider.php | 1 - .../XPath/Extension/FunctionExtension.php | 4 +-- src/Symfony/Component/Debug/ErrorHandler.php | 1 + .../Debug/Exception/ContextErrorException.php | 6 ++-- .../LazyProxy/PhpDumper/DumperInterface.php | 1 - .../LazyProxy/PhpDumper/NullDumper.php | 1 - src/Symfony/Component/DomCrawler/Form.php | 1 + src/Symfony/Component/Form/ButtonBuilder.php | 2 +- .../EventListener/MergeCollectionListener.php | 1 - .../Core/EventListener/ResizeFormListener.php | 1 - .../Form/Extension/Core/Type/CountryType.php | 1 - .../Form/Extension/Core/Type/CurrencyType.php | 1 - .../Form/Extension/Core/Type/FormType.php | 1 - .../Form/Extension/Core/Type/LanguageType.php | 1 - .../HttpFoundationRequestHandler.php | 1 - .../Type/FormTypeValidatorExtension.php | 1 - .../Component/Form/FormConfigBuilder.php | 1 - .../Extension/Core/Type/BaseTypeTest.php | 2 +- .../HttpFoundation/RequestMatcher.php | 1 - .../Storage/NativeSessionStorageTest.php | 3 -- .../Storage/PhpBridgeSessionStorageTest.php | 1 - .../Fragment/HIncludeFragmentRenderer.php | 2 +- .../Component/HttpKernel/HttpKernel.php | 2 +- .../Debug/TraceableEventDispatcherTest.php | 4 --- src/Symfony/Component/Intl/Intl.php | 7 ---- src/Symfony/Component/Intl/Locale/Locale.php | 1 - .../Reader/BufferedBundleReader.php | 1 - .../ResourceBundle/Writer/PhpBundleWriter.php | 2 +- .../Resources/bin/copy-stubs-to-component.php | 7 ---- .../AbstractIntlDateFormatterTest.php | 2 -- .../DateFormatter/IntlDateFormatterTest.php | 1 - .../Tests/Globals/AbstractIntlGlobalsTest.php | 1 - .../Intl/Tests/Locale/AbstractLocaleTest.php | 2 -- .../AbstractNumberFormatterTest.php | 1 - .../Tests/ResourceBundle/LocaleBundleTest.php | 2 -- .../Tests/ResourceBundle/RegionBundleTest.php | 1 - .../Component/Locale/Tests/LocaleTest.php | 1 - .../Locale/Tests/Stub/StubLocaleTest.php | 1 - src/Symfony/Component/Process/Process.php | 6 ++-- .../Component/Process/ProcessUtils.php | 2 +- .../Process/Tests/SignalListener.php | 4 +-- .../Tests/Fixtures/MagicianCall.php | 1 - .../Acl/Permission/BasicPermissionMap.php | 14 ++++---- .../Serializer/Encoder/JsonDecode.php | 2 +- .../Normalizer/GetSetMethodNormalizer.php | 4 +-- .../Validator/Constraints/IbanValidator.php | 1 + .../Tests/Constraints/IsbnValidatorTest.php | 2 +- 68 files changed, 62 insertions(+), 131 deletions(-) diff --git a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php index 983f1f45d7..faa8f75216 100644 --- a/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php +++ b/src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php @@ -12,7 +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; 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/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/Templating/TimedPhpEngineTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TimedPhpEngineTest.php index 595be96d28..76912e0286 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TimedPhpEngineTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/Templating/TimedPhpEngineTest.php @@ -13,9 +13,7 @@ namespace Symfony\Bundle\FrameworkBundle\Tests\Templating; use Symfony\Bundle\FrameworkBundle\Templating\TimedPhpEngine; use Symfony\Component\DependencyInjection\Container; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Session\Session; -use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; use Symfony\Component\Templating\TemplateNameParser; use Symfony\Bundle\FrameworkBundle\Templating\GlobalVariables; use Symfony\Bundle\FrameworkBundle\Tests\TestCase; 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/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/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/Event/ConsoleCommandEvent.php b/src/Symfony/Component/Console/Event/ConsoleCommandEvent.php index c754299ae0..222838ce6a 100644 --- a/src/Symfony/Component/Console/Event/ConsoleCommandEvent.php +++ b/src/Symfony/Component/Console/Event/ConsoleCommandEvent.php @@ -12,8 +12,6 @@ namespace Symfony\Component\Console\Event; use Symfony\Component\Console\Command\Command; -use Symfony\Component\Console\Input\InputInterface; -use Symfony\Component\Console\Output\OutputInterface; /** * Allows to do things before the command is executed. 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/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 2e0115f0cf..ea27922808 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 occured */ public function getContext() { return $this->context; - } + } } 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/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/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/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/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/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/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 = <<