Skip to content

Commit 55a474b

Browse files
Merge branch '4.2'
* 4.2: (26 commits) Apply php-cs-fixer rule for array_key_exists() [Cache] fix warming up cache.system and apcu [Security] Change FormAuthenticator if condition handles multi-byte characters in autocomplete speed up tests running them without debug flag [Translations] added missing Croatian validators Fix getItems() performance issue with RedisCluster (php-redis) [VarDumper] Keep a ref to objects to ensure their handle cannot be reused while cloning IntegerType: reject submitted non-integer numbers be keen to newcomers [HttpKernel] Fix possible infinite loop of exceptions fixed CS [Validator] Added missing translations for Afrikaans do not validate non-submitted form fields in PATCH requests Update usage example in ArrayInput doc block. [Console] Prevent ArgvInput::getFirstArgument() from returning an option value [Validator] Fixed duplicate UUID fixed CS [EventDispatcher] Fix unknown priority Avoid mutating the Finder when building the iterator ...
2 parents 1830dae + a4eff31 commit 55a474b

15 files changed

+217
-17
lines changed

Constraint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public function __construct($options = null)
122122
}
123123
if ($options && \is_array($options) && \is_string(key($options))) {
124124
foreach ($options as $option => $value) {
125-
if (array_key_exists($option, $knownOptions)) {
125+
if (\array_key_exists($option, $knownOptions)) {
126126
$this->$option = $value;
127127
unset($missingOptions[$option]);
128128
} else {
@@ -136,7 +136,7 @@ public function __construct($options = null)
136136
throw new ConstraintDefinitionException(sprintf('No default option is configured for constraint %s', \get_class($this)));
137137
}
138138

139-
if (array_key_exists($option, $knownOptions)) {
139+
if (\array_key_exists($option, $knownOptions)) {
140140
$this->$option = $options;
141141
unset($missingOptions[$option]);
142142
} else {

Constraints/CollectionValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function validate($value, Constraint $constraint)
5151

5252
foreach ($constraint->fields as $field => $fieldConstraint) {
5353
// bug fix issue #2779
54-
$existsInArray = \is_array($value) && array_key_exists($field, $value);
54+
$existsInArray = \is_array($value) && \array_key_exists($field, $value);
5555
$existsInArrayAccess = $value instanceof \ArrayAccess && $value->offsetExists($field);
5656

5757
if ($existsInArray || $existsInArrayAccess) {

Constraints/Email.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -76,19 +76,19 @@ class Email extends Constraint
7676

7777
public function __construct($options = null)
7878
{
79-
if (\is_array($options) && array_key_exists('strict', $options)) {
79+
if (\is_array($options) && \array_key_exists('strict', $options)) {
8080
@trigger_error(sprintf('The "strict" property is deprecated since Symfony 4.1. Use "mode"=>"%s" instead.', self::VALIDATION_MODE_STRICT), E_USER_DEPRECATED);
8181
}
8282

83-
if (\is_array($options) && array_key_exists('checkMX', $options)) {
83+
if (\is_array($options) && \array_key_exists('checkMX', $options)) {
8484
@trigger_error('The "checkMX" option is deprecated since Symfony 4.2.', E_USER_DEPRECATED);
8585
}
8686

87-
if (\is_array($options) && array_key_exists('checkHost', $options)) {
87+
if (\is_array($options) && \array_key_exists('checkHost', $options)) {
8888
@trigger_error('The "checkHost" option is deprecated since Symfony 4.2.', E_USER_DEPRECATED);
8989
}
9090

91-
if (\is_array($options) && array_key_exists('mode', $options) && !\in_array($options['mode'], self::$validationModes, true)) {
91+
if (\is_array($options) && \array_key_exists('mode', $options) && !\in_array($options['mode'], self::$validationModes, true)) {
9292
throw new \InvalidArgumentException('The "mode" parameter value is not valid.');
9393
}
9494

Constraints/IbanValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public function validate($value, Constraint $constraint)
182182
}
183183

184184
// ...have a format available
185-
if (!array_key_exists($countryCode, self::$formats)) {
185+
if (!\array_key_exists($countryCode, self::$formats)) {
186186
$this->context->buildViolation($constraint->message)
187187
->setParameter('{{ value }}', $this->formatValue($value))
188188
->setCode(Iban::NOT_SUPPORTED_COUNTRY_CODE_ERROR)

Constraints/LessThanOrEqual.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121
class LessThanOrEqual extends AbstractComparison
2222
{
23-
const TOO_HIGH_ERROR = '079d7420-2d13-460c-8756-de810eeb37d2';
23+
const TOO_HIGH_ERROR = '30fbb013-d015-4232-8b3b-8f3be97a7e14';
2424

2525
protected static $errorNames = [
2626
self::TOO_HIGH_ERROR => 'TOO_HIGH_ERROR',

Constraints/Regex.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function getHtmlPattern()
7979
// Unescape the delimiter
8080
$pattern = str_replace('\\'.$delimiter, $delimiter, substr($this->pattern, 1, -1));
8181

82-
// If the pattern is inverted, we can simply wrap it in
82+
// If the pattern is inverted, we can wrap it in
8383
// ((?!pattern).)*
8484
if (!$this->match) {
8585
return '((?!'.$pattern.').)*';

Constraints/Traverse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class Traverse extends Constraint
2525

2626
public function __construct($options = null)
2727
{
28-
if (\is_array($options) && array_key_exists('groups', $options)) {
28+
if (\is_array($options) && \array_key_exists('groups', $options)) {
2929
throw new ConstraintDefinitionException(sprintf('The option "groups" is not supported by the constraint %s', __CLASS__));
3030
}
3131

Constraints/Url.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ class Url extends Constraint
109109
public function __construct($options = null)
110110
{
111111
if (\is_array($options)) {
112-
if (array_key_exists('checkDNS', $options)) {
112+
if (\array_key_exists('checkDNS', $options)) {
113113
@trigger_error(sprintf('The "checkDNS" option in "%s" is deprecated since Symfony 4.1. Its false-positive rate is too high to be relied upon.', self::class), E_USER_DEPRECATED);
114114
}
115-
if (array_key_exists('dnsMessage', $options)) {
115+
if (\array_key_exists('dnsMessage', $options)) {
116116
@trigger_error(sprintf('The "dnsMessage" option in "%s" is deprecated since Symfony 4.1.', self::class), E_USER_DEPRECATED);
117117
}
118118
}

Mapping/ClassMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ public function mergeConstraints(self $source)
366366
*/
367367
public function hasPropertyMetadata($property)
368368
{
369-
return array_key_exists($property, $this->members);
369+
return \array_key_exists($property, $this->members);
370370
}
371371

372372
/**

Mapping/ClassMetadataInterface.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ public function hasPropertyMetadata($property);
8686
/**
8787
* Returns all metadata instances for the given named property.
8888
*
89-
* If your implementation does not support properties, simply throw an
90-
* exception in this method (for example a <tt>BadMethodCallException</tt>).
89+
* If your implementation does not support properties, throw an exception
90+
* in this method (for example a <tt>BadMethodCallException</tt>).
9191
*
9292
* @param string $property The property name
9393
*

Resources/translations/validators.af.xlf

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,118 @@
222222
<source>Unsupported card type or invalid card number.</source>
223223
<target>Nie-ondersteunde tipe kaart of ongeldige kredietkaart nommer.</target>
224224
</trans-unit>
225+
<trans-unit id="59">
226+
<source>This is not a valid International Bank Account Number (IBAN).</source>
227+
<target>Hierdie is nie 'n geldige Internationale Bank Rekening Nommer (IBAN) nie.</target>
228+
</trans-unit>
229+
<trans-unit id="60">
230+
<source>This value is not a valid ISBN-10.</source>
231+
<target>Hierdie waarde is nie 'n geldige ISBN-10 nie.</target>
232+
</trans-unit>
233+
<trans-unit id="61">
234+
<source>This value is not a valid ISBN-13.</source>
235+
<target>Hierdie waarde is nie 'n geldige ISBN-13 nie.</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>Hierdie waarde is nie 'n geldige ISBN-10 of ISBN-13 nie.</target>
240+
</trans-unit>
241+
<trans-unit id="63">
242+
<source>This value is not a valid ISSN.</source>
243+
<target>Hierdie waarde is nie 'n geldige ISSN nie.</target>
244+
</trans-unit>
245+
<trans-unit id="64">
246+
<source>This value is not a valid currency.</source>
247+
<target>Hierdie waarde is nie 'n geldige geldeenheid nie.</target>
248+
</trans-unit>
249+
<trans-unit id="65">
250+
<source>This value should be equal to {{ compared_value }}.</source>
251+
<target>Hierdie waarde moet gelyk aan {{ compared_value }} wees.</target>
252+
</trans-unit>
253+
<trans-unit id="66">
254+
<source>This value should be greater than {{ compared_value }}.</source>
255+
<target>Hierdie waarde moet meer as {{ compared_value }} wees.</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>Hierdie waarde moet meer of gelyk aan {{ compared_value }} wees.</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>Hierdie waarde moet identies aan {{ compared_value_type }} {{ compared_value }} wees.</target>
264+
</trans-unit>
265+
<trans-unit id="69">
266+
<source>This value should be less than {{ compared_value }}.</source>
267+
<target>Hierdie waarde moet minder as {{ compared_value }} wees.</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>Hierdie waarde moet minder of gelyk aan {{ compared_value }} wees.</target>
272+
</trans-unit>
273+
<trans-unit id="71">
274+
<source>This value should not be equal to {{ compared_value }}.</source>
275+
<target>Hierdie waarde moet nie dieselfde as {{ compared_value }} wees nie.</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>Hierdie waarde moet nie identies as {{ compared_value_type }} {{ compared_value }} wees nie.</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>Die beeld aspek is te groot ({{ ratio }}). Die maksimum toegelate aspek is {{ 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>Die beeld aspek is te klein ({{ ratio }}). Die minimum toegelate aspek is {{ 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>Die beeld is vierkantig ({{ width }}x{{ height }}px). Vierkantige beelde word nie toegelaat nie.</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>Die beeld is landskap georiënteerd ({{ width }}x{{ height }}px). Landskap georiënteerde beelde word nie toegelaat nie.</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>Die beeld dis portret georiënteerd ({{ width }}x{{ height }}px). Portret georiënteerde beelde word nie toegelaat nie.</target>
300+
</trans-unit>
301+
<trans-unit id="78">
302+
<source>An empty file is not allowed.</source>
303+
<target>'n Leë lêer word nie toegelaat nie.</target>
304+
</trans-unit>
305+
<trans-unit id="79">
306+
<source>The host could not be resolved.</source>
307+
<target>Die gasheer kon nie opgelos word nie.</target>
308+
</trans-unit>
309+
<trans-unit id="80">
310+
<source>This value does not match the expected {{ charset }} charset.</source>
311+
<target>Die waarde stem nie ooreen met die verwagte {{ charset }} karakterstel nie.</target>
312+
</trans-unit>
313+
<trans-unit id="81">
314+
<source>This is not a valid Business Identifier Code (BIC).</source>
315+
<target>Hierdie is nie 'n geldige Besigheids Identifikasie Kode (BIC) nie.</target>
316+
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Fout</target>
320+
</trans-unit>
321+
<trans-unit id="83">
322+
<source>This is not a valid UUID.</source>
323+
<target>Hierdie is nie 'n geldige UUID nie.</target>
324+
</trans-unit>
325+
<trans-unit id="84">
326+
<source>This value should be a multiple of {{ compared_value }}.</source>
327+
<target>Hierdie waarde moet 'n veelvoud van {{ compared_value }} wees.</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>Hierdie Besigheids Identifikasie Kode (BIK) is nie geassosieer met IBAN {{ iban }} nie.</target>
332+
</trans-unit>
333+
<trans-unit id="86">
334+
<source>This value should be valid JSON.</source>
335+
<target>Hierdie waarde moet geldige JSON wees.</target>
336+
</trans-unit>
225337
</body>
226338
</file>
227339
</xliff>

Resources/translations/validators.el.xlf

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,58 @@
278278
<source>This value should not be identical to {{ compared_value_type }} {{ compared_value }}.</source>
279279
<target>Αυτή η τιμή δεν πρέπει να είναι πανομοιότυπη με {{ compared_value_type }} {{ compared_value }}.</target>
280280
</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>Η αναλογία πλάτους-ύψους της εικόνας είναι πολύ μεγάλη ({{ ratio }}). Μέγιστη επιτρεπτή αναλογία {{ 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>Η αναλογία πλάτους-ύψους της εικόνας είναι πολύ μικρή ({{ ratio }}). Ελάχιστη επιτρεπτή αναλογία {{ 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>Η εικόνα είναι τετράγωνη ({{ width }}x{{ height }}px). Δεν επιτρέπονται τετράγωνες εικόνες.</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>Η εικόνα έχει οριζόντιο προσανατολισμό ({{ width }}x{{ height }}px). Δεν επιτρέπονται εικόνες με οριζόντιο προσανατολισμό.</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>Η εικόνα έχει κάθετο προσανατολισμό ({{ width }}x{{ height }}px). Δεν επιτρέπονται εικόνες με κάθετο προσανατολισμό.</target>
300+
</trans-unit>
301+
<trans-unit id="78">
302+
<source>An empty file is not allowed.</source>
303+
<target>Δεν επιτρέπεται κενό αρχείο.</target>
304+
</trans-unit>
305+
<trans-unit id="79">
306+
<source>The host could not be resolved.</source>
307+
<target>Η διεύθυνση δεν μπόρεσε να επιλυθεί.</target>
308+
</trans-unit>
309+
<trans-unit id="80">
310+
<source>This value does not match the expected {{ charset }} charset.</source>
311+
<target>Αυτή η τιμή δεν ταιριάζει στο αναμενόμενο {{ charset }} σύνολο χαρακτήρων.</target>
312+
</trans-unit>
313+
<trans-unit id="81">
314+
<source>This is not a valid Business Identifier Code (BIC).</source>
315+
<target>Αυτός δεν έιναι ένας έγκυρος κωδικός BIC.</target>
316+
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Σφάλμα</target>
320+
</trans-unit>
321+
<trans-unit id="83">
322+
<source>This is not a valid UUID.</source>
323+
<target>Αυτό δεν είναι ένα έγκυρο UUID.</target>
324+
</trans-unit>
325+
<trans-unit id="84">
326+
<source>This value should be a multiple of {{ compared_value }}.</source>
327+
<target>Αυτή η τιμή θα έπρεπε να είναι πολλαπλάσιο του {{ compared_value }}.</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>Αυτός ο κωδικός BIC δεν σχετίζεται με το IBAN {{ iban }}.</target>
332+
</trans-unit>
281333
</body>
282334
</file>
283335
</xliff>

Resources/translations/validators.hr.xlf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,22 @@
318318
<source>Error</source>
319319
<target>Greška</target>
320320
</trans-unit>
321+
<trans-unit id="83">
322+
<source>This is not a valid UUID.</source>
323+
<target>Ovo nije validan UUID.</target>
324+
</trans-unit>
325+
<trans-unit id="84">
326+
<source>This value should be a multiple of {{ compared_value }}.</source>
327+
<target>Ova vrijednost treba biti višekratnik od {{ compared_value }}.</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>Poslovni identifikacijski broj (BIC) nije povezan sa IBAN brojem {{ iban }}.</target>
332+
</trans-unit>
333+
<trans-unit id="86">
334+
<source>This value should be valid JSON.</source>
335+
<target>Ova vrijednost treba biti validan JSON.</target>
336+
</trans-unit>
321337
</body>
322338
</file>
323339
</xliff>

Resources/translations/validators.pt_BR.xlf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,26 @@
314314
<source>This is not a valid Business Identifier Code (BIC).</source>
315315
<target>Este não é um Código Identificador Bancário (BIC) válido.</target>
316316
</trans-unit>
317+
<trans-unit id="82">
318+
<source>Error</source>
319+
<target>Erro</target>
320+
</trans-unit>
321+
<trans-unit id="83">
322+
<source>This is not a valid UUID.</source>
323+
<target>Este não é um UUID válido.</target>
324+
</trans-unit>
325+
<trans-unit id="84">
326+
<source>This value should be a multiple of {{ compared_value }}.</source>
327+
<target>Este valor deve ser múltiplo de {{ compared_value }}.</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>Este Código Identificador Bancário (BIC) não está associado ao IBAN {{ iban }}.</target>
332+
</trans-unit>
333+
<trans-unit id="86">
334+
<source>This value should be valid JSON.</source>
335+
<target>Este valor deve ser um JSON válido.</target>
336+
</trans-unit>
317337
</body>
318338
</file>
319339
</xliff>

Tests/Fixtures/CustomArrayObject.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function __construct(array $array = null)
2626

2727
public function offsetExists($offset)
2828
{
29-
return array_key_exists($offset, $this->array);
29+
return \array_key_exists($offset, $this->array);
3030
}
3131

3232
public function offsetGet($offset)

0 commit comments

Comments
 (0)