From 7d7380d9e791bd9d4a41237308096b1be092b0ec Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 25 Sep 2019 16:09:38 +0200 Subject: [PATCH 1/4] Fix return type of Process::restart(). --- src/Symfony/Component/Process/Process.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 3b45bd8c5e..c0c1fdaf69 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -363,7 +363,7 @@ class Process implements \IteratorAggregate * @param callable|null $callback A PHP callback to run whenever there is some * output available on STDOUT or STDERR * - * @return $this + * @return static * * @throws RuntimeException When process can't be launched * @throws RuntimeException When process is already running From 894a78e81284d98ce0283325395591aa656aa7aa Mon Sep 17 00:00:00 2001 From: Nicolas Grekas Date: Thu, 26 Sep 2019 12:56:22 +0200 Subject: [PATCH 2/4] [Cache] dont override native Memcached options --- src/Symfony/Component/Cache/Traits/MemcachedTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Symfony/Component/Cache/Traits/MemcachedTrait.php b/src/Symfony/Component/Cache/Traits/MemcachedTrait.php index 9b7a84ab59..999687de99 100644 --- a/src/Symfony/Component/Cache/Traits/MemcachedTrait.php +++ b/src/Symfony/Component/Cache/Traits/MemcachedTrait.php @@ -26,7 +26,7 @@ trait MemcachedTrait 'persistent_id' => null, 'username' => null, 'password' => null, - 'serializer' => 'php', + \Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_PHP, ]; private $client; From dde0256e63d16887368d9436196c9f2132f8687c Mon Sep 17 00:00:00 2001 From: Farhad Safarov Date: Thu, 26 Sep 2019 23:00:18 +0300 Subject: [PATCH 3/4] [Validator] Add the missing translations for the Azerbaijani locale --- .../Resources/translations/validators.az.xlf | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) diff --git a/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf b/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf index add868cd42..c3420f3db2 100644 --- a/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf +++ b/src/Symfony/Component/Validator/Resources/translations/validators.az.xlf @@ -222,6 +222,150 @@ Unsupported card type or invalid card number. Dəstəklənməyən kart tipi və ya yanlış kart nömrəsi. + + This is not a valid International Bank Account Number (IBAN). + Bu dəyər doğru bir Beynəlxalq Bank Hesap Nömrəsi (IBAN) deyil. + + + This value is not a valid ISBN-10. + Bu dəyər doğru bir ISBN-10 deyil. + + + This value is not a valid ISBN-13. + Bu dəyər doğru bir ISBN-13 deyil. + + + This value is neither a valid ISBN-10 nor a valid ISBN-13. + Bu dəyər doğru bir ISBN-10 və ya ISBN-13 deyil. + + + This value is not a valid ISSN. + Bu dəyər doğru bir ISSN deyil. + + + This value is not a valid currency. + Bu dəyər doğru bir valyuta deyil. + + + This value should be equal to {{ compared_value }}. + Bu dəyər {{ compared_value }} ilə bərabər olmalıdır. + + + This value should be greater than {{ compared_value }}. + Bu dəyər {{ compared_value }} dəyərindən büyük olmalıdır. + + + This value should be greater than or equal to {{ compared_value }}. + Bu dəyər {{ compared_value }} ilə bərabər və ya daha böyük olmaldır. + + + This value should be identical to {{ compared_value_type }} {{ compared_value }}. + Bu dəyər {{ compared_value_type }} {{ compared_value }} ilə eyni olmalıdır. + + + This value should be less than {{ compared_value }}. + Bu dəyər {{ compared_value }} dəyərindən kiçik olmalıdır. + + + This value should be less than or equal to {{ compared_value }}. + Bu dəyər {{ compared_value }} dəyərindən kiçik və ya bərabər olmalıdır. + + + This value should not be equal to {{ compared_value }}. + Bu değer {{ compared_value }} ile eşit olmamalıdır. + + + This value should not be identical to {{ compared_value_type }} {{ compared_value }}. + Bu dəyər {{ compared_value_type }} {{ compared_value }} ilə eyni olmamalıdır. + + + The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}. + Şəkil nisbəti çox büyükdür ({{ ratio }}). İcazə verilən maksimum nisbət: {{ max_ratio }}. + + + The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}. + Şəkil nisbəti çox balacadır ({{ ratio }}). İcazə verilən minimum nisbət: {{ min_ratio }}. + + + The image is square ({{ width }}x{{ height }}px). Square images are not allowed. + Şəkil kvadratdır ({{ width }}x{{ height }}px). Kvadrat şəkillərə icazə verilmir. + + + The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed. + Şəkil albom rejimindədir ({{ width }}x{{ height }}px). Albom rejimli şəkillərə icazə verilmir. + + + The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed. + Şəkil portret rejimindədir ({{ width }}x{{ height }}px). Portret rejimli şəkillərə icazə verilmir. + + + An empty file is not allowed. + Boş fayla icazə verilmir. + + + The host could not be resolved. + Ünvan tapılmadı. + + + This value does not match the expected {{ charset }} charset. + Bu dəyər gözlənilən {{ charset }} simvol cədvəli ilə uyğun gəlmir. + + + This is not a valid Business Identifier Code (BIC). + Bu dəyər doğru bir Biznes Təyinedici Kodu (BIC) deyil. + + + Error + Xəta + + + This is not a valid UUID. + Bu dəyər doğru bir UUID deyil. + + + This value should be a multiple of {{ compared_value }}. + Bu dəyər {{ compare_value }} dəyərinin bölənlərindən biri olmalıdır. + + + This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}. + Bu Biznes Təyinedici Kodu (BIC) {{ iban }} IBAN kodu ilə əlaqəli deyil. + + + This value should be valid JSON. + Bu dəyər doğru bir JSON olmalıdır. + + + This collection should contain only unique elements. + Bu kolleksiyada sadəcə unikal elementlər olmalıdır. + + + This value should be positive. + Bu dəyər müsbət olmalıdır. + + + This value should be either positive or zero. + Bu dəyər müsbət və ya sıfır olmalıdır. + + + This value should be negative. + Bu dəyər mənfi olmaldır. + + + This value should be either negative or zero. + Bu dəyər mənfi və ya sıfır olmaldır. + + + This value is not a valid timezone. + Bu dəyər doğru bir zaman zolağı deyil. + + + This password has been leaked in a data breach, it must not be used. Please use another password. + Bu parol data oğurluğunda tapıldığı üçün işlədilməməlidir. Zəhmət olmasa, başqa parol seçin. + + + This value should be between {{ min }} and {{ max }}. + Bu dəyər {{ min }} və {{ max }} arasında olmaldır. + From c7af2df340a659c713a87cb160b88bcda4a6a75c Mon Sep 17 00:00:00 2001 From: HypeMC Date: Mon, 22 Apr 2019 00:18:46 +0200 Subject: [PATCH 4/4] [FrameworkBundle] Fix framework bundle lock configuration not working as expected --- .../DependencyInjection/Configuration.php | 20 +++++- .../DependencyInjection/ConfigurationTest.php | 63 +++++++++++++++++++ 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php index 52c7706456..fea9263fc7 100644 --- a/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php +++ b/src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php @@ -929,7 +929,11 @@ class Configuration implements ConfigurationInterface ->ifString()->then(function ($v) { return ['enabled' => true, 'resources' => $v]; }) ->end() ->beforeNormalization() - ->ifTrue(function ($v) { return \is_array($v) && !isset($v['resources']); }) + ->ifTrue(function ($v) { return \is_array($v) && !isset($v['enabled']); }) + ->then(function ($v) { return $v + ['enabled' => true]; }) + ->end() + ->beforeNormalization() + ->ifTrue(function ($v) { return \is_array($v) && !isset($v['resources']) && !isset($v['resource']); }) ->then(function ($v) { $e = $v['enabled']; unset($v['enabled']); @@ -948,7 +952,19 @@ class Configuration implements ConfigurationInterface ->end() ->beforeNormalization() ->ifTrue(function ($v) { return \is_array($v) && array_keys($v) === range(0, \count($v) - 1); }) - ->then(function ($v) { return ['default' => $v]; }) + ->then(function ($v) { + $resources = []; + foreach ($v as $resource) { + $resources = array_merge_recursive( + $resources, + \is_array($resource) && isset($resource['name']) + ? [$resource['name'] => $resource['value']] + : ['default' => $resource] + ); + } + + return $resources; + }) ->end() ->prototype('array') ->beforeNormalization()->ifString()->then(function ($v) { return [$v]; })->end() diff --git a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php index 91764a642e..08529592b5 100644 --- a/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php @@ -296,6 +296,69 @@ class ConfigurationTest extends TestCase yield [$createPackageConfig($config), 'You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.']; } + /** + * @dataProvider provideValidLockConfigurationTests + */ + public function testValidLockConfiguration($lockConfig, $processedConfig) + { + $processor = new Processor(); + $configuration = new Configuration(true); + $config = $processor->processConfiguration($configuration, [ + [ + 'lock' => $lockConfig, + ], + ]); + + $this->assertArrayHasKey('lock', $config); + + $this->assertEquals($processedConfig, $config['lock']); + } + + public function provideValidLockConfigurationTests() + { + yield [null, ['enabled' => true, 'resources' => ['default' => [class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock']]]]; + + yield ['flock', ['enabled' => true, 'resources' => ['default' => ['flock']]]]; + yield [['flock', 'semaphore'], ['enabled' => true, 'resources' => ['default' => ['flock', 'semaphore']]]]; + yield [['foo' => 'flock', 'bar' => 'semaphore'], ['enabled' => true, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]]; + yield [['foo' => ['flock', 'semaphore'], 'bar' => 'semaphore'], ['enabled' => true, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]]; + yield [['default' => 'flock'], ['enabled' => true, 'resources' => ['default' => ['flock']]]]; + + yield [['enabled' => false, 'flock'], ['enabled' => false, 'resources' => ['default' => ['flock']]]]; + yield [['enabled' => false, ['flock', 'semaphore']], ['enabled' => false, 'resources' => ['default' => ['flock', 'semaphore']]]]; + yield [['enabled' => false, 'foo' => 'flock', 'bar' => 'semaphore'], ['enabled' => false, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]]; + yield [['enabled' => false, 'foo' => ['flock', 'semaphore']], ['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore']]]]; + yield [['enabled' => false, 'default' => 'flock'], ['enabled' => false, 'resources' => ['default' => ['flock']]]]; + + yield [['resources' => 'flock'], ['enabled' => true, 'resources' => ['default' => ['flock']]]]; + yield [['resources' => ['flock', 'semaphore']], ['enabled' => true, 'resources' => ['default' => ['flock', 'semaphore']]]]; + yield [['resources' => ['foo' => 'flock', 'bar' => 'semaphore']], ['enabled' => true, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]]; + yield [['resources' => ['foo' => ['flock', 'semaphore'], 'bar' => 'semaphore']], ['enabled' => true, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]]; + yield [['resources' => ['default' => 'flock']], ['enabled' => true, 'resources' => ['default' => ['flock']]]]; + + yield [['enabled' => false, 'resources' => 'flock'], ['enabled' => false, 'resources' => ['default' => ['flock']]]]; + yield [['enabled' => false, 'resources' => ['flock', 'semaphore']], ['enabled' => false, 'resources' => ['default' => ['flock', 'semaphore']]]]; + yield [['enabled' => false, 'resources' => ['foo' => 'flock', 'bar' => 'semaphore']], ['enabled' => false, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]]; + yield [['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => 'semaphore']], ['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]]; + yield [['enabled' => false, 'resources' => ['default' => 'flock']], ['enabled' => false, 'resources' => ['default' => ['flock']]]]; + + // xml + + yield [['resource' => ['flock']], ['enabled' => true, 'resources' => ['default' => ['flock']]]]; + yield [['resource' => ['flock', ['name' => 'foo', 'value' => 'semaphore']]], ['enabled' => true, 'resources' => ['default' => ['flock'], 'foo' => ['semaphore']]]]; + yield [['resource' => [['name' => 'foo', 'value' => 'flock']]], ['enabled' => true, 'resources' => ['foo' => ['flock']]]]; + yield [['resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'foo', 'value' => 'semaphore']]], ['enabled' => true, 'resources' => ['foo' => ['flock', 'semaphore']]]]; + yield [['resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'bar', 'value' => 'semaphore']]], ['enabled' => true, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]]; + yield [['resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'foo', 'value' => 'semaphore'], ['name' => 'bar', 'value' => 'semaphore']]], ['enabled' => true, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]]; + + yield [['enabled' => false, 'resource' => ['flock']], ['enabled' => false, 'resources' => ['default' => ['flock']]]]; + yield [['enabled' => false, 'resource' => ['flock', ['name' => 'foo', 'value' => 'semaphore']]], ['enabled' => false, 'resources' => ['default' => ['flock'], 'foo' => ['semaphore']]]]; + yield [['enabled' => false, 'resource' => [['name' => 'foo', 'value' => 'flock']]], ['enabled' => false, 'resources' => ['foo' => ['flock']]]]; + yield [['enabled' => false, 'resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'foo', 'value' => 'semaphore']]], ['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore']]]]; + yield [['enabled' => false, 'resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'bar', 'value' => 'semaphore']]], ['enabled' => false, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]]; + yield [['enabled' => false, 'resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'foo', 'value' => 'semaphore'], ['name' => 'bar', 'value' => 'semaphore']]], ['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]]; + } + protected static function getBundleDefaultConfig() { return [