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
*

0 commit comments

Comments
 (0)