From 1251f0e0b2e1562b2347e8f077e4ea5e152a36f6 Mon Sep 17 00:00:00 2001 From: Abdellatif Ait boudad Date: Mon, 12 Jan 2015 11:17:42 +0000 Subject: [PATCH 01/17] [FrameworkBundle][config] allow multiple fallback locales. --- .../DependencyInjection/Configuration.php | 7 ++++++- .../DependencyInjection/FrameworkExtension.php | 7 ++----- .../Resources/config/schema/symfony-1.0.xsd | 3 +++ .../DependencyInjection/ConfigurationTest.php | 2 +- .../Fixtures/php/translator_fallbacks.php | 7 +++++++ .../Fixtures/xml/translator_fallbacks.xml | 15 +++++++++++++++ .../Fixtures/yml/translator_fallbacks.yml | 3 +++ .../FrameworkExtensionTest.php | 8 ++++++++ 8 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/translator_fallbacks.xml create mode 100644 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/translator_fallbacks.yml diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index c7f8a4de4c..d4ef0f968b 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -364,8 +364,13 @@ class Configuration implements ConfigurationInterface ->arrayNode('translator') ->info('translator configuration') ->canBeEnabled() + ->fixXmlConfig('fallback') ->children() - ->scalarNode('fallback')->defaultValue('en')->end() + ->arrayNode('fallbacks') + ->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end() + ->prototype('scalar')->end() + ->defaultValue(array('en')) + ->end() ->end() ->end() ->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php index 0988c5fe1b..50c3f72fa7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php @@ -226,7 +226,7 @@ class FrameworkExtension extends Extension 'memcached' => 'Symfony\Component\HttpKernel\Profiler\MemcachedProfilerStorage', 'redis' => 'Symfony\Component\HttpKernel\Profiler\RedisProfilerStorage', ); - list($class,) = explode(':', $config['dsn'], 2); + list($class, ) = explode(':', $config['dsn'], 2); if (!isset($supported[$class])) { throw new \LogicException(sprintf('Driver "%s" is not supported for the profiler.', $class)); } @@ -534,10 +534,7 @@ class FrameworkExtension extends Extension // Use the "real" translator instead of the identity default $container->setAlias('translator', 'translator.default'); $translator = $container->findDefinition('translator.default'); - if (!is_array($config['fallback'])) { - $config['fallback'] = array($config['fallback']); - } - $translator->addMethodCall('setFallbackLocales', array($config['fallback'])); + $translator->addMethodCall('setFallbackLocales', array($config['fallbacks'])); // Discover translation directories $dirs = array(); diff --git a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd index 17b817c325..39e9ada7c9 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd +++ b/src/Symfony/Bundle/FrameworkBundle/Resources/config/schema/symfony-1.0.xsd @@ -125,6 +125,9 @@ + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 1bcb01189e..319e643d29 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -115,7 +115,7 @@ class ConfigurationTest extends \PHPUnit_Framework_TestCase ), 'translator' => array( 'enabled' => false, - 'fallback' => 'en', + 'fallbacks' => array('en'), ), 'validation' => array( 'enabled' => false, diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php new file mode 100644 index 0000000000..0abe3a46ab --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/php/translator_fallbacks.php @@ -0,0 +1,7 @@ +loadFromExtension('framework', array( + 'translator' => array( + 'fallbacks' => array('en', 'fr'), + ), +)); diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/translator_fallbacks.xml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/translator_fallbacks.xml new file mode 100644 index 0000000000..a0e4f4ed32 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/xml/translator_fallbacks.xml @@ -0,0 +1,15 @@ + + + + + + + en + fr + + + diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/translator_fallbacks.yml b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/translator_fallbacks.yml new file mode 100644 index 0000000000..271d781184 --- /dev/null +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/Fixtures/yml/translator_fallbacks.yml @@ -0,0 +1,3 @@ +framework: + translator: + fallbacks: [en, fr] diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php index acf9e374ad..9915efadd0 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php @@ -206,6 +206,14 @@ abstract class FrameworkExtensionTest extends TestCase $this->assertEquals(array('fr'), $calls[0][1][0]); } + public function testTranslatorMultipleFullback() + { + $container = $this->createContainerFromFile('translator_fallbacks'); + + $calls = $container->getDefinition('translator.default')->getMethodCalls(); + $this->assertEquals(array('en', 'fr'), $calls[0][1][0]); + } + /** * @expectedException \Symfony\Component\Config\Definition\Exception\InvalidConfigurationException */ From 58bf5822b2c73fe3b2dec3956fbb3e045a8d1d67 Mon Sep 17 00:00:00 2001 From: Dawid Sajdak Date: Mon, 26 Jan 2015 14:32:32 +0100 Subject: [PATCH 02/17] Unique Entity Validator Invalid Value --- .../Constraints/UniqueEntityValidatorTest.php | 31 +++++++++++++++++++ .../Constraints/UniqueEntityValidator.php | 3 +- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php index 12a1e2c0b2..1565e6ffb4 100644 --- a/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php +++ b/src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueEntityValidatorTest.php @@ -238,6 +238,37 @@ class UniqueEntityValidatorTest extends AbstractConstraintValidatorTest ->assertRaised(); } + public function testValidateUniquenessWithValidCustomErrorPath() + { + $constraint = new UniqueEntity(array( + 'message' => 'myMessage', + 'fields' => array('name', 'name2'), + 'em' => self::EM_NAME, + 'errorPath' => "name2", + )); + + $entity1 = new DoubleNameEntity(1, 'Foo', "Bar"); + $entity2 = new DoubleNameEntity(2, 'Foo', "Bar"); + + $this->validator->validate($entity1, $constraint); + + $this->assertNoViolation(); + + $this->em->persist($entity1); + $this->em->flush(); + + $this->validator->validate($entity1, $constraint); + + $this->assertNoViolation(); + + $this->validator->validate($entity2, $constraint); + + $this->buildViolation('myMessage') + ->atPath('property.path.name2') + ->setInvalidValue('Bar') + ->assertRaised(); + } + public function testValidateUniquenessUsingCustomRepositoryMethod() { $constraint = new UniqueEntity(array( diff --git a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php index e4bbcaff9b..4c6724a136 100644 --- a/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php +++ b/src/Symfony/Bridge/Doctrine/Validator/Constraints/UniqueEntityValidator.php @@ -128,7 +128,8 @@ class UniqueEntityValidator extends ConstraintValidator } $errorPath = null !== $constraint->errorPath ? $constraint->errorPath : $fields[0]; + $invalidValue = isset($criteria[$errorPath]) ? $criteria[$errorPath] : $criteria[$fields[0]]; - $this->context->addViolationAt($errorPath, $constraint->message, array(), $criteria[$fields[0]]); + $this->context->addViolationAt($errorPath, $constraint->message, array(), $invalidValue); } } From 915fcd8dec2a5c52942496172e4240b2ad3e8199 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 26 Jan 2015 18:32:08 +0100 Subject: [PATCH 03/17] [Validator] drop grapheme_strlen in LengthValidator --- .../Validator/Constraints/LengthValidator.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/LengthValidator.php b/src/Symfony/Component/Validator/Constraints/LengthValidator.php index ceccde5a61..69e0ea76a9 100644 --- a/src/Symfony/Component/Validator/Constraints/LengthValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LengthValidator.php @@ -35,12 +35,20 @@ class LengthValidator extends ConstraintValidator $stringValue = (string) $value; - if (function_exists('grapheme_strlen') && 'UTF-8' === $constraint->charset) { - $length = grapheme_strlen($stringValue); + if ('UTF8' === $charset = strtoupper($constraint->charset)) { + $charset = 'UTF-8'; + } + + if (function_exists('iconv_strlen')) { + $length = iconv_strlen($stringValue, $constraint->charset); } elseif (function_exists('mb_strlen')) { $length = mb_strlen($stringValue, $constraint->charset); - } else { + } elseif ('UTF-8' !== $charset) { $length = strlen($stringValue); + } elseif (function_exists('utf8_decode')) { + $length = strlen(utf8_decode($stringValue)); + } else { + preg_replace('/./u', '', $stringValue, -1, $length); } if ($constraint->min == $constraint->max && $length != $constraint->min) { From 3a9058a7d767b969c587adb488592cad4781ebf5 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Mon, 26 Jan 2015 21:06:31 +0100 Subject: [PATCH 04/17] [Validator] reject ill-formed strings --- .../Validator/Constraints/Length.php | 1 + .../Validator/Constraints/LengthValidator.php | 21 +++- .../Resources/translations/validators.en.xlf | 4 + .../Resources/translations/validators.fr.xlf | 4 + .../Tests/Constraints/LengthValidatorTest.php | 95 +++++++++++-------- 5 files changed, 83 insertions(+), 42 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/Length.php b/src/Symfony/Component/Validator/Constraints/Length.php index b353e9b24d..49f4890c81 100644 --- a/src/Symfony/Component/Validator/Constraints/Length.php +++ b/src/Symfony/Component/Validator/Constraints/Length.php @@ -27,6 +27,7 @@ class Length extends Constraint public $maxMessage = 'This value is too long. It should have {{ limit }} character or less.|This value is too long. It should have {{ limit }} characters or less.'; public $minMessage = 'This value is too short. It should have {{ limit }} character or more.|This value is too short. It should have {{ limit }} characters or more.'; public $exactMessage = 'This value should have exactly {{ limit }} character.|This value should have exactly {{ limit }} characters.'; + public $charsetMessage = 'This value does not match the expected {{ charset }} charset.'; public $max; public $min; public $charset = 'UTF-8'; diff --git a/src/Symfony/Component/Validator/Constraints/LengthValidator.php b/src/Symfony/Component/Validator/Constraints/LengthValidator.php index 69e0ea76a9..a184883b92 100644 --- a/src/Symfony/Component/Validator/Constraints/LengthValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LengthValidator.php @@ -34,23 +34,40 @@ class LengthValidator extends ConstraintValidator } $stringValue = (string) $value; + $invalidCharset = false; if ('UTF8' === $charset = strtoupper($constraint->charset)) { $charset = 'UTF-8'; } if (function_exists('iconv_strlen')) { - $length = iconv_strlen($stringValue, $constraint->charset); + $length = @iconv_strlen($stringValue, $constraint->charset); + $invalidCharset = false === $length; } elseif (function_exists('mb_strlen')) { - $length = mb_strlen($stringValue, $constraint->charset); + if (mb_check_encoding($stringValue, $constraint->charset)) { + $length = mb_strlen($stringValue, $constraint->charset); + } else { + $invalidCharset = true; + } } elseif ('UTF-8' !== $charset) { $length = strlen($stringValue); + } elseif (!preg_match('//u', $stringValue)) { + $invalidCharset = true; } elseif (function_exists('utf8_decode')) { $length = strlen(utf8_decode($stringValue)); } else { preg_replace('/./u', '', $stringValue, -1, $length); } + if ($invalidCharset) { + $this->context->addViolation($constraint->charsetMessage, array( + '{{ value }}' => $this->formatValue($stringValue), + '{{ charset }}' => $constraint->charset, + ), $value); + + return; + } + if ($constraint->min == $constraint->max && $length != $constraint->min) { $this->context->addViolation($constraint->exactMessage, array( '{{ value }}' => $this->formatValue($stringValue), diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index b4c8b60bd4..160e21dc9e 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + + This value does not match the expected {{ charset }} charset. + This value does not match the expected {{ charset }} charset. + diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index 0ad0592079..4108a8a48b 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Cette valeur ne doit pas être identique à {{ compared_value_type }} {{ compared_value }}. + + This value does not match the expected {{ charset }} charset. + Cette valeur ne correspond pas au jeu de caractères {{ charset }} attendu. + diff --git a/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php b/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php index 1d492a53e1..6147e424fe 100644 --- a/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php +++ b/src/Symfony/Component/Validator/Tests/Constraints/LengthValidatorTest.php @@ -48,12 +48,12 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest return array( array(12), array('12'), - array('üü', true), - array('éé', true), + array('üü'), + array('éé'), array(123), array('123'), - array('üüü', true), - array('ééé', true), + array('üüü'), + array('ééé'), ); } @@ -62,8 +62,8 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest return array( array(1234), array('1234'), - array('üüüü', true), - array('éééé', true), + array('üüüü'), + array('éééé'), ); } @@ -80,24 +80,34 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest return array( array(12345), array('12345'), - array('üüüüü', true), - array('ééééé', true), + array('üüüüü'), + array('ééééé'), array(123456), array('123456'), - array('üüüüüü', true), - array('éééééé', true), + array('üüüüüü'), + array('éééééé'), + ); + } + + public function getOneCharset() + { + if (!function_exists('iconv') && !function_exists('mb_convert_encoding')) { + $this->markTestSkipped('Mbstring or iconv is required for this test.'); + } + + return array( + array("é", "utf8", true), + array("\xE9", "CP1252", true), + array("\xE9", "XXX", false), + array("\xE9", "utf8", false), ); } /** * @dataProvider getFiveOrMoreCharacters */ - public function testValidValuesMin($value, $mbOnly = false) + public function testValidValuesMin($value) { - if ($mbOnly && !function_exists('mb_strlen')) { - $this->markTestSkipped('mb_strlen does not exist'); - } - $constraint = new Length(array('min' => 5)); $this->validator->validate($value, $constraint); @@ -107,12 +117,8 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest /** * @dataProvider getThreeOrLessCharacters */ - public function testValidValuesMax($value, $mbOnly = false) + public function testValidValuesMax($value) { - if ($mbOnly && !function_exists('mb_strlen')) { - $this->markTestSkipped('mb_strlen does not exist'); - } - $constraint = new Length(array('max' => 3)); $this->validator->validate($value, $constraint); @@ -122,12 +128,8 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest /** * @dataProvider getFourCharacters */ - public function testValidValuesExact($value, $mbOnly = false) + public function testValidValuesExact($value) { - if ($mbOnly && !function_exists('mb_strlen')) { - $this->markTestSkipped('mb_strlen does not exist'); - } - $constraint = new Length(4); $this->validator->validate($value, $constraint); @@ -137,12 +139,8 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest /** * @dataProvider getThreeOrLessCharacters */ - public function testInvalidValuesMin($value, $mbOnly = false) + public function testInvalidValuesMin($value) { - if ($mbOnly && !function_exists('mb_strlen')) { - $this->markTestSkipped('mb_strlen does not exist'); - } - $constraint = new Length(array( 'min' => 4, 'minMessage' => 'myMessage', @@ -161,12 +159,8 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest /** * @dataProvider getFiveOrMoreCharacters */ - public function testInvalidValuesMax($value, $mbOnly = false) + public function testInvalidValuesMax($value) { - if ($mbOnly && !function_exists('mb_strlen')) { - $this->markTestSkipped('mb_strlen does not exist'); - } - $constraint = new Length(array( 'max' => 4, 'maxMessage' => 'myMessage', @@ -185,12 +179,8 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest /** * @dataProvider getNotFourCharacters */ - public function testInvalidValuesExact($value, $mbOnly = false) + public function testInvalidValuesExact($value) { - if ($mbOnly && !function_exists('mb_strlen')) { - $this->markTestSkipped('mb_strlen does not exist'); - } - $constraint = new Length(array( 'min' => 4, 'max' => 4, @@ -207,6 +197,31 @@ class LengthValidatorTest extends AbstractConstraintValidatorTest ->assertRaised(); } + /** + * @dataProvider getOneCharset + */ + public function testOneCharset($value, $charset, $isValid) + { + $constraint = new Length(array( + 'min' => 1, + 'max' => 1, + 'charset' => $charset, + 'charsetMessage' => 'myMessage', + )); + + $this->validator->validate($value, $constraint); + + if ($isValid) { + $this->assertNoViolation(); + } else { + $this->buildViolation('myMessage') + ->setParameter('{{ value }}', '"'.$value.'"') + ->setParameter('{{ charset }}', $charset) + ->setInvalidValue($value) + ->assertRaised(); + } + } + public function testConstraintGetDefaultOption() { $constraint = new Length(5); From 458b02939fe74996273de7e686195776f1e0b350 Mon Sep 17 00:00:00 2001 From: Diego Saint Esteben Date: Wed, 28 Jan 2015 23:09:53 -0300 Subject: [PATCH 05/17] Inject the correct EventDispatcher instance --- .../Debug/TraceableEventDispatcher.php | 2 +- .../EventDispatcher/Debug/WrappedListener.php | 6 ++++-- .../Tests/Debug/TraceableEventDispatcherTest.php | 14 ++++++++++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php b/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php index b796a8125a..2119b81b3a 100644 --- a/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php +++ b/src/Symfony/Component/EventDispatcher/Debug/TraceableEventDispatcher.php @@ -216,7 +216,7 @@ class TraceableEventDispatcher implements TraceableEventDispatcherInterface $this->dispatcher->removeListener($eventName, $listener); $info = $this->getListenerInfo($listener, $eventName); $name = isset($info['class']) ? $info['class'] : $info['type']; - $this->dispatcher->addListener($eventName, new WrappedListener($listener, $name, $this->stopwatch)); + $this->dispatcher->addListener($eventName, new WrappedListener($listener, $name, $this->stopwatch, $this)); } } diff --git a/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php b/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php index c501662b07..e16627d6ad 100644 --- a/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php +++ b/src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php @@ -25,12 +25,14 @@ class WrappedListener private $called; private $stoppedPropagation; private $stopwatch; + private $dispatcher; - public function __construct($listener, $name, Stopwatch $stopwatch) + public function __construct($listener, $name, Stopwatch $stopwatch, EventDispatcherInterface $dispatcher = null) { $this->listener = $listener; $this->name = $name; $this->stopwatch = $stopwatch; + $this->dispatcher = $dispatcher; $this->called = false; $this->stoppedPropagation = false; } @@ -56,7 +58,7 @@ class WrappedListener $e = $this->stopwatch->start($this->name, 'event_listener'); - call_user_func($this->listener, $event, $eventName, $dispatcher); + call_user_func($this->listener, $event, $eventName, $this->dispatcher ?: $dispatcher); if ($e->isStarted()) { $e->stop(); diff --git a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php index 47dd5da168..68b9523654 100644 --- a/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php +++ b/src/Symfony/Component/EventDispatcher/Tests/Debug/TraceableEventDispatcherTest.php @@ -86,6 +86,20 @@ class TraceableEventDispatcherTest extends \PHPUnit_Framework_TestCase $this->assertEquals(array(), $tdispatcher->getNotCalledListeners()); } + public function testGetCalledListenersNested() + { + $tdispatcher = null; + $dispatcher = new TraceableEventDispatcher(new EventDispatcher(), new Stopwatch()); + $dispatcher->addListener('foo', function (Event $event, $eventName, $dispatcher) use (&$tdispatcher) { + $tdispatcher = $dispatcher; + $dispatcher->dispatch('bar'); + }); + $dispatcher->addListener('bar', function (Event $event) {}); + $dispatcher->dispatch('foo'); + $this->assertSame($dispatcher, $tdispatcher); + $this->assertCount(2, $dispatcher->getCalledListeners()); + } + public function testLogger() { $logger = $this->getMock('Psr\Log\LoggerInterface'); From 779926a9f21737f098eefc8655afe9b036c14d26 Mon Sep 17 00:00:00 2001 From: Dariusz Ruminski Date: Tue, 20 Jan 2015 20:40:22 +0100 Subject: [PATCH 06/17] Fix docblocks to comments --- .../Form/ChoiceList/ModelChoiceList.php | 4 +- .../Storage/Handler/NativeSessionHandler.php | 7 +-- .../Exception/FatalErrorException.php | 2 +- .../HttpKernel/Exception/FlattenException.php | 2 +- .../Serializer/Encoder/XmlEncoder.php | 6 +-- .../Constraints/CardSchemeValidator.php | 52 ++++++------------- 6 files changed, 24 insertions(+), 49 deletions(-) diff --git a/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php b/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php index 04d4f80ad2..cc4d76cf64 100644 --- a/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php +++ b/src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php @@ -178,7 +178,7 @@ class ModelChoiceList extends ObjectChoiceList return array(); } - /** + /* * This performance optimization reflects a common scenario: * * A simple select of a model entry. * * The choice option "expanded" is set to false. @@ -233,7 +233,7 @@ class ModelChoiceList extends ObjectChoiceList } if (!$this->loaded) { - /** + /* * This performance optimization assumes the validation of the respective values will be done by other means. * * It correlates with the performance optimization in {@link ModelChoiceList::getChoicesForValues()} diff --git a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php index 80d3ab892d..95d5cdbf56 100644 --- a/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php +++ b/src/Symfony/Component/HttpFoundation/Session/Storage/Handler/NativeSessionHandler.php @@ -11,11 +11,8 @@ namespace Symfony\Component\HttpFoundation\Session\Storage\Handler; -/** - * Adds SessionHandler functionality if available. - * - * @see http://php.net/sessionhandler - */ +// Adds SessionHandler functionality if available. +// @see http://php.net/sessionhandler if (PHP_VERSION_ID >= 50400) { class NativeSessionHandler extends \SessionHandler { diff --git a/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php b/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php index 0e7beda8e2..7a1cd23381 100644 --- a/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php +++ b/src/Symfony/Component/HttpKernel/Exception/FatalErrorException.php @@ -11,7 +11,7 @@ namespace Symfony\Component\HttpKernel\Exception; -/** +/* * Fatal Error Exception. * * @author Konstanton Myakshin diff --git a/src/Symfony/Component/HttpKernel/Exception/FlattenException.php b/src/Symfony/Component/HttpKernel/Exception/FlattenException.php index c84b6fa7ae..ebe45b4580 100644 --- a/src/Symfony/Component/HttpKernel/Exception/FlattenException.php +++ b/src/Symfony/Component/HttpKernel/Exception/FlattenException.php @@ -11,7 +11,7 @@ namespace Symfony\Component\HttpKernel\Exception; -/** +/* * FlattenException wraps a PHP Exception to be able to serialize it. * * Basically, this class removes all objects from the trace. diff --git a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php index c8b34e373f..fd63872894 100644 --- a/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/XmlEncoder.php @@ -313,11 +313,9 @@ class XmlEncoder extends SerializerAwareEncoder implements EncoderInterface, Dec } elseif ($key === '#') { $append = $this->selectNodeType($parentNode, $data); } elseif (is_array($data) && false === is_numeric($key)) { - /** - * Is this array fully numeric keys? - */ + // Is this array fully numeric keys? if (ctype_digit(implode('', array_keys($data)))) { - /** + /* * Create nodes to append to $parentNode based on the $key of this array * Produces 01 * From array("item" => array(0,1));. diff --git a/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php b/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php index cb511eee92..37efe89234 100644 --- a/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php +++ b/src/Symfony/Component/Validator/Constraints/CardSchemeValidator.php @@ -25,72 +25,52 @@ use Symfony\Component\Validator\ConstraintValidator; class CardSchemeValidator extends ConstraintValidator { protected $schemes = array( - /** - * American Express card numbers start with 34 or 37 and have 15 digits. - */ + // American Express card numbers start with 34 or 37 and have 15 digits. 'AMEX' => array( '/^3[47][0-9]{13}$/', ), - /** - * China UnionPay cards start with 62 and have between 16 and 19 digits. - * Please note that these cards do not follow Luhn Algorithm as a checksum. - */ + // China UnionPay cards start with 62 and have between 16 and 19 digits. + // Please note that these cards do not follow Luhn Algorithm as a checksum. 'CHINA_UNIONPAY' => array( '/^62[0-9]{14,17}$/', ), - /** - * Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits. - * There are Diners Club cards that begin with 5 and have 16 digits. - * These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard. - */ + // Diners Club card numbers begin with 300 through 305, 36 or 38. All have 14 digits. + // There are Diners Club cards that begin with 5 and have 16 digits. + // These are a joint venture between Diners Club and MasterCard, and should be processed like a MasterCard. 'DINERS' => array( '/^3(?:0[0-5]|[68][0-9])[0-9]{11}$/', ), - /** - * Discover card numbers begin with 6011, 622126 through 622925, 644 through 649 or 65. - * All have 16 digits. - */ + // Discover card numbers begin with 6011, 622126 through 622925, 644 through 649 or 65. + // All have 16 digits. 'DISCOVER' => array( '/^6011[0-9]{12}$/', '/^64[4-9][0-9]{13}$/', '/^65[0-9]{14}$/', '/^622(12[6-9]|1[3-9][0-9]|[2-8][0-9][0-9]|91[0-9]|92[0-5])[0-9]{10}$/', ), - /** - * InstaPayment cards begin with 637 through 639 and have 16 digits. - */ + // InstaPayment cards begin with 637 through 639 and have 16 digits. 'INSTAPAYMENT' => array( '/^63[7-9][0-9]{13}$/', ), - /** - * JCB cards beginning with 2131 or 1800 have 15 digits. - * JCB cards beginning with 35 have 16 digits. - */ + // JCB cards beginning with 2131 or 1800 have 15 digits. + // JCB cards beginning with 35 have 16 digits. 'JCB' => array( '/^(?:2131|1800|35[0-9]{3})[0-9]{11}$/', ), - /** - * Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits. - */ + // Laser cards begin with either 6304, 6706, 6709 or 6771 and have between 16 and 19 digits. 'LASER' => array( '/^(6304|670[69]|6771)[0-9]{12,15}$/', ), - /** - * Maestro cards begin with either 5018, 5020, 5038, 5893, 6304, 6759, 6761, 6762, 6763 or 0604 - * They have between 12 and 19 digits. - */ + // Maestro cards begin with either 5018, 5020, 5038, 5893, 6304, 6759, 6761, 6762, 6763 or 0604 + // They have between 12 and 19 digits. 'MAESTRO' => array( '/^(5018|5020|5038|6304|6759|6761|676[23]|0604)[0-9]{8,15}$/', ), - /** - * All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. - */ + // All MasterCard numbers start with the numbers 51 through 55. All have 16 digits. 'MASTERCARD' => array( '/^5[1-5][0-9]{14}$/', ), - /** - * All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13. - */ + // All Visa card numbers start with a 4. New cards have 16 digits. Old cards have 13. 'VISA' => array( '/^4([0-9]{12}|[0-9]{15})$/', ), From 92c6e5585c59c92cfd3db9e2eec4735810518ef9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Jan 2015 14:54:52 +0100 Subject: [PATCH 07/17] updated CHANGELOG for 2.3.25 --- CHANGELOG-2.3.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG-2.3.md b/CHANGELOG-2.3.md index c7acce7993..b3c47ea7c2 100644 --- a/CHANGELOG-2.3.md +++ b/CHANGELOG-2.3.md @@ -7,6 +7,28 @@ in 2.3 minor versions. To get the diff for a specific change, go to https://github.com/symfony/symfony/commit/XXX where XXX is the change hash To get the diff between two versions, go to https://github.com/symfony/symfony/compare/v2.3.0...v2.3.1 +* 2.3.25 (2015-01-30) + + * bug #13528 [Validator] reject ill-formed strings (nicolas-grekas) + * bug #13525 [Validator] UniqueEntityValidator - invalidValue fixed. (Dawid Sajdak) + * bug #13527 [Validator] drop grapheme_strlen in LengthValidator (nicolas-grekas) + * bug #13376 [FrameworkBundle][config] allow multiple fallback locales. (aitboudad) + * bug #12972 Make the container considered non-fresh if the environment parameters are changed (thewilkybarkid) + * bug #13309 [Console] fixed 10531 (nacmartin) + * bug #13352 [Yaml] fixed parse shortcut Key after unindented collection. (aitboudad) + * bug #13039 [HttpFoundation] [Request] fix baseUrl parsing to fix wrong path_info (rk3rn3r) + * bug #13250 [Twig][Bridge][TranslationDefaultDomain] add support of named arguments. (aitboudad) + * bug #13332 [Console] ArgvInput and empty tokens (Taluu) + * bug #13293 [EventDispatcher] Add missing checks to RegisterListenersPass (znerol) + * bug #13262 [Yaml] Improve YAML boolean escaping (petert82, larowlan) + * bug #13420 [Debug] fix loading order for legacy classes (nicolas-grekas) + * bug #13371 fix missing comma in YamlDumper (garak) + * bug #13365 [HttpFoundation] Make use of isEmpty() method (xelaris) + * bug #13347 [Console] Helper\TableHelper->addRow optimization (boekkooi) + * bug #13346 [PropertyAccessor] Allow null value for a array (2.3) (boekkooi) + * bug #13170 [Form] Set a child type to text if added to the form without a type. (jakzal) + * bug #13334 [Yaml] Fixed #10597: Improved Yaml directive parsing (VictoriaQ) + * 2.3.24 (2015-01-07) * bug #13286 [Security] Don't destroy the session on buggy php releases. (derrabus) From 8d3f5956e9b6fb34dfdb430182640725fbb00bc9 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Jan 2015 14:55:12 +0100 Subject: [PATCH 08/17] update CONTRIBUTORS for 2.3.25 --- CONTRIBUTORS.md | 62 +++++++++++++++++++++++++++++-------------------- 1 file changed, 37 insertions(+), 25 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 0598e0ee35..3a386a817f 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -13,19 +13,19 @@ Symfony is the result of the work of many people who made the code better - Kris Wallsmith (kriswallsmith) - Christophe Coevoet (stof) - Nicolas Grekas (nicolas-grekas) - - Pascal Borreli (pborreli) - Jakub Zalas (jakubzalas) + - Pascal Borreli (pborreli) + - Hugo Hamon (hhamon) - Karma Dordrak (drak) - Joseph Bielawski (stloyd) - - Hugo Hamon (hhamon) - Ryan Weaver (weaverryan) - Lukas Kahwe Smith (lsmith) - Romain Neutron (romain) - Jeremy Mikola (jmikola) - Jean-François Simon (jfsimon) + - Christian Flothmann (xabbuh) - Benjamin Eberlei (beberlei) - Igor Wiedler (igorw) - - Christian Flothmann (xabbuh) - Martin Hasoň (hason) - Eriksen Costa (eriksencosta) - Jonathan Wage (jwage) @@ -33,9 +33,9 @@ Symfony is the result of the work of many people who made the code better - Alexandre Salomé (alexandresalome) - William Durand (couac) - ornicar + - Wouter De Jong (wouterj) - stealth35 ‏ (stealth35) - Alexander Mols (asm89) - - Wouter De Jong (wouterj) - Bulat Shakirzyanov (avalanche123) - Francis Besset (francisbesset) - Saša Stamenković (umpirsky) @@ -44,15 +44,15 @@ Symfony is the result of the work of many people who made the code better - Konstantin Kudryashov (everzet) - Bilal Amarni (bamarni) - Florin Patan (florinpatan) + - Abdellatif Ait Boudad (aitboudad) - Eric Clemmons (ericclemmons) + - Sarah Khalil (saro0h) - Andrej Hudec (pulzarraider) - Deni - Henrik Westphal (snc) - Dariusz Górecki (canni) - Arnout Boks (aboks) - Christian Raue - - Sarah Khalil (saro0h) - - Ait Boudad Abdellatif (aitboudad) - Michel Weimerskirch (mweimerskirch) - Lee McDermott - Brandon Turner @@ -69,6 +69,7 @@ Symfony is the result of the work of many people who made the code better - Kevin Bond (kbond) - Tim Nagel (merk) - Brice BERNARD (brikou) + - Kévin Dunglas (dunglas) - marc.weistroff - lenar - Graham Campbell (graham) @@ -81,7 +82,7 @@ Symfony is the result of the work of many people who made the code better - Jérôme Tamarelle (gromnan) - Adrien Brault (adrienbrault) - Fabien Pennequin (fabienpennequin) - - Kévin Dunglas (dunglas) + - Peter Kokot (maastermedia) - Michal Piotrowski (eventhorizon) - Gordon Franke (gimler) - Robert Schönthal (digitalkaoz) @@ -89,13 +90,13 @@ Symfony is the result of the work of many people who made the code better - Sebastian Hörl (blogsh) - Daniel Gomes (danielcsgomes) - Hidenori Goto (hidenorigoto) - - Peter Kokot (maastermedia) - David Buchmann (dbu) + - Jérémy DERUSSÉ (jderusse) - Pablo Godel (pgodel) - Eric GELOEN (gelo) + - Peter Rehm (rpet) - Jérémie Augustin (jaugustin) - Rafael Dohms (rdohms) - - Jérémy DERUSSÉ (jderusse) - Stefano Sala (stefano.sala) - Tigran Azatyan (tigranazatyan) - Javier Eguiluz (javier.eguiluz) @@ -113,7 +114,6 @@ Symfony is the result of the work of many people who made the code better - Rouven Weßling (realityking) - Dmitrii Chekaliuk (lazyhammer) - Clément JOBEILI (dator) - - Peter Rehm (rpet) - Dorian Villet (gnutix) - Richard Miller (mr_r_miller) - Arnaud Kleinpeter (nanocom) @@ -130,25 +130,27 @@ Symfony is the result of the work of many people who made the code better - bronze1man - sun (sun) - Larry Garfield (crell) + - Issei Murasawa (issei_m) - Martin Schuhfuß (usefulthink) - Thomas Rabaix (rande) - Matthieu Bontemps (mbontemps) - Pierre Minnieur (pminnieur) - fivestar - Dominique Bongiraud + - Iltar van der Berg - Leszek Prabucki (l3l0) - François Zaninotto (fzaninotto) - Dustin Whittle (dustinwhittle) - jeff - Justin Hileman (bobthecow) - Sven Paulus (subsven) + - Alexander Schwenn (xelaris) - Lars Strojny (lstrojny) - Rui Marinho (ruimarinho) - Julien Brochet (mewt) - Tugdual Saunier (tucksaun) - Sergey Linnik (linniksa) - Marcel Beerta (mazen) - - Iltar van der Berg - Francois Zaninotto - Alexander Kotynia (olden) - Daniel Tschinder @@ -158,6 +160,7 @@ Symfony is the result of the work of many people who made the code better - Roman Marintšenko (inori) - Xavier Montaña Carreras (xmontana) - Michele Orselli (orso) + - Chris Wilkinson (thewilkybarkid) - Xavier Perez - Arjen Brouwer (arjenjb) - Katsuhiro OGAWA @@ -167,7 +170,6 @@ Symfony is the result of the work of many people who made the code better - Joseph Rouff (rouffj) - Félix Labrecque (woodspire) - GordonsLondon - - Issei Murasawa (issei_m) - Jan Sorgalla (jsor) - Ray - Chekote @@ -181,10 +183,13 @@ Symfony is the result of the work of many people who made the code better - Beau Simensen (simensen) - Robert Kiss (kepten) - Kim Hemsø Rasmussen (kimhemsoe) + - Florian Lonqueu-Brochard (florianlb) - Tom Van Looy (tvlooy) - Wouter Van Hecke + - Joshua Thijssen - Peter Kruithof (pkruithof) - Michael Holm (hollo) + - Warnar Boekkooi (boekkooi) - Marc Weistroff (futurecat) - Chris Smith (cs278) - Florian Klein (docteurklein) @@ -195,10 +200,10 @@ Symfony is the result of the work of many people who made the code better - Bertrand Zuchuat (garfield-fr) - Gabor Toth (tgabi333) - realmfoo - - Chris Wilkinson (thewilkybarkid) - Thomas Tourlourat (armetiz) - Andrey Esaulov (andremaha) - Grégoire Passault (gregwar) + - Mikael Pajunen - Uwe Jäger (uwej711) - Aurelijus Valeiša (aurelijus) - Jan Decavele (jandc) @@ -219,7 +224,6 @@ Symfony is the result of the work of many people who made the code better - alquerci - Francesco Levorato - Vitaliy Zakharov (zakharovvi) - - Florian Lonqueu-Brochard (florianlb) - Gyula Sallai (salla) - Inal DJAFAR (inalgnu) - Christian Gärtner (dagardner) @@ -227,7 +231,6 @@ Symfony is the result of the work of many people who made the code better - Yaroslav Kiliba - Sébastien Lavoie (lavoiesl) - Terje Bråten - - Joshua Thijssen - Kristen Gilden (kgilden) - Robbert Klarenbeek (robbertkl) - Blanchon Vincent (blanchonvincent) @@ -239,6 +242,7 @@ Symfony is the result of the work of many people who made the code better - Philipp Kräutli (pkraeutli) - Kirill chEbba Chebunin (chebba) - Greg Thornton (xdissent) + - Baptiste Clavié (talus) - Grégoire Paris (greg0ire) - Costin Bereveanu (schniper) - Loïc Chardonnet (gnusat) @@ -246,7 +250,6 @@ Symfony is the result of the work of many people who made the code better - Vyacheslav Salakhutdinov (megazoll) - Alex Pott - Tamas Szijarto - - Mikael Pajunen - Pavel Volokitin (pvolok) - Endre Fejes - Tobias Naumann (tna) @@ -254,6 +257,7 @@ Symfony is the result of the work of many people who made the code better - Shein Alexey - Joe Lencioni - Kai + - Lee Rowlands - Maximilian Reichel (phramz) - Karoly Negyesi (chx) - Xavier HAUSHERR @@ -275,6 +279,7 @@ Symfony is the result of the work of many people who made the code better - Michel Salib (michelsalib) - geoffrey - Matthieu Auger (matthieuauger) + - Lorenz Schori - Jeanmonod David (jeanmonod) - Jan Schumann - Niklas Fiekas @@ -287,6 +292,7 @@ Symfony is the result of the work of many people who made the code better - Konstantin Myakshin (koc) - vagrant - Asier Illarramendi (doup) + - Alexander M. Turek (derrabus) - Chris Sedlmayr (catchamonkey) - Seb Koelen - Christoph Mewes (xrstf) @@ -306,7 +312,6 @@ Symfony is the result of the work of many people who made the code better - Jérôme Macias (jeromemacias) - Fabian Lange (codingfabian) - Yoshio HANAWA - - Baptiste Clavié (talus) - Sebastian Bergmann - Pablo Díez (pablodip) - Kevin McBride @@ -337,6 +342,7 @@ Symfony is the result of the work of many people who made the code better - Nils Adermann (naderman) - Gábor Fási - Benjamin Leveque (benji07) + - Javier Spagnoletti (phansys) - sasezaki - Dawid Pakuła (zulusx) - Florian Rey (nervo) @@ -348,6 +354,7 @@ Symfony is the result of the work of many people who made the code better - Ryan - Alexander Deruwe (aderuwe) - François Pluchino (francoispluchino) + - Massimiliano Arione (garak) - Ivan Rey (ivanrey) - Marcin Chyłek (songoq) - Ned Schwartz @@ -356,12 +363,10 @@ Symfony is the result of the work of many people who made the code better - Zach Badgett (zachbadgett) - Aurélien Fredouelle - Pavel Campr (pcampr) - - Alexander Schwenn (xelaris) - Disquedur - Geoffrey Tran (geoff) - Jan Behrens - Sebastian Krebs - - Lorenz Schori - Christopher Davis (chrisguitarguy) - Thomas Lallement (raziel057) - alcaeus @@ -386,8 +391,6 @@ Symfony is the result of the work of many people who made the code better - Javier López (loalf) - Reinier Kip - Dustin Dobervich (dustin10) - - Warnar Boekkooi - - Alexander M. Turek (derrabus) - Sebastian Marek (proofek) - Erkhembayar Gantulga (erheme318) - David Fuhr @@ -410,6 +413,7 @@ Symfony is the result of the work of many people who made the code better - Antoine Corcy - Arturs Vonda - Sascha Grossenbacher + - Szijarto Tamas - Ben Davies (bendavies) - Simon Schick (simonsimcity) - redstar504 @@ -472,7 +476,6 @@ Symfony is the result of the work of many people who made the code better - Loick Piera (pyrech) - cgonzalez - Ben - - Lee Rowlands - Jayson Xu (superjavason) - Jaik Dean (jaikdean) - Harm van Tilborg @@ -490,7 +493,6 @@ Symfony is the result of the work of many people who made the code better - frost-nzcr4 - Abhoryo - Fabian Vogler (fabian) - - Javier Spagnoletti (phansys) - Korvin Szanto - Maksim Kotlyar (makasim) - Neil Ferreira @@ -538,7 +540,6 @@ Symfony is the result of the work of many people who made the code better - Maks - Gábor Tóth - Daniel Cestari - - Massimiliano Arione (garak) - Brunet Laurent (lbrunet) - Magnus Nordlander (magnusnordlander) - Mikhail Yurasov (mym) @@ -597,6 +598,7 @@ Symfony is the result of the work of many people who made the code better - Per Sandström (per) - Goran Juric - Laurent Ghirardotti (laurentg) + - Jan Rosier (rosier) - Lin Clark - Jeremy David (jeremy.david) - Troy McCabe @@ -604,6 +606,7 @@ Symfony is the result of the work of many people who made the code better - Boris Vujicic (boris.vujicic) - Max Beutel - Catalin Dan + - nacho - Piotr Antosik (antek88) - Artem Lopata - Marcos Quesada (marcos_quesada) @@ -658,7 +661,6 @@ Symfony is the result of the work of many people who made the code better - Yannick - Luc Vieillescazes (iamluc) - Eduardo García Sanz (coma) - - Szijarto Tamas - Roy Van Ginneken - David de Boer (ddeboer) - Gilles Doge (gido) @@ -673,6 +675,7 @@ Symfony is the result of the work of many people who made the code better - Derek Lambert - MightyBranch - Kacper Gunia (cakper) + - Peter Thompson (petert82) - Felicitus - Krzysztof Przybyszewski - Paul Matthews @@ -700,6 +703,7 @@ Symfony is the result of the work of many people who made the code better - Aharon Perkel - Abdul.Mohsen B. A. A - Benoît Burnichon + - pthompson - Malaney J. Hill - Christian Flach (cmfcmf) - Cédric Girard (enk_) @@ -738,6 +742,7 @@ Symfony is the result of the work of many people who made the code better - Jason Desrosiers - m.chwedziak - Lance McNearney + - Frank Neff (fneff) - Giorgio Premi - caponica - Matt Daum (daum) @@ -784,6 +789,7 @@ Symfony is the result of the work of many people who made the code better - Klaus Silveira (klaussilveira) - Thomas Chmielowiec (chmielot) - Jānis Lukss + - rkerner - Vladyslav Petrovych - Matthew J Mucklo - fdgdfg (psampaz) @@ -832,6 +838,7 @@ Symfony is the result of the work of many people who made the code better - Przemysław Piechota (kibao) - Leonid Terentyev (li0n) - Adam Prager (padam87) + - victoria - Francisco Facioni (fran6co) - Iwan van Staveren (istaveren) - Povilas S. (povilas) @@ -912,6 +919,7 @@ Symfony is the result of the work of many people who made the code better - Daan van Renterghem - Bram Van der Sype (brammm) - Julien Moulin (lizjulien) + - Nikita Nefedov (nikita2206) - Yannick Warnier (ywarnier) - Kevin Decherf - Jason Woods @@ -958,6 +966,7 @@ Symfony is the result of the work of many people who made the code better - Florian Pfitzer (marmelatze) - Martin Mayer (martin) - Grzegorz Łukaszewicz (newicz) + - Richard van Laak (rvanlaak) - grifx - Robert Campbell - Matt Lehner @@ -965,6 +974,7 @@ Symfony is the result of the work of many people who made the code better - Ruben Kruiswijk - Michael J - Berny Cantos + - Joseph Maarek - Alex Pods - timaschew - Ian Phillips @@ -1020,6 +1030,7 @@ Symfony is the result of the work of many people who made the code better - Pablo Monterde Perez (plebs) - Jimmy Leger (redpanda) - Cyrille Jouineau (tuxosaurus) + - Vadim Kharitonov (virtuozzz) - Yorkie Chadwick (yorkie76) - Yanick Witschi - Ondrej Mirtes @@ -1128,6 +1139,7 @@ Symfony is the result of the work of many people who made the code better - Andreas Forsblom (aforsblo) - Alaattin Kahramanlar (alaattin) - Alex Olmos (alexolmos) + - Alain Hippolyte (aloneh) - Antonio Mansilla (amansilla) - Juan Ases García (ases) - Daniel Basten (axhm3a) From 959733dc4b1da99b9e93a1762f4217eee20fc933 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 30 Jan 2015 14:55:40 +0100 Subject: [PATCH 09/17] updated VERSION for 2.3.25 --- src/Symfony/Component/HttpKernel/Kernel.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index 71602d052c..eed0c8cd2f 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -60,12 +60,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.3.25-DEV'; + const VERSION = '2.3.25'; const VERSION_ID = '20325'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '3'; const RELEASE_VERSION = '25'; - const EXTRA_VERSION = 'DEV'; + const EXTRA_VERSION = ''; /** * Constructor. From 713b8c87b47019119477f43f8f57ea7f5b420c34 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Fri, 30 Jan 2015 15:38:16 +0100 Subject: [PATCH 10/17] Test lowest deps with latest 5.3 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ec9bf6da4d..3c3ba5b4ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,7 +7,7 @@ matrix: - php: 5.4 - php: 5.5 - php: 5.6 - - php: 5.3.3 + - php: 5.3 env: components=low - php: 5.6 env: components=high From 0d562eb3e764082b8e577450227f3f5e36f97c21 Mon Sep 17 00:00:00 2001 From: Jakub Zalas Date: Fri, 30 Jan 2015 23:45:57 +0000 Subject: [PATCH 11/17] Add a Polish translation. --- .../Validator/Resources/translations/validators.pl.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf index 30888dc4d3..8d8404d7c8 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Ta wartość nie powinna być identycznego typu {{ compared_value_type }} oraz wartości {{ compared_value }}. + + This value does not match the expected {{ charset }} charset. + Ta wartość nie pasuje do oczekiwanego zestawu znaków {{ charset }}. + From bd804e6cdc12fcfbb911262eaec67f78bff3b3e2 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 31 Jan 2015 12:20:07 +0100 Subject: [PATCH 12/17] Add a Slovenian translation for invalid charset message --- .../Validator/Resources/translations/validators.sl.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf index 644b88e6a5..af39dc0010 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Ta vrednost ne bi smela biti identična {{ compared_value_type }} {{ compared_value }}. + + This value does not match the expected {{ charset }} charset. + Ta vrednost se ne ujema s pričakovanim naborom znakov {{ charset }}. + From 97576ff44e68b32f851f3cb58e0809aece39b66f Mon Sep 17 00:00:00 2001 From: Christian Flothmann Date: Sat, 31 Jan 2015 12:58:17 +0100 Subject: [PATCH 13/17] German translation for invalid charset message --- .../Validator/Resources/translations/validators.de.xlf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index 3d84e70b7b..e2d5e7a297 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Dieser Wert sollte nicht identisch sein mit {{ compared_value_type }} {{ compared_value }}. + + This value does not match the expected {{ charset }} charset. + Dieser Wert entspricht nicht dem erwarteten Zeichensatz {{ charset }}. + From 0f72a1eb2b47fed3620e99bc8272146897506d99 Mon Sep 17 00:00:00 2001 From: possum Date: Sat, 31 Jan 2015 19:01:54 +0100 Subject: [PATCH 14/17] Dutch translation for invalid charset message --- .../Validator/Resources/translations/validators.nl.xlf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf index 9189706ae0..ae058badd2 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf @@ -278,6 +278,10 @@ This value should not be identical to {{ compared_value }}. Deze waarde mag niet identiek zijn aan {{ compared_value }}. - + + This value does not match the expected {{ charset }} charset. + Deze waarde is niet in de verwachte tekencodering {{ charset }}. + + From 4425a3ffd844d21d88e9fe59b88a7b3abe49a1c7 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 1 Feb 2015 06:48:52 +0100 Subject: [PATCH 15/17] bumped Symfony version to 2.3.26 --- src/Symfony/Component/HttpKernel/Kernel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/HttpKernel/Kernel.php b/src/Symfony/Component/HttpKernel/Kernel.php index eed0c8cd2f..c6b7ee1142 100644 --- a/src/Symfony/Component/HttpKernel/Kernel.php +++ b/src/Symfony/Component/HttpKernel/Kernel.php @@ -60,12 +60,12 @@ abstract class Kernel implements KernelInterface, TerminableInterface protected $startTime; protected $loadClassCache; - const VERSION = '2.3.25'; - const VERSION_ID = '20325'; + const VERSION = '2.3.26-DEV'; + const VERSION_ID = '20326'; const MAJOR_VERSION = '2'; const MINOR_VERSION = '3'; - const RELEASE_VERSION = '25'; - const EXTRA_VERSION = ''; + const RELEASE_VERSION = '26'; + const EXTRA_VERSION = 'DEV'; /** * Constructor. From d03a905253977af3757d5ebce17bd669597428ab Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Sun, 1 Feb 2015 10:22:11 +0100 Subject: [PATCH 16/17] fixed id for translations --- .../Validator/Resources/translations/validators.de.xlf | 2 +- .../Validator/Resources/translations/validators.en.xlf | 2 +- .../Validator/Resources/translations/validators.fr.xlf | 2 +- .../Validator/Resources/translations/validators.nl.xlf | 2 +- .../Validator/Resources/translations/validators.pl.xlf | 2 +- .../Validator/Resources/translations/validators.sl.xlf | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf index e2d5e7a297..dd2129a260 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.de.xlf @@ -278,7 +278,7 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Dieser Wert sollte nicht identisch sein mit {{ compared_value_type }} {{ compared_value }}. - + This value does not match the expected {{ charset }} charset. Dieser Wert entspricht nicht dem erwarteten Zeichensatz {{ charset }}. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf index 160e21dc9e..766447c6a4 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.en.xlf @@ -278,7 +278,7 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. This value should not be identical to {{ compared_value_type }} {{ compared_value }}. - + This value does not match the expected {{ charset }} charset. This value does not match the expected {{ charset }} charset. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf index 4108a8a48b..aedcd30dbe 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.fr.xlf @@ -278,7 +278,7 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Cette valeur ne doit pas être identique à {{ compared_value_type }} {{ compared_value }}. - + This value does not match the expected {{ charset }} charset. Cette valeur ne correspond pas au jeu de caractères {{ charset }} attendu. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf index ae058badd2..d44c1ee238 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.nl.xlf @@ -278,7 +278,7 @@ This value should not be identical to {{ compared_value }}. Deze waarde mag niet identiek zijn aan {{ compared_value }}. - + This value does not match the expected {{ charset }} charset. Deze waarde is niet in de verwachte tekencodering {{ charset }}. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf index 8d8404d7c8..c4ebca85e2 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.pl.xlf @@ -278,7 +278,7 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Ta wartość nie powinna być identycznego typu {{ compared_value_type }} oraz wartości {{ compared_value }}. - + This value does not match the expected {{ charset }} charset. Ta wartość nie pasuje do oczekiwanego zestawu znaków {{ charset }}. diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf index af39dc0010..c862104c14 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.sl.xlf @@ -278,7 +278,7 @@ This value should not be identical to {{ compared_value_type }} {{ compared_value }}. Ta vrednost ne bi smela biti identična {{ compared_value_type }} {{ compared_value }}. - + This value does not match the expected {{ charset }} charset. Ta vrednost se ne ujema s pričakovanim naborom znakov {{ charset }}. From 760245423e04c70da9bb7df5202ba5c525d14370 Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Sun, 1 Feb 2015 16:46:51 +0100 Subject: [PATCH 17/17] [Validator] use 2.5 API in LengthValidator --- .../Component/Validator/Constraints/LengthValidator.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Symfony/Component/Validator/Constraints/LengthValidator.php b/src/Symfony/Component/Validator/Constraints/LengthValidator.php index 0634b4f476..7d97e19e02 100644 --- a/src/Symfony/Component/Validator/Constraints/LengthValidator.php +++ b/src/Symfony/Component/Validator/Constraints/LengthValidator.php @@ -64,10 +64,11 @@ class LengthValidator extends ConstraintValidator } if ($invalidCharset) { - $this->context->addViolation($constraint->charsetMessage, array( - '{{ value }}' => $this->formatValue($stringValue), - '{{ charset }}' => $constraint->charset, - ), $value); + $this->buildViolation($constraint->charsetMessage) + ->setParameter('{{ value }}', $this->formatValue($stringValue)) + ->setParameter('{{ charset }}', $constraint->charset) + ->setInvalidValue($value) + ->addViolation(); return; }