From 53f7f5f27eea66f09cfebaaad80d2f3c3c7878a3 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Wed, 28 Oct 2020 22:33:29 +0100 Subject: [PATCH] Fix CS --- .../DependencyInjection/SecurityExtension.php | 4 ++-- .../Cache/Adapter/CouchbaseBucketAdapter.php | 2 +- .../Component/Cache/Adapter/MemcachedAdapter.php | 2 +- .../Component/Cache/Adapter/PhpArrayAdapter.php | 2 +- .../DependencyInjection/Dumper/PhpDumper.php | 2 +- .../DependencyInjection/Loader/XmlFileLoader.php | 2 +- src/Symfony/Component/Filesystem/Filesystem.php | 2 +- .../RemoveEmptyControllerArgumentLocatorsPass.php | 2 +- .../Component/PropertyAccess/PropertyAccessor.php | 2 +- .../Component/Routing/Loader/XmlFileLoader.php | 4 ++-- .../Http/Tests/Firewall/LogoutListenerTest.php | 12 ++++++------ .../Component/Serializer/Encoder/CsvEncoder.php | 2 +- .../Validator/Test/ConstraintValidatorTestCase.php | 2 +- src/Symfony/Component/Workflow/Registry.php | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php index 4a8286a094..a1a972cb32 100644 --- a/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php +++ b/src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php @@ -449,7 +449,7 @@ class SecurityExtension extends Extension implements PrependExtensionInterface // Authentication listeners $firewallAuthenticationProviders = []; - list($authListeners, $defaultEntryPoint) = $this->createAuthenticationListeners($container, $id, $firewall, $firewallAuthenticationProviders, $defaultProvider, $providerIds, $configuredEntryPoint, $contextListenerId); + [$authListeners, $defaultEntryPoint] = $this->createAuthenticationListeners($container, $id, $firewall, $firewallAuthenticationProviders, $defaultProvider, $providerIds, $configuredEntryPoint, $contextListenerId); if (!$this->authenticatorManagerEnabled) { $authenticationProviders = array_merge($authenticationProviders, $firewallAuthenticationProviders); @@ -567,7 +567,7 @@ class SecurityExtension extends Extension implements PrependExtensionInterface $entryPoints[$key] = $entryPoint; } } else { - list($provider, $listenerId, $defaultEntryPoint) = $factory->create($container, $id, $firewall[$key], $userProvider, $defaultEntryPoint); + [$provider, $listenerId, $defaultEntryPoint] = $factory->create($container, $id, $firewall[$key], $userProvider, $defaultEntryPoint); $listeners[] = new Reference($listenerId); $authenticationProviders[] = $provider; diff --git a/src/Symfony/Component/Cache/Adapter/CouchbaseBucketAdapter.php b/src/Symfony/Component/Cache/Adapter/CouchbaseBucketAdapter.php index 0fd2727001..a0e8f40271 100644 --- a/src/Symfony/Component/Cache/Adapter/CouchbaseBucketAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/CouchbaseBucketAdapter.php @@ -134,7 +134,7 @@ class CouchbaseBucketAdapter extends AbstractAdapter $optionsInArray = explode('&', $options); foreach ($optionsInArray as $option) { - list($key, $value) = explode('=', $option); + [$key, $value] = explode('=', $option); if (\in_array($key, static::VALID_DSN_OPTIONS, true)) { $results[$key] = $value; diff --git a/src/Symfony/Component/Cache/Adapter/MemcachedAdapter.php b/src/Symfony/Component/Cache/Adapter/MemcachedAdapter.php index 038892eabc..53ead840c4 100644 --- a/src/Symfony/Component/Cache/Adapter/MemcachedAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/MemcachedAdapter.php @@ -123,7 +123,7 @@ This conversation was marked as resolved by lstrojny } $params = preg_replace_callback('#^memcached:(//)?(?:([^@]*+)@)?#', function ($m) use (&$username, &$password) { if (!empty($m[2])) { - list($username, $password) = explode(':', $m[2], 2) + [1 => null]; + [$username, $password] = explode(':', $m[2], 2) + [1 => null]; } return 'file:'.($m[1] ?? ''); diff --git a/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php b/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php index 0abf787f44..a8f8f3038a 100644 --- a/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php +++ b/src/Symfony/Component/Cache/Adapter/PhpArrayAdapter.php @@ -401,7 +401,7 @@ EOF; if (2 !== \count($values) || !isset($values[0], $values[1])) { $this->keys = $this->values = []; } else { - list($this->keys, $this->values) = $values; + [$this->keys, $this->values] = $values; } } diff --git a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php index 4bceb4960a..1793516287 100644 --- a/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php +++ b/src/Symfony/Component/DependencyInjection/Dumper/PhpDumper.php @@ -1094,7 +1094,7 @@ EOTXT $definitions = $this->container->getDefinitions(); ksort($definitions); foreach ($definitions as $id => $definition) { - if ((list($file, $code) = $services[$id]) && null !== $file && ($definition->isPublic() || !$this->isTrivialInstance($definition) || isset($this->locatedIds[$id]))) { + if (([$file, $code] = $services[$id]) && null !== $file && ($definition->isPublic() || !$this->isTrivialInstance($definition) || isset($this->locatedIds[$id]))) { yield $file => [$code, $definition->hasTag($this->hotPathTag) || !$definition->hasTag($this->preloadTags[1]) && !$definition->isDeprecated() && !$definition->hasErrors()]; } } diff --git a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php index 33b5a009f7..e4620912cb 100644 --- a/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php @@ -430,7 +430,7 @@ class XmlFileLoader extends FileLoader // resolve definitions uksort($definitions, 'strnatcmp'); - foreach (array_reverse($definitions) as $id => list($domElement, $file)) { + foreach (array_reverse($definitions) as $id => [$domElement, $file]) { if (null !== $definition = $this->parseDefinition($domElement, $file, new Definition())) { $this->setDefinition($id, $definition); } diff --git a/src/Symfony/Component/Filesystem/Filesystem.php b/src/Symfony/Component/Filesystem/Filesystem.php index 1a1f1cc59b..d9609f5484 100644 --- a/src/Symfony/Component/Filesystem/Filesystem.php +++ b/src/Symfony/Component/Filesystem/Filesystem.php @@ -590,7 +590,7 @@ class Filesystem public function tempnam(string $dir, string $prefix/*, string $suffix = ''*/) { $suffix = \func_num_args() > 2 ? func_get_arg(2) : ''; - list($scheme, $hierarchy) = $this->getSchemeAndHierarchy($dir); + [$scheme, $hierarchy] = $this->getSchemeAndHierarchy($dir); // If no scheme or scheme is "file" or "gs" (Google Cloud) create temp file in local filesystem if ((null === $scheme || 'file' === $scheme || 'gs' === $scheme) && '' === $suffix) { diff --git a/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php b/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php index 0d4bfb9f18..5f54e9c164 100644 --- a/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php +++ b/src/Symfony/Component/HttpKernel/DependencyInjection/RemoveEmptyControllerArgumentLocatorsPass.php @@ -42,7 +42,7 @@ class RemoveEmptyControllerArgumentLocatorsPass implements CompilerPassInterface } else { // any methods listed for call-at-instantiation cannot be actions $reason = false; - list($id, $action) = explode('::', $controller); + [$id, $action] = explode('::', $controller); if ($container->hasAlias($id)) { continue; diff --git a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php index 0bc7b5c66b..cb4051d3a0 100644 --- a/src/Symfony/Component/PropertyAccess/PropertyAccessor.php +++ b/src/Symfony/Component/PropertyAccess/PropertyAccessor.php @@ -404,7 +404,7 @@ class PropertyAccessor implements PropertyAccessorInterface try { $result[self::VALUE] = $object->$name(); } catch (\TypeError $e) { - list($trace) = $e->getTrace(); + [$trace] = $e->getTrace(); // handle uninitialized properties in PHP >= 7 if (__FILE__ === $trace['file'] diff --git a/src/Symfony/Component/Routing/Loader/XmlFileLoader.php b/src/Symfony/Component/Routing/Loader/XmlFileLoader.php index e64089fb30..dbff4a87b3 100644 --- a/src/Symfony/Component/Routing/Loader/XmlFileLoader.php +++ b/src/Symfony/Component/Routing/Loader/XmlFileLoader.php @@ -118,7 +118,7 @@ class XmlFileLoader extends FileLoader $schemes = preg_split('/[\s,\|]++/', $node->getAttribute('schemes'), -1, \PREG_SPLIT_NO_EMPTY); $methods = preg_split('/[\s,\|]++/', $node->getAttribute('methods'), -1, \PREG_SPLIT_NO_EMPTY); - list($defaults, $requirements, $options, $condition, $paths, /* $prefixes */, $hosts) = $this->parseConfigs($node, $path); + [$defaults, $requirements, $options, $condition, $paths, /* $prefixes */, $hosts] = $this->parseConfigs($node, $path); if (!$paths && '' === $node->getAttribute('path')) { throw new \InvalidArgumentException(sprintf('The element in file "%s" must have a "path" attribute or child nodes.', $path)); @@ -163,7 +163,7 @@ class XmlFileLoader extends FileLoader $trailingSlashOnRoot = $node->hasAttribute('trailing-slash-on-root') ? XmlUtils::phpize($node->getAttribute('trailing-slash-on-root')) : true; $namePrefix = $node->getAttribute('name-prefix') ?: null; - list($defaults, $requirements, $options, $condition, /* $paths */, $prefixes, $hosts) = $this->parseConfigs($node, $path); + [$defaults, $requirements, $options, $condition, /* $paths */, $prefixes, $hosts] = $this->parseConfigs($node, $path); if ('' !== $prefix && $prefixes) { throw new \InvalidArgumentException(sprintf('The element in file "%s" must not have both a "prefix" attribute and child nodes.', $path)); diff --git a/src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php b/src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php index 71c4c0916d..109c841af7 100644 --- a/src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php +++ b/src/Symfony/Component/Security/Http/Tests/Firewall/LogoutListenerTest.php @@ -28,7 +28,7 @@ class LogoutListenerTest extends TestCase public function testHandleUnmatchedPath() { $dispatcher = $this->getEventDispatcher(); - list($listener, , $httpUtils, $options) = $this->getListener($dispatcher); + [$listener, , $httpUtils, $options] = $this->getListener($dispatcher); [$event, $request] = $this->getGetResponseEvent(); @@ -52,7 +52,7 @@ class LogoutListenerTest extends TestCase $tokenManager = $this->getTokenManager(); $dispatcher = $this->getEventDispatcher(); - list($listener, $tokenStorage, $httpUtils, $options) = $this->getListener($dispatcher, $tokenManager); + [$listener, $tokenStorage, $httpUtils, $options] = $this->getListener($dispatcher, $tokenManager); [$event, $request] = $this->getGetResponseEvent(); @@ -90,7 +90,7 @@ class LogoutListenerTest extends TestCase public function testHandleMatchedPathWithoutCsrfValidation() { $dispatcher = $this->getEventDispatcher(); - list($listener, $tokenStorage, $httpUtils, $options) = $this->getListener($dispatcher); + [$listener, $tokenStorage, $httpUtils, $options] = $this->getListener($dispatcher); [$event, $request] = $this->getGetResponseEvent(); @@ -123,7 +123,7 @@ class LogoutListenerTest extends TestCase { $this->expectException('RuntimeException'); - list($listener, , $httpUtils, $options) = $this->getListener(); + [$listener, , $httpUtils, $options] = $this->getListener(); [$event, $request] = $this->getGetResponseEvent(); @@ -168,12 +168,12 @@ class LogoutListenerTest extends TestCase $this->expectDeprecation('Since symfony/security-http 5.1: Calling "%s::addHandler" is deprecated, register a listener on the "%s" event instead.'); $logoutSuccessHandler = $this->createMock(LogoutSuccessHandlerInterface::class); - list($listener, $tokenStorage, $httpUtils, $options) = $this->getListener($logoutSuccessHandler); + [$listener, $tokenStorage, $httpUtils, $options] = $this->getListener($logoutSuccessHandler); $token = $this->getToken(); $tokenStorage->expects($this->any())->method('getToken')->willReturn($token); - list($event, $request) = $this->getGetResponseEvent(); + [$event, $request] = $this->getGetResponseEvent(); $httpUtils->expects($this->once()) ->method('checkRequestPath') diff --git a/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php b/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php index b939e8557e..631defab32 100644 --- a/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php +++ b/src/Symfony/Component/Serializer/Encoder/CsvEncoder.php @@ -142,7 +142,7 @@ class CsvEncoder implements EncoderInterface, DecoderInterface $headerCount = []; $result = []; - list($delimiter, $enclosure, $escapeChar, $keySeparator, , , , $asCollection) = $this->getCsvOptions($context); + [$delimiter, $enclosure, $escapeChar, $keySeparator, , , , $asCollection] = $this->getCsvOptions($context); while (false !== ($cols = fgetcsv($handle, 0, $delimiter, $enclosure, $escapeChar))) { $nbCols = \count($cols); diff --git a/src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php b/src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php index cce35db0dd..7a5518c699 100644 --- a/src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php +++ b/src/Symfony/Component/Validator/Test/ConstraintValidatorTestCase.php @@ -473,7 +473,7 @@ class AssertingContextualValidator implements ContextualValidatorInterface return $this; } - list($expectedValue, $expectedGroup, $expectedConstraints, $violation) = $this->expectedValidate[$this->validateCalls]; + [$expectedValue, $expectedGroup, $expectedConstraints, $violation] = $this->expectedValidate[$this->validateCalls]; Assert::assertSame($expectedValue, $value); $expectedConstraints($constraints); diff --git a/src/Symfony/Component/Workflow/Registry.php b/src/Symfony/Component/Workflow/Registry.php index 6fef168244..3474e953fa 100644 --- a/src/Symfony/Component/Workflow/Registry.php +++ b/src/Symfony/Component/Workflow/Registry.php @@ -29,7 +29,7 @@ class Registry public function has(object $subject, string $workflowName = null): bool { - foreach ($this->workflows as list($workflow, $supportStrategy)) { + foreach ($this->workflows as [$workflow, $supportStrategy]) { if ($this->supports($workflow, $supportStrategy, $subject, $workflowName)) { return true; }