8000 Merge branch '4.2' · symfony/symfony@a0c5665 · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit a0c5665

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 2e8bf33 + 87f3c36 commit a0c5665

File tree

146 files changed

+908
-306
lines changed
  • HttpKernel
  • Intl
  • Messenger/Transport/AmqpExt
  • OptionsResolver
  • PropertyAccess
  • PropertyInfo
  • Routing
  • Security
  • Serializer
  • Templating
  • Translation/Dumper
  • Validator
  • VarDumper
  • Workflow
  • Yaml
  • Some content is hidden

    Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

    146 files changed

    +908
    -306
    lines changed

    UPGRADE-4.0.md

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -230,7 +230,7 @@ DependencyInjection
    230230
    supported.
    231231

    232232
    * The ``strict`` attribute in service arguments has been removed.
    233-
    The attribute is ignored since 3.0, so you can simply remove it.
    233+
    The attribute is ignored since 3.0, you can remove it.
    234234

    235235
    * Top-level anonymous services in XML are no longer supported.
    236236

    src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -24,8 +24,8 @@
    2424
    * The compiler pass is meant to register the mappings with the metadata
    2525
    * chain driver corresponding to one of the object managers.
    2626
    *
    27-
    * For concrete implementations that are easy to use, see the
    28-
    * RegisterXyMappingsPass classes in the DoctrineBundle resp.
    27+
    * For concrete implementations, see the RegisterXyMappingsPass classes
    28+
    * in the DoctrineBundle resp.
    2929
    * DoctrineMongodbBundle, DoctrineCouchdbBundle and DoctrinePhpcrBundle.
    3030
    *
    3131
    * @author David Buchmann <david@liip.ch>

    src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -165,7 +165,7 @@ protected function getMetadata($class)
    165165
    // normalize class name
    166166
    $class = self::getRealClass(ltrim($class, '\\'));
    167167

    168-
    if (array_key_exists($class, $this->cache)) {
    168+
    if (\array_key_exists($class, $this->cache)) {
    169169
    return $this->cache[$class];
    170170
    }
    171171

    src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -20,7 +20,7 @@
    2020
    /**
    2121
    * Wrapper around a Doctrine ObjectManager.
    2222
    *
    23-
    * Provides easy to use provisioning for Doctrine entity users.
    23+
    * Provides provisioning for Doctrine entity users.
    2424
    *
    2525
    * @author Fabien Potencier <fabien@symfony.com>
    2626
    * @author Johannes M. Schmitt <schmittjoh@gmail.com>

    src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -31,10 +31,10 @@ class HttpCodeActivationStrategy extends ErrorLevelActivationStrategy
    3131
    public function __construct(RequestStack $requestStack, array $exclusions, $actionLevel)
    3232
    {
    3333
    foreach ($exclusions as $exclusion) {
    34-
    if (!array_key_exists('code', $exclusion)) {
    34+
    if (!\array_key_exists('code', $exclusion)) {
    3535
    throw new \LogicException(sprintf('An exclusion must have a "code" key'));
    3636
    }
    37-
    if (!array_key_exists('urls', $exclusion)) {
    37+
    if (!\array_key_exists('urls', $exclusion)) {
    3838
    throw new \LogicException(sprintf('An exclusion must have a "urls" key'));
    3939
    }
    4040
    }

    src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-factory.php

    Lines changed: 1 addition & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -1,7 +1,6 @@
    11
    <?php
    22

    3-
    return new class
    4-
    {
    3+
    return new class() {
    54
    public $proxyClass;
    65
    private $privates = [];
    76

    src/Symfony/Bridge/Twig/NodeVisitor/Scope.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -77,7 +77,7 @@ public function set($key, $value)
    7777
    */
    7878
    public function has($key)
    7979
    {
    80-
    if (array_key_exists($key, $this->data)) {
    80+
    if (\array_key_exists($key, $this->data)) {
    8181
    return true;
    8282
    }
    8383

    @@ -98,7 +98,7 @@ public function has($key)
    9898
    */
    9999
    public function get($key, $default = null)
    100100
    {
    101-
    if (array_key_exists($key, $this->data)) {
    101+
    if (\array_key_exists($key, $this->data)) {
    102102
    return $this->data[$key];
    103103
    }
    104104

    src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -138,7 +138,7 @@ private function getConfigForPath(array $config, string $path, string $alias)
    138138
    $steps = explode('.', $path);
    139139

    140140
    foreach ($steps as $step) {
    141-
    if (!array_key_exists($step, $config)) {
    141+
    if (!\array_key_exists($step, $config)) {
    142142
    throw new LogicException(sprintf('Unable to find configuration for "%s.%s"', $alias, $path));
    143143
    }
    144144

    src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php

    Lines changed: 7 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -11,6 +11,7 @@
    1111

    1212
    namespace Symfony\Bundle\FrameworkBundle\Console\Descriptor;
    1313

    14+
    use Symfony\Component\Config\Resource\ClassExistenceResource;
    1415
    use Symfony\Component\Console\Descriptor\DescriptorInterface;
    1516
    use Symfony\Component\Console\Output\OutputInterface;
    1617
    use Symfony\Component\DependencyInjection\Alias;
    @@ -226,7 +227,7 @@ protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceI
    226227
    return $builder->getDefinition($serviceId);
    227228
    }
    228229

    229-
    // Some service IDs don't have a Definition, they're simply an Alias
    230+
    // Some service IDs don't have a Definition, they're aliases
    230231
    if ($builder->hasAlias($serviceId)) {
    231232
    return $builder->getAlias($serviceId);
    232233
    }
    @@ -292,6 +293,11 @@ public static function getClassDescription(string $class, string &$resolvedClass
    292293
    {
    293294
    $resolvedClass = $class;
    294295
    try {
    296+
    $resource = new ClassExistenceResource($class, false);
    297+
    298+
    // isFresh() will explode ONLY if a parent class/trait does not exist
    299+
    $resource->isFresh(0);
    300+
    295301
    $r = new \ReflectionClass($class);
    296302
    $resolvedClass = $r->name;
    297303

    src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -156,7 +156,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
    156156
    */
    157157
    protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
    158158
    {
    159-
    $this->writeData($this->getEventDispatcherListenersData($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null), $options);
    159+
    $this->writeData($this->getEventDispatcherListenersData($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null), $options);
    160160
    }
    161161

    162162
    /**

    src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -274,7 +274,7 @@ protected function describeContainerParameter($parameter, array $options = [])
    274274
    */
    275275
    protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
    276276
    {
    277-
    $event = array_key_exists('event', $options) ? $options['event'] : null;
    277+
    $event = \array_key_exists('event', $options) ? $options['event'] : null;
    278278

    279279
    $title = 'Registered listeners';
    280280
    if (null !== $event) {

    src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -385,7 +385,7 @@ protected function describeContainerParameter($parameter, array $options = [])
    385385
    */
    386386
    protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
    387387
    {
    388-
    $event = array_key_exists('event', $options) ? $options['event'] : null;
    388+
    $event = \array_key_exists('event', $options) ? $options['event'] : null;
    389389

    390390
    if (null !== $event) {
    391391
    $title = sprintf('Registered Listeners for "%s" Event', $event);

    src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -112,7 +112,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
    112112
    */
    113113
    protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
    114114
    {
    115-
    $this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null));
    115+
    $this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null));
    116116
    }
    117117

    118118
    /**

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

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -327,7 +327,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
    327327
    }
    328328

    329329
    foreach ($places as $name => $place) {
    330-
    if (\is_array($place) && array_key_exists('name', $place)) {
    330+
    if (\is_array($place) && \array_key_exists('name', $place)) {
    331331
    continue;
    332332
    }
    333333
    $place['name'] = $name;
    @@ -365,7 +365,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
    365365
    }
    366366

    367367
    foreach ($transitions as $name => $transition) {
    368-
    if (\is_array($transition) && array_key_exists('name', $transition)) {
    368+
    if (\is_array($transition) && \array_key_exists('name', $transition)) {
    369369
    continue;
    370370
    }
    371371
    $transition['name'] = $name;

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

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -939,7 +939,7 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co
    939939
    foreach ($config['packages'] as $name => $package) {
    940940
    if (null !== $package['version_strategy']) {
    941941
    $version = new Reference($package['version_strategy']);
    942-
    } elseif (!array_key_exists('version', $package) && null === $package['json_manifest_path']) {
    942+
    } elseif (!\array_key_exists('version', $package) && null === $package['json_manifest_path']) {
    943943
    // if neither version nor json_manifest_path are specified, use the default
    944944
    $version = $defaultVersion;
    945945
    } else {
    @@ -1146,15 +1146,15 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
    11461146
    $definition = $container->findDefinition('validator.email');
    11471147
    $definition->replaceArgument(0, $config['email_validation_mode']);
    11481148

    1149-
    if (array_key_exists('enable_annotations', $config) && $config['enable_annotations']) {
    1149+
    if (\array_key_exists('enable_annotations', $config) && $config['enable_annotations']) {
    11501150
    if (!$this->annotationsConfigEnabled) {
    11511151
    throw new \LogicException('"enable_annotations" on the validator cannot be set as Annotations support is disabled.');
    11521152
    }
    11531153

    11541154
    $validatorBuilder->addMethodCall('enableAnnotationMapping', [new Reference('annotation_reader')]);
    11551155
    }
    11561156

    1157-
    if (array_key_exists('static_method', $config) && $config['static_method']) {
    1157+
    if (\array_key_exists('static_method', $config) && $config['static_method']) {
    11581158
    foreach ($config['static_method'] as $methodName) {
    11591159
    $validatorBuilder->addMethodCall('addMethodMapping', [$methodName]);
    11601160
    }

    src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -51,7 +51,7 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
    5151
    // Ensure that all *.meta files are fresh
    5252
    $finder = new Finder();
    5353
    $metaFiles = $finder->files()->in($this->kernel->getCacheDir())->name('*.php.meta');
    54-
    // simply check that cache is warmed up
    54+
    // check that cache is warmed up
    5555
    $this->assertNotEmpty($metaFiles);
    5656
    $configCacheFactory = new ConfigCacheFactory(true);
    5757

    src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -22,7 +22,7 @@ class ContainerDebugCommandTest extends WebTestCase
    2222
    {
    2323
    public function testDumpContainerIfNotExists()
    2424
    {
    25-
    static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']);
    25+
    static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml', 'debug' => true]);
    2626

    2727
    $application = new Application(static::$kernel);
    2828
    $application->setAutoExit(false);

    src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -62,7 +62,7 @@ protected static function createKernel(array $options = [])
    6262
    $options['test_case'],
    6363
    isset($options['root_config']) ? $options['root_config'] : 'config.yml',
    6464
    isset($options['environment']) ? $options['environment'] : strtolower(static::getVarDir().$options['test_case']),
    65-
    isset($options['debug']) ? $options['debug'] : true
    65+
    isset($options['debug']) ? $options['debug'] : false
    6666
    );
    6767
    }
    6868

    src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -67,7 +67,7 @@ public function prepend(ContainerBuilder $container)
    6767
    foreach ($container->getExtensionConfig('framework') as $config) {
    6868
    if (isset($config['session']) && \is_array($config['session'])) {
    6969
    $rememberMeSecureDefault = $config['session']['cookie_secure'] ?? $rememberMeSecureDefault;
    70-
    $rememberMeSameSiteDefault = array_key_exists('cookie_samesite', $config['session']) ? $config['session']['cookie_samesite'] : $rememberMeSameSiteDefault;
    70+
    $rememberMeSameSiteDefault = \array_key_exists('cookie_samesite', $config['session']) ? $config['session']['cookie_samesite'] : $rememberMeSameSiteDefault;
    7171
    }
    7272
    }
    7373
    foreach ($this->listenerPositions as $position) {
    @@ -412,7 +412,7 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
    412412
    foreach ($this->factories as $position) {
    413413
    foreach ($position as $factory) {
    414414
    $key = str_replace('-', '_', $factory->getKey());
    415-
    if (array_key_exists($key, $firewall)) {
    415+
    if (\array_key_exists($key, $firewall)) {
    416416
    $listenerKeys[] = $key;
    417417
    }
    418418
    }

    src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -62,7 +62,7 @@ protected static function createKernel(array $options = [])
    6262
    $options['test_case'],
    6363
    isset($options['root_config']) ? $options['root_config'] : 'config.yml',
    6464
    isset($options['environment']) ? $options['environment'] : strtolower(static::getVarDir().$options['test_case']),
    65-
    isset($options['debug']) ? $options['debug'] : true
    65+
    isset($options['debug']) ? $options['debug'] : false
    6666
    );
    6767
    }
    6868

    src/Symfony/Bundle/WebServerBundle/Resources/router.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -17,8 +17,8 @@
    1717
    * If you have custom directory layout, then you have to write your own router
    1818
    * and pass it as a value to 'router' option of server:run command.
    1919
    *
    20-
    * @author: Michał Pipa <michal.pipa.xsolve@gmail.com>
    21-
    * @author: Albert Jessurum <ajessu@gmail.com>
    20+
    * @author Michał Pipa <michal.pipa.xsolve@gmail.com>
    21+
    * @author Albert Jessurum <ajessu@gmail.com>
    2222
    */
    2323

    2424
    // Workaround https://bugs.php.net/64566

    src/Symfony/Component/BrowserKit/Client.php

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -548,7 +548,7 @@ public function back()
    548548
    {
    549549
    do {
    550550
    $request = $this->history->back();
    551-
    } while (array_key_exists(serialize($request), $this->redirects));
    551+
    } while (\array_key_exists(serialize($request), $this->redirects));
    552552

    553553
    return $this->requestFromRequest($request, false);
    554554
    }
    @@ -562,7 +562,7 @@ public function forward()
    562562
    {
    563563
    do {
    564564
    $request = $this->history->forward();
    565-
    } while (array_key_exists(serialize($request), $this->redirects));
    565+
    } while (\array_key_exists(serialize($request), $this->redirects));
    566566

    567567
    return $this->requestFromRequest($request, false);
    568568
    }

    src/Symfony/Component/Cache/Adapter/AbstractAdapter.php

    Lines changed: 6 additions & 10 deletions
    Original file line numberDiff line numberDiff line change
    @@ -94,7 +94,7 @@ function ($deferred, $namespace, &$expiredIds) use ($getId) {
    9494
    }
    9595

    9696
    /**
    97-
    * Returns an ApcuAdapter if supported, a PhpFilesAdapter otherwise.
    97+
    * Returns the best possible adapter that your runtime supports.
    9898
    *
    9999
    * Using ApcuAdapter makes system caches compatible with read-only filesystems.
    100100
    *
    @@ -108,16 +108,12 @@ function ($deferred, $namespace, &$expiredIds) use ($getId) {
    108108
    */
    109109
    public static function createSystemCache($namespace, $defaultLifetime, $version, $directory, LoggerInterface $logger = null)
    110110
    {
    111-
    if (null === self::$apcuSupported) {
    112-
    self::$apcuSupported = ApcuAdapter::isSupported();
    111+
    $opcache = new PhpFilesAdapter($namespace, $defaultLifetime, $directory, true);
    112+
    if (null !== $logger) {
    113+
    $opcache->setLogger($logger);
    113114
    }
    114115

    115-
    if (!self::$apcuSupported) {
    116-
    $opcache = new PhpFilesAdapter($namespace, $defaultLifetime, $directory, true);
    117-
    if (null !== $logger) {
    118-
    $opcache->setLogger($logger);
    119-
    }
    120-
    116+
    if (!self::$apcuSupported = self::$apcuSupported ?? ApcuAdapter::isSupported()) {
    121117
    return $opcache;
    122118
    }
    123119

    @@ -128,7 +124,7 @@ public static function createSystemCache($namespace, $defaultLifetime, $version,
    128124
    $apcu->setLogger($logger);
    129125
    }
    130126

    131-
    return $apcu;
    127+
    return new ChainAdapter([$apcu, $opcache]);
    132128
    }
    133129

    134130
    public static function createConnection($dsn, array $options = [])

    src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -22,7 +22,7 @@ protected function setUp()
    2222
    {
    2323
    parent::setUp();
    2424

    25-
    if (!array_key_exists('testPrune', $this->skippedTests) && !$this->createCachePool() instanceof PruneableInterface) {
    25+
    if (!\array_key_exists('testPrune', $this->skippedTests) && !$this->createCachePool() instanceof PruneableInterface) {
    2626
    $this->skippedTests['testPrune'] = 'Not a pruneable cache pool.';
    2727
    }
    2828
    }

    src/Symfony/Component/Cache/Tests/Psr16CacheTest.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -25,7 +25,7 @@ protected function setUp()
    2525
    {
    2626
    parent::setUp();
    2727

    28-
    if (array_key_exists('testPrune', $this->skippedTests)) {
    28+
    if (\array_key_exists('testPrune', $this->skippedTests)) {
    2929
    return;
    3030
    }
    3131

    src/Symfony/Component/Cache/Tests/Simple/CacheTestCase.php

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -21,7 +21,7 @@ protected function setUp()
    2121
    {
    2222
    parent::setUp();
    2323

    24-
    if (!array_key_exists('testPrune', $this->skippedTests) && !$this->createSimpleCache() instanceof PruneableInterface) {
    24+
    if (!\array_key_exists('testPrune', $this->skippedTests) && !$this->createSimpleCache() instanceof PruneableInterface) {
    2525
    $this->skippedTests['testPrune'] = 'Not a pruneable cache pool.';
    2626
    }
    2727
    }

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

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -166,7 +166,7 @@ public static function createConnection($servers, array $options = [])
    166166
    $client->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
    167167
    $client->setOption(\Memcached::OPT_NO_BLOCK, true);
    168168
    $client->setOption(\Memcached::OPT_TCP_NODELAY, true);
    169-
    if (!array_key_exists('LIBKETAMA_COMPATIBLE', $options) && !array_key_exists(\Memcached::OPT_LIBKETAMA_COMPATIBLE, $options)) {
    169+
    if (!\array_key_exists('LIBKETAMA_COMPATIBLE', $options) && !\array_key_exists(\Memcached::OPT_LIBKETAMA_COMPATIBLE, $options)) {
    170170
    $client->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
    171171
    }
    172172
    foreach ($options as $name => $value) {

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

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -284,7 +284,7 @@ protected function doFetch(array $ids)
    284284

    285285
    $result = [];
    286286

    287-
    if ($this->redis instanceof \Predis\Client) {
    287+
    if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) {
    288288
    $values = $this->pipeline(function () use ($ids) {
    289289
    foreach ($ids as $id) {
    290290
    yield 'get' => [$id];

    src/Symfony/Component/Config/Definition/ArrayNode.php

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -59,7 +59,7 @@ protected function preNormalize($value)
    5959
    $normalized = [];
    6060

    6161
    foreach ($value as $k => $v) {
    62-
    if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
    62+
    if (false !== strpos($k, '-') && false === strpos($k, '_') && !\array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
    6363
    $normalized[$normalizedKey] = $v;
    6464
    } else {
    6565
    $normalized[$k] = $v;
    @@ -223,7 +223,7 @@ protected function finalizeValue($value)
    223223
    }
    224224

    225225
    foreach ($this->children as $name => $child) {
    226-
    if (!array_key_exists($name, $value)) {
    226+
    if (!\array_key_exists($name, $value)) {
    227227
    if ($child->isRequired()) {
    228228
    $ex = new InvalidConfigurationException(sprintf('The child node "%s" at path "%s" must be configured.', $name, $this->getPath()));
    229229
    $ex->setPath($this->getPath());
    @@ -383,7 +383,7 @@ protected function mergeValues($leftSide, $rightSide)
    383383

    384384
    foreach ($rightSide as $k => $v) {
    385385
    // no conflict
    386-
    if (!array_key_exists($k, $leftSide)) {
    386+
    if (!\array_key_exists($k, $leftSide)) {
    387387
    if (!$this->allowNewKeys) {
    388388
    $ex = new InvalidConfigurationException(sprintf('You are not allowed to define new elements for path "%s". Please define all elements for this path in one config file. If you are trying to overwrite an element, make sure you redefine it with the same name.', $this->getPath()));
    389389
    $ex->setPath($this->getPath());

    0 commit comments

    Comments
     (0)
    0