Skip to content

Commit b1d5611

Browse files
Apply php-cs-fixer rule for array_key_exists()
1 parent 6df3958 commit b1d5611

File tree

6 files changed

+7
-7
lines changed

6 files changed

+7
-7
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
@@ -50,7 +50,7 @@ public function validate($value, Constraint $constraint)
5050

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

5656
if ($existsInArray || $existsInArrayAccess) {

Constraints/IbanValidator.php

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

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

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

Mapping/ClassMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,7 @@ public function mergeConstraints(self $source)
371371
*/
372372
public function hasPropertyMetadata($property)
373373
{
374-
return array_key_exists($property, $this->members);
374+
return \array_key_exists($property, $this->members);
375375
}
376376

377377
/**

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)