Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0d05f3e

Browse files
Merge branch '3.4' into 4.3
* 3.4: [FrameworkBundle] Fix framework bundle lock configuration not working as expected [Validator] Add the missing translations for the Azerbaijani locale [Cache] dont override native Memcached options Fix return type of Process::restart().
2 parents 0222ea5 + 4b2019d commit 0d05f3e

File tree

5 files changed

+227
-4
lines changed

5 files changed

+227
-4
lines changed

src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1055,7 +1055,11 @@ private function addLockSection(ArrayNodeDefinition $rootNode)
10551055
->ifString()->then(function ($v) { return ['enabled' => true, 'resources' => $v]; })
10561056
->end()
10571057
->beforeNormalization()
1058-
->ifTrue(function ($v) { return \is_array($v) && !isset($v['resources']); })
1058+
->ifTrue(function ($v) { return \is_array($v) && !isset($v['enabled']); })
1059+
->then(function ($v) { return $v + ['enabled' => true]; })
1060+
->end()
1061+
->beforeNormalization()
1062+
->ifTrue(function ($v) { return \is_array($v) && !isset($v['resources']) && !isset($v['resource']); })
10591063
->then(function ($v) {
10601064
$e = $v['enabled'];
10611065
unset($v['enabled']);
@@ -1074,7 +1078,19 @@ private function addLockSection(ArrayNodeDefinition $rootNode)
10741078
->end()
10751079
->beforeNormalization()
10761080
->ifTrue(function ($v) { return \is_array($v) && array_keys($v) === range(0, \count($v) - 1); })
1077-
->then(function ($v) { return ['default' => $v]; })
1081+
->then(function ($v) {
1082+
$resources = [];
1083+
foreach ($v as $resource) {
1084+
$resources = array_merge_recursive(
1085+
$resources,
1086+
\is_array($resource) && isset($resource['name'])
1087+
? [$resource['name'] => $resource['value']]
1088+
: ['default' => $resource]
1089+
);
1090+
}
1091+
1092+
return $resources;
1093+
})
10781094
->end()
10791095
->prototype('array')
10801096
->beforeNormalization()->ifString()->then(function ($v) { return [$v]; })->end()

src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,69 @@ public function provideInvalidAssetConfigurationTests()
187187
yield [$createPackageConfig($config), 'You cannot use both "version" and "json_manifest_path" at the same time under "assets" packages.'];
188188
}
189189

190+
/**
191+
* @dataProvider provideValidLockConfigurationTests
192+
*/
193+
public function testValidLockConfiguration($lockConfig, $processedConfig)
194+
{
195+
$processor = new Processor();
196+
$configuration = new Configuration(true);
197+
$config = $processor->processConfiguration($configuration, [
198+
[
199+
'lock' => $lockConfig,
200+
],
201+
]);
202+
203+
$this->assertArrayHasKey('lock', $config);
204+
205+
$this->assertEquals($processedConfig, $config['lock']);
206+
}
207+
208+
public function provideValidLockConfigurationTests()
209+
{
210+
yield [null, ['enabled' => true, 'resources' => ['default' => [class_exists(SemaphoreStore::class) && SemaphoreStore::isSupported() ? 'semaphore' : 'flock']]]];
211+
212+
yield ['flock', ['enabled' => true, 'resources' => ['default' => ['flock']]]];
213+
yield [['flock', 'semaphore'], ['enabled' => true, 'resources' => ['default' => ['flock', 'semaphore']]]];
214+
yield [['foo' => 'flock', 'bar' => 'semaphore'], ['enabled' => true, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]];
215+
yield [['foo' => ['flock', 'semaphore'], 'bar' => 'semaphore'], ['enabled' => true, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]];
216+
yield [['default' => 'flock'], ['enabled' => true, 'resources' => ['default' => ['flock']]]];
217+
218+
yield [['enabled' => false, 'flock'], ['enabled' => false, 'resources' => ['default' => ['flock']]]];
219+
yield [['enabled' => false, ['flock', 'semaphore']], ['enabled' => false, 'resources' => ['default' => ['flock', 'semaphore']]]];
220+
yield [['enabled' => false, 'foo' => 'flock', 'bar' => 'semaphore'], ['enabled' => false, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]];
221+
yield [['enabled' => false, 'foo' => ['flock', 'semaphore']], ['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore']]]];
222+
yield [['enabled' => false, 'default' => 'flock'], ['enabled' => false, 'resources' => ['default' => ['flock']]]];
223+
224+
yield [['resources' => 'flock'], ['enabled' => true, 'resources' => ['default' => ['flock']]]];
225+
yield [['resources' => ['flock', 'semaphore']], ['enabled' => true, 'resources' => ['default' => ['flock', 'semaphore']]]];
226+
yield [['resources' => ['foo' => 'flock', 'bar' => 'semaphore']], ['enabled' => true, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]];
227+
yield [['resources' => ['foo' => ['flock', 'semaphore'], 'bar' => 'semaphore']], ['enabled' => true, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]];
228+
yield [['resources' => ['default' => 'flock']], ['enabled' => true, 'resources' => ['default' => ['flock']]]];
229+
230+
yield [['enabled' => false, 'resources' => 'flock'], ['enabled' => false, 'resources' => ['default' => ['flock']]]];
231+
yield [['enabled' => false, 'resources' => ['flock', 'semaphore']], ['enabled' => false, 'resources' => ['default' => ['flock', 'semaphore']]]];
232+
yield [['enabled' => false, 'resources' => ['foo' => 'flock', 'bar' => 'semaphore']], ['enabled' => false, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]];
233+
yield [['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => 'semaphore']], ['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]];
234+
yield [['enabled' => false, 'resources' => ['default' => 'flock']], ['enabled' => false, 'resources' => ['default' => ['flock']]]];
235+
236+
// xml
237+
238+
yield [['resource' => ['flock']], ['enabled' => true, 'resources' => ['default' => ['flock']]]];
239+
yield [['resource' => ['flock', ['name' => 'foo', 'value' => 'semaphore']]], ['enabled' => true, 'resources' => ['default' => ['flock'], 'foo' => ['semaphore']]]];
240+
yield [['resource' => [['name' => 'foo', 'value' => 'flock']]], ['enabled' => true, 'resources' => ['foo' => ['flock']]]];
241+
yield [['resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'foo', 'value' => 'semaphore']]], ['enabled' => true, 'resources' => ['foo' => ['flock', 'semaphore']]]];
242+
yield [['resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'bar', 'value' => 'semaphore']]], ['enabled' => true, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]];
243+
yield [['resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'foo', 'value' => 'semaphore'], ['name' => 'bar', 'value' => 'semaphore']]], ['enabled' => true, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]];
244+
245+
yield [['enabled' => false, 'resource' => ['flock']], ['enabled' => false, 'resources' => ['default' => ['flock']]]];
246+
yield [['enabled' => false, 'resource' => ['flock', ['name' => 'foo', 'value' => 'semaphore']]], ['enabled' => false, 'resources' => ['default' => ['flock'], 'foo' => ['semaphore']]]];
247+
yield [['enabled' => false, 'resource' => [['name' => 'foo', 'value' => 'flock']]], ['enabled' => false, 'resources' => ['foo' => ['flock']]]];
248+
yield [['enabled' => false, 'resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'foo', 'value' => 'semaphore']]], ['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore']]]];
249+
yield [['enabled' => false, 'resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'bar', 'value' => 'semaphore']]], ['enabled' => false, 'resources' => ['foo' => ['flock'], 'bar' => ['semaphore']]]];
250+
yield [['enabled' => false, 'resource' => [['name' => 'foo', 'value' => 'flock'], ['name' => 'foo', 'value' => 'semaphore'], ['name' => 'bar', 'value' => 'semaphore']]], ['enabled' => false, 'resources' => ['foo' => ['flock', 'semaphore'], 'bar' => ['semaphore']]]];
251+
}
252+
190253
public function testItShowANiceMessageIfTwoMessengerBusesAreConfiguredButNoDefaultBus()
191254
{
192255
$expectedMessage = 'You must specify the "default_bus" if you define more than one bus.';

src/Symfony/Component/Cache/Traits/MemcachedTrait.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ trait MemcachedTrait
2828
'persistent_id' => null,
2929
'username' => null,
3030
'password' => null,
31-
'serializer' => 'php',
31+
\Memcached::OPT_SERIALIZER => \Memcached::SERIALIZER_PHP,
3232
];
3333

3434
private $marshaller;

src/Symfony/Component/Process/Process.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ public function start(callable $callback = null, array $env = [])
358358
* @param callable|null $callback A PHP callback to run whenever there is some
359359
* output available on STDOUT or STDERR
360360
*
361-
* @return $this
361+
* @return static
362362
*
363363
* @throws RuntimeException When process can't be launched
364364
* @throws RuntimeException When process is already running

src/Symfony/Component/Validator/Resources/translations/validators.az.xlf

Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,150 @@
222222
<source>Unsupported card type or invalid card number.</source>
223223
<target>Dəstəklənməyən kart tipi və ya yanlış kart nömrəsi.</target>
224224
</trans-unit>
225+
<trans-unit id="59">
226+
<source>This is not a valid International Bank Account Number (IBAN).</source>
227+
<target>Bu dəyər doğru bir Beynəlxalq Bank Hesap Nömrəsi (IBAN) deyil.</target>
228+
</trans-unit>
229+
<trans-unit id="60">
230+
<source>This value is not a valid ISBN-10.</source>
231+
<target>Bu dəyər doğru bir ISBN-10 deyil.</target>
232+
</trans-unit>
233+
<trans-unit id="61">
234+
<source>This value is not a valid ISBN-13.</source>
235+
<target>Bu dəyər doğru bir ISBN-13 deyil.</target>
236+
</trans-unit>
237+
<trans-unit id="62">
238+
<source>This value is neither a valid ISBN-10 nor a valid ISBN-13.</source>
239+
<target>Bu dəyər doğru bir ISBN-10 və ya ISBN-13 deyil.</target>
240+
</trans-unit>
241+
<trans-unit id="63">
242+
<source>This value is not a valid ISSN.</source>
243+
<target>Bu dəyər doğru bir ISSN deyil.</target>
244+
</trans-unit>
245+
<trans-unit id="64">
246+
<source>This value is not a valid currency.</source>
247+
<target>Bu dəyər doğru bir valyuta deyil.</target>
248+
</trans-unit>
249+
<trans-unit id="65">
250+
<source>This value should be equal to {{ compared_value }}.</source>
251+
<target>Bu dəyər {{ compared_value }} ilə bərabər olmalıdır.</target>
252+
</trans-unit>
253+
<trans-unit id="66">
254+
<source>This value should be greater than {{ compared_value }}.</source>
255+
<target>Bu dəyər {{ compared_value }} dəyərindən büyük olmalıdır.</target>
256+
</trans-unit>
257+
<trans-unit id="67">
258+
<source>This value should be greater than or equal to {{ compared_value }}.</source>
259+
<target>Bu dəyər {{ compared_value }} ilə bərabər və ya daha böyük olmaldır.</target>
260+
</trans-unit>
261+
<trans-unit id="68">
262+
<source>This value should be identical to {{ compared_value_type }} {{ compared_value }}.</source>
263+
<target>Bu dəyər {{ compared_value_type }} {{ compared_value }} ilə eyni olmalıdır.</target>
264+
</trans-unit>
265+
<trans-unit id="69">
266+
<source>This value should be less than {{ compared_value }}.</source>
267+
<target>Bu dəyər {{ compared_value }} dəyərindən kiçik olmalıdır.</target>
268+
</trans-unit>
269+
<trans-unit id="70">
270+
<source>This value should be less than or equal to {{ compared_value }}.</source>
271+
<target>Bu dəyər {{ compared_value }} dəyərindən kiçik və ya bərabər olmalıdır.</target>
272+
</trans-unit>
273+
<trans-unit id="71">
274+
<source>This value should not be equal to {{ compared_value }}.</source>
275+
<target>Bu değer {{ compared_value }} ile eşit olmamalıdır.</target>
276+
</trans-unit>
277+
<trans-unit id="72">
278+
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
279+
<target>Bu dəyər {{ compared_value_type }} {{ compared_value }} ilə eyni olmamalıdır.</target>
280+
</trans-unit>
281+
<trans-unit id="73">
282+
<source>The image ratio is too big ({{ ratio }}). Allowed maximum ratio is {{ max_ratio }}.</source>
283+
<target>Şəkil nisbəti çox büyükdür ({{ ratio }}). İcazə verilən maksimum nisbət: {{ max_ratio }}.</target>
284+
</trans-unit>
285+
<trans-unit id="74">
286+
<source>The image ratio is too small ({{ ratio }}). Minimum ratio expected is {{ min_ratio }}.</source>
287+
<target>Şəkil nisbəti çox balacadır ({{ ratio }}). İcazə verilən minimum nisbət: {{ min_ratio }}.</target>
288+
</trans-unit>
289+
<trans-unit id="75">
290+
<source>The image is square ({{ width }}x{{ height }}px). Square images are not allowed.</source>
291+
<target>Şəkil kvadratdır ({{ width }}x{{ height }}px). Kvadrat şəkillərə icazə verilmir.</target>
292+
</trans-unit>
293+
<trans-unit id="76">
294+
<source>The image is landscape oriented ({{ width }}x{{ height }}px). Landscape oriented images are not allowed.</source>
295+
<target>Şəkil albom rejimindədir ({{ width }}x{{ height }}px). Albom rejimli şəkillərə icazə verilmir.</target>
296+
</trans-unit>
297+
<trans-unit id="77">
298+
<source>The image is portrait oriented ({{ width }}x{{ height }}px). Portrait oriented images are not allowed.</source>
299+
<target>Şəkil portret rejimindədir ({{ width }}x{{ height }}px). Portret rejimli şəkillərə icazə verilmir.</target>
300+
</trans-unit>
301+
<trans-unit id="78">
302+
<source>An empty file is not allowed.</source>
303+
<target>Boş fayla icazə verilmir.</target>
304+
</trans-unit>
305+
<trans-unit id="79">
306+
<source>The host could not be resolved.</source>
307+
<target>Ünvan tapılmadı.</target>
308+
</trans-unit>
309+
<trans-unit id="80">
310+
<source>This value does not match the expected {{ charset }} charset.</source>
311+
<target>Bu dəyər gözlənilən {{ charset }} simvol cədvəli ilə uyğun gəlmir.</target>
312+
</trans-unit>
313+
<trans-unit id="81">
314+
<source>This is not a valid Business Identifier Code (BIC).</source>
315+
<target>Bu dəyər doğru bir Biznes Təyinedici Kodu (BIC) deyil.</target>
316+
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Xəta</target>
320+
</trans-unit>
321+
<trans-unit id="83">
322+
<source>This is not a valid UUID.</source>
323+
<target>Bu dəyər doğru bir UUID deyil.</target>
324+
</trans-unit>
325+
<trans-unit id="84">
326+
<source>This value should be a multiple of {{ compared_value }}.</source>
327+
<target>Bu dəyər {{ compare_value }} dəyərinin bölənlərindən biri olmalıdır.</target>
328+
</trans-unit>
329+
<trans-unit id="85">
330+
<source>This Business Identifier Code (BIC) is not associated with IBAN {{ iban }}.</source>
331+
<target>Bu Biznes Təyinedici Kodu (BIC) {{ iban }} IBAN kodu ilə əlaqəli deyil.</target>
332+
</trans-unit>
333+
<trans-unit id="86">
334+
<source>This value should be valid JSON.</source>
335+
<target>Bu dəyər doğru bir JSON olmalıdır.</target>
336+
</trans-unit>
337+
<trans-unit id="87">
338+
<source>This collection should contain only unique elements.</source>
339+
<target>Bu kolleksiyada sadəcə unikal elementlər olmalıdır.</target>
340+
</trans-unit>
341+
<trans-unit id="88">
342+
<source>This value should be positive.</source>
343+
<target>Bu dəyər müsbət olmalıdır.</target>
344+
</trans-unit>
345+
<trans-unit id="89">
346+
<source>This value should be either positive or zero.</source>
347+
<target>Bu dəyər müsbət və ya sıfır olmalıdır.</target>
348+
</trans-unit>
349+
<trans-unit id="90">
350+
<source>This value should be negative.</source>
351+
<target>Bu dəyər mənfi olmaldır.</target>
352+
</trans-unit>
353+
<trans-unit id="91">
354+
<source>This value should be either negative or zero.</source>
355+
<target>Bu dəyər mənfi və ya sıfır olmaldır.</target>
356+
</trans-unit>
357+
<trans-unit id="92">
358+
<source>This value is not a valid timezone.</source>
359+
<target>Bu dəyər doğru bir zaman zolağı deyil.</target>
360+
</trans-unit>
361+
<trans-unit id="93">
362+
<source>This password has been leaked in a data breach, it must not be used. Please use another password.</source>
363+
<target>Bu parol data oğurluğunda tapıldığı üçün işlədilməməlidir. Zəhmət olmasa, başqa parol seçin.</target>
364+
</trans-unit>
365+
<trans-unit id="94">
366+
<source>This value should be between {{ min }} and {{ max }}.</source>
367+
<target>Bu dəyər {{ min }} və {{ max }} arasında olmaldır.</target>
368+
</trans-unit>
225369
</body>
226370
</file>
227371
</xliff>

0 commit comments

Comments
 (0)