Skip to content

Commit 61c00f7

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 c49ae5e + 8a32f54 commit 61c00f7

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Authentication/Token/AbstractToken.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public function setAttributes(array $attributes)
225225
*/
226226
public function hasAttribute($name)
227227
{
228-
return array_key_exists($name, $this->attributes);
228+
return \array_key_exists($name, $this->attributes);
229229
}
230230

231231
/**
@@ -239,7 +239,7 @@ public function hasAttribute($name)
239239
*/
240240
public function getAttribute($name)
241241
{
242-
if (!array_key_exists($name, $this->attributes)) {
242+
if (!\array_key_exists($name, $this->attributes)) {
243243
throw new \InvalidArgumentException(sprintf('This token has no "%s" attribute.', $name));
244244
}
245245

Authorization/AccessDecisionManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class AccessDecisionManager implements AccessDecisionManagerInterface
4242
public function __construct(iterable $voters = [], string $strategy = self::STRATEGY_AFFIRMATIVE, bool $allowIfAllAbstainDecisions = false, bool $allowIfEqualGrantedDeniedDecisions = true)
4343
{
4444
$strategyMethod = 'decide'.ucfirst($strategy);
45-
if (!\is_callable([$this, $strategyMethod])) {
45+
if ('' === $strategy || !\is_callable([$this, $strategyMethod])) {
4646
throw new \InvalidArgumentException(sprintf('The strategy "%s" is not supported.', $strategy));
4747
}
4848

Encoder/EncoderFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function getEncoder($user)
3333
$encoderKey = null;
3434

3535
if ($user instanceof EncoderAwareInterface && (null !== $encoderName = $user->getEncoderName())) {
36-
if (!array_key_exists($encoderName, $this->encoders)) {
36+
if (!\array_key_exists($encoderName, $this->encoders)) {
3737
throw new \RuntimeException(sprintf('The encoder "%s" was not configured.', $encoderName));
3838
}
3939

0 commit comments

Comments
 (0)