Skip to content
Permalink
Browse files

Merge branch '3.4' into 4.2

* 3.4: (24 commits)
  Apply php-cs-fixer rule for array_key_exists()
  [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
  [Validator] Add the missing translations for the Greek (el) locale
  ...
  • Loading branch information...
nicolas-grekas committed Feb 23, 2019
2 parents 8ac69b9 + b0a3208 commit 87f3c36d6008ca0627e216c1624a610a03a9dd09
Showing with 887 additions and 287 deletions.
  1. +1 −1 UPGRADE-4.0.md
  2. +2 −2 src/Symfony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterMappingsPass.php
  3. +1 −1 src/Symfony/Bridge/Doctrine/Form/DoctrineOrmTypeGuesser.php
  4. +1 −1 src/Symfony/Bridge/Doctrine/Security/User/EntityUserProvider.php
  5. +2 −2 src/Symfony/Bridge/Monolog/Handler/FingersCrossed/HttpCodeActivationStrategy.php
  6. +1 −2 src/Symfony/Bridge/ProxyManager/Tests/LazyProxy/PhpDumper/Fixtures/proxy-factory.php
  7. +2 −2 src/Symfony/Bridge/Twig/NodeVisitor/Scope.php
  8. +1 −1 src/Symfony/Bundle/FrameworkBundle/Command/ConfigDebugCommand.php
  9. +1 −1 src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/Descriptor.php
  10. +1 −1 src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/JsonDescriptor.php
  11. +1 −1 src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/MarkdownDescriptor.php
  12. +1 −1 src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/TextDescriptor.php
  13. +1 −1 src/Symfony/Bundle/FrameworkBundle/Console/Descriptor/XmlDescriptor.php
  14. +2 −2 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
  15. +3 −3 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
  16. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/Command/CacheClearCommand/CacheClearCommandTest.php
  17. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/Functional/ContainerDebugCommandTest.php
  18. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/Functional/WebTestCase.php
  19. +2 −2 src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
  20. +1 −1 src/Symfony/Bundle/SecurityBundle/Tests/Functional/WebTestCase.php
  21. +2 −2 src/Symfony/Bundle/WebServerBundle/Resources/router.php
  22. +2 −2 src/Symfony/Component/BrowserKit/Client.php
  23. +1 −1 src/Symfony/Component/Cache/Tests/Adapter/AdapterTestCase.php
  24. +1 −1 src/Symfony/Component/Cache/Tests/Simple/CacheTestCase.php
  25. +1 −1 src/Symfony/Component/Cache/Traits/MemcachedTrait.php
  26. +1 −1 src/Symfony/Component/Cache/Traits/RedisTrait.php
  27. +3 −3 src/Symfony/Component/Config/Definition/ArrayNode.php
  28. +4 −4 src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php
  29. +4 −4 src/Symfony/Component/Config/Definition/PrototypedArrayNode.php
  30. +7 −0 src/Symfony/Component/Console/Application.php
  31. +4 −0 src/Symfony/Component/Console/Helper/QuestionHelper.php
  32. +20 −1 src/Symfony/Component/Console/Input/ArgvInput.php
  33. +1 −1 src/Symfony/Component/Console/Input/ArrayInput.php
  34. +2 −2 src/Symfony/Component/Console/Input/Input.php
  35. +3 −1 src/Symfony/Component/Console/Input/InputDefinition.php
  36. +1 −1 src/Symfony/Component/Console/Tester/TesterTrait.php
  37. +13 −0 src/Symfony/Component/Console/Tests/ApplicationTest.php
  38. +37 −0 src/Symfony/Component/Console/Tests/Helper/QuestionHelperTest.php
  39. +8 −0 src/Symfony/Component/Console/Tests/Input/ArgvInputTest.php
  40. +1 −1 src/Symfony/Component/Debug/ErrorHandler.php
  41. +4 −4 src/Symfony/Component/Debug/Tests/DebugClassLoaderTest.php
  42. +1 −1 src/Symfony/Component/DependencyInjection/ChildDefinition.php
  43. +1 −1 src/Symfony/Component/DependencyInjection/Compiler/AutowirePass.php
  44. +2 −2 src/Symfony/Component/DependencyInjection/Compiler/RegisterServiceSubscribersPass.php
  45. +3 −3 src/Symfony/Component/DependencyInjection/Compiler/ResolveBindingsPass.php
  46. +1 −1 src/Symfony/Component/DependencyInjection/Compiler/ResolveNamedArgumentsPass.php
  47. +1 −1 src/Symfony/Component/DependencyInjection/Container.php
  48. +2 −2 src/Symfony/Component/DependencyInjection/Definition.php
  49. +1 −1 src/Symfony/Component/DependencyInjection/Dumper/GraphvizDumper.php
  50. +1 −1 src/Symfony/Component/DependencyInjection/EnvVarProcessor.php
  51. +1 −1 src/Symfony/Component/DependencyInjection/Extension/Extension.php
  52. +1 −1 src/Symfony/Component/DependencyInjection/LazyProxy/Instantiator/RealServiceInstantiator.php
  53. +1 −1 src/Symfony/Component/DependencyInjection/Loader/XmlFileLoader.php
  54. +6 −6 src/Symfony/Component/DependencyInjection/Loader/YamlFileLoader.php
  55. +2 −2 src/Symfony/Component/DependencyInjection/ParameterBag/ParameterBag.php
  56. +1 −1 src/Symfony/Component/DomCrawler/Crawler.php
  57. +1 −1 src/Symfony/Component/DomCrawler/Field/FileFormField.php
  58. +2 −2 src/Symfony/Component/DomCrawler/FormFieldRegistry.php
  59. +6 −2 src/Symfony/Component/EventDispatcher/Debug/WrappedListener.php
  60. +1 −1 src/Symfony/Component/EventDispatcher/GenericEvent.php
  61. +10 −7 src/Symfony/Component/Finder/Finder.php
  62. +23 −0 src/Symfony/Component/Finder/Tests/FinderTest.php
  63. +4 −4 src/Symfony/Component/Form/ButtonBuilder.php
  64. +2 −2 src/Symfony/Component/Form/ChoiceList/ArrayChoiceList.php
  65. +1 −1 src/Symfony/Component/Form/ChoiceList/LazyChoiceList.php
  66. +1 −1 src/Symfony/Component/Form/Console/Descriptor/JsonDescriptor.php
  67. +1 −1 src/Symfony/Component/Form/Console/Descriptor/TextDescriptor.php
  68. +8 −0 src/Symfony/Component/Form/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformer.php
  69. +1 −1 src/Symfony/Component/Form/Extension/Core/Type/FormType.php
  70. +2 −2 src/Symfony/Component/Form/Extension/Validator/Constraints/FormValidator.php
  71. +1 −4 src/Symfony/Component/Form/Extension/Validator/ViolationMapper/ViolationMapper.php
  72. +4 −4 src/Symfony/Component/Form/Form.php
  73. +4 −4 src/Symfony/Component/Form/FormConfigBuilder.php
  74. +1 −1 src/Symfony/Component/Form/FormFactory.php
  75. +1 −1 src/Symfony/Component/Form/FormRenderer.php
  76. +4 −4 src/Symfony/Component/Form/NativeRequestHandler.php
  77. +28 −7 ...y/Component/Form/Tests/Extension/Core/DataTransformer/IntegerToLocalizedStringTransformerTest.php
  78. +4 −3 src/Symfony/Component/Form/Tests/Extension/Core/Type/IntegerTypeTest.php
  79. +38 −41 src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php
  80. +81 −0 src/Symfony/Component/Form/Tests/Extension/Validator/ValidatorExtensionTest.php
  81. +4 −4 src/Symfony/Component/Form/Tests/Extension/Validator/ViolationMapper/ViolationMapperTest.php
  82. +1 −1 src/Symfony/Component/Form/Tests/Fixtures/CustomArrayObject.php
  83. +1 −1 src/Symfony/Component/Form/Tests/Fixtures/FixedDataTransformer.php
  84. +4 −4 src/Symfony/Component/HttpFoundation/HeaderBag.php
  85. +2 −2 src/Symfony/Component/HttpFoundation/ParameterBag.php
  86. +1 −1 src/Symfony/Component/HttpFoundation/RedirectResponse.php
  87. +75 −0 src/Symfony/Component/HttpFoundation/Request.php
  88. +2 −2 src/Symfony/Component/HttpFoundation/ResponseHeaderBag.php
  89. +3 −3 src/Symfony/Component/HttpFoundation/Session/Attribute/AttributeBag.php
  90. +4 −4 src/Symfony/Component/HttpFoundation/Session/Attribute/NamespacedAttributeBag.php
  91. +3 −3 src/Symfony/Component/HttpFoundation/Session/Flash/AutoExpireFlashBag.php
  92. +1 −1 src/Symfony/Component/HttpFoundation/Session/Flash/FlashBag.php
  93. +3 −4 src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php
  94. +1 −1 src/Symfony/Component/HttpKernel/Fragment/InlineFragmentRenderer.php
  95. +1 −1 src/Symfony/Component/Intl/Data/Generator/LocaleDataGenerator.php
  96. +1 −1 src/Symfony/Component/Intl/Data/Util/RecursiveArrayAccess.php
  97. +2 −2 src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php
  98. +2 −2 src/Symfony/Component/Messenger/Transport/AmqpExt/Connection.php
  99. +1 −1 src/Symfony/Component/OptionsResolver/Debug/OptionsResolverIntrospector.php
  100. +6 −6 src/Symfony/Component/OptionsResolver/OptionsResolver.php
  101. +2 −2 src/Symfony/Component/PropertyAccess/PropertyAccessor.php
  102. +1 −1 src/Symfony/Component/PropertyAccess/Tests/Fixtures/NonTraversableArrayObject.php
  103. +1 −1 src/Symfony/Component/PropertyAccess/Tests/Fixtures/TraversableArrayObject.php
  104. +1 −1 src/Symfony/Component/PropertyInfo/PropertyInfoCacheExtractor.php
  105. +5 −4 src/Symfony/Component/Routing/Generator/UrlGenerator.php
  106. +1 −1 src/Symfony/Component/Routing/RequestContext.php
  107. +3 −3 src/Symfony/Component/Routing/Route.php
  108. +3 −3 src/Symfony/Component/Routing/Router.php
  109. +17 −0 src/Symfony/Component/Routing/Tests/Generator/UrlGeneratorTest.php
  110. +2 −2 src/Symfony/Component/Security/Core/Authentication/Token/AbstractToken.php
  111. +1 −1 src/Symfony/Component/Security/Core/Authorization/AccessDecisionManager.php
  112. +1 −1 src/Symfony/Component/Security/Core/Encoder/EncoderFactory.php
  113. +1 −1 src/Symfony/Component/Security/Http/Firewall/SimpleFormAuthenticationListener.php
  114. +1 −1 src/Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener.php
  115. +82 −1 ...Symfony/Component/Security/Http/Tests/Firewall/UsernamePasswordFormAuthenticationListenerTest.php
  116. +1 −1 src/Symfony/Component/Serializer/Mapping/ClassDiscriminatorFromClassMetadata.php
  117. +4 −4 src/Symfony/Component/Serializer/Normalizer/AbstractNormalizer.php
  118. +1 −0 src/Symfony/Component/Serializer/Normalizer/DateTimeNormalizer.php
  119. +1 −1 src/Symfony/Component/Serializer/Normalizer/ObjectNormalizer.php
  120. +2 −2 src/Symfony/Component/Templating/TemplateReference.php
  121. +1 −1 src/Symfony/Component/Translation/Dumper/FileDumper.php
  122. +4 −4 src/Symfony/Component/Translation/Dumper/XliffFileDumper.php
  123. +2 −2 src/Symfony/Component/Validator/Constraint.php
  124. +1 −1 src/Symfony/Component/Validator/Constraints/CollectionValidator.php
  125. +4 −4 src/Symfony/Component/Validator/Constraints/Email.php
  126. +1 −1 src/Symfony/Component/Validator/Constraints/IbanValidator.php
  127. +1 −1 src/Symfony/Component/Validator/Constraints/LessThanOrEqual.php
  128. +1 −1 src/Symfony/Component/Validator/Constraints/Regex.php
  129. +1 −1 src/Symfony/Component/Validator/Constraints/Traverse.php
  130. +2 −2 src/Symfony/Component/Validator/Constraints/Url.php
  131. +1 −1 src/Symfony/Component/Validator/Mapping/ClassMetadata.php
  132. +2 −2 src/Symfony/Component/Validator/Mapping/ClassMetadataInterface.php
  133. +112 −0 src/Symfony/Component/Validator/Resources/translations/validators.af.xlf
  134. +52 −0 src/Symfony/Component/Validator/Resources/translations/validators.el.xlf
  135. +16 −0 src/Symfony/Component/Validator/Resources/translations/validators.hr.xlf
  136. +20 −0 src/Symfony/Component/Validator/Resources/translations/validators.pt_BR.xlf
  137. +1 −1 src/Symfony/Component/Validator/Tests/Fixtures/CustomArrayObject.php
  138. +3 −3 src/Symfony/Component/VarDumper/Caster/DoctrineCaster.php
  139. +1 −1 src/Symfony/Component/VarDumper/Cloner/Data.php
  140. +2 −0 src/Symfony/Component/VarDumper/Cloner/VarCloner.php
  141. +3 −3 src/Symfony/Component/Workflow/DependencyInjection/ValidateWorkflowsPass.php
  142. +1 −1 src/Symfony/Component/Workflow/Tests/Validator/StateMachineValidatorTest.php
  143. +2 −2 src/Symfony/Component/Workflow/Tests/Validator/WorkflowValidatorTest.php
  144. +1 −1 src/Symfony/Component/Yaml/Inline.php
  145. +2 −2 src/Symfony/Component/Yaml/Parser.php
@@ -230,7 +230,7 @@ DependencyInjection
supported.

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

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

@@ -24,8 +24,8 @@
* The compiler pass is meant to register the mappings with the metadata
* chain driver corresponding to one of the object managers.
*
* For concrete implementations that are easy to use, see the
* RegisterXyMappingsPass classes in the DoctrineBundle resp.
* For concrete implementations, see the RegisterXyMappingsPass classes
* in the DoctrineBundle resp.
* DoctrineMongodbBundle, DoctrineCouchdbBundle and DoctrinePhpcrBundle.
*
* @author David Buchmann <david@liip.ch>
@@ -165,7 +165,7 @@ protected function getMetadata($class)
// normalize class name
$class = self::getRealClass(ltrim($class, '\\'));
if (array_key_exists($class, $this->cache)) {
if (\array_key_exists($class, $this->cache)) {
return $this->cache[$class];
}
@@ -20,7 +20,7 @@
/**
* Wrapper around a Doctrine ObjectManager.
*
* Provides easy to use provisioning for Doctrine entity users.
* Provides provisioning for Doctrine entity users.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
@@ -31,10 +31,10 @@ class HttpCodeActivationStrategy extends ErrorLevelActivationStrategy
public function __construct(RequestStack $requestStack, array $exclusions, $actionLevel)
{
foreach ($exclusions as $exclusion) {
if (!array_key_exists('code', $exclusion)) {
if (!\array_key_exists('code', $exclusion)) {
throw new \LogicException(sprintf('An exclusion must have a "code" key'));
}
if (!array_key_exists('urls', $exclusion)) {
if (!\array_key_exists('urls', $exclusion)) {
throw new \LogicException(sprintf('An exclusion must have a "urls" key'));
}
}
@@ -1,7 +1,6 @@
<?php
return new class
{
return new class() {
public $proxyClass;
private $privates = [];
@@ -77,7 +77,7 @@ public function set($key, $value)
*/
public function has($key)
{
if (array_key_exists($key, $this->data)) {
if (\array_key_exists($key, $this->data)) {
return true;
}
@@ -98,7 +98,7 @@ public function has($key)
*/
public function get($key, $default = null)
{
if (array_key_exists($key, $this->data)) {
if (\array_key_exists($key, $this->data)) {
return $this->data[$key];
}
@@ -138,7 +138,7 @@ private function getConfigForPath(array $config, string $path, string $alias)
$steps = explode('.', $path);
foreach ($steps as $step) {
if (!array_key_exists($step, $config)) {
if (!\array_key_exists($step, $config)) {
throw new LogicException(sprintf('Unable to find configuration for "%s.%s"', $alias, $path));
}
@@ -227,7 +227,7 @@ protected function resolveServiceDefinition(ContainerBuilder $builder, $serviceI
return $builder->getDefinition($serviceId);
}
// Some service IDs don't have a Definition, they're simply an Alias
// Some service IDs don't have a Definition, they're aliases
if ($builder->hasAlias($serviceId)) {
return $builder->getAlias($serviceId);
}
@@ -156,7 +156,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
*/
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
{
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null), $options);
$this->writeData($this->getEventDispatcherListenersData($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null), $options);
}
/**
@@ -274,7 +274,7 @@ protected function describeContainerParameter($parameter, array $options = [])
*/
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
{
$event = array_key_exists('event', $options) ? $options['event'] : null;
$event = \array_key_exists('event', $options) ? $options['event'] : null;
$title = 'Registered listeners';
if (null !== $event) {
@@ -385,7 +385,7 @@ protected function describeContainerParameter($parameter, array $options = [])
*/
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
{
$event = array_key_exists('event', $options) ? $options['event'] : null;
$event = \array_key_exists('event', $options) ? $options['event'] : null;
if (null !== $event) {
$title = sprintf('Registered Listeners for "%s" Event', $event);
@@ -112,7 +112,7 @@ protected function describeContainerAlias(Alias $alias, array $options = [], Con
*/
protected function describeEventDispatcherListeners(EventDispatcherInterface $eventDispatcher, array $options = [])
{
$this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, array_key_exists('event', $options) ? $options['event'] : null));
$this->writeDocument($this->getEventDispatcherListenersDocument($eventDispatcher, \array_key_exists('event', $options) ? $options['event'] : null));
}
/**
@@ -327,7 +327,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
}
foreach ($places as $name => $place) {
if (\is_array($place) && array_key_exists('name', $place)) {
if (\is_array($place) && \array_key_exists('name', $place)) {
continue;
}
$place['name'] = $name;
@@ -365,7 +365,7 @@ private function addWorkflowSection(ArrayNodeDefinition $rootNode)
}
foreach ($transitions as $name => $transition) {
if (\is_array($transition) && array_key_exists('name', $transition)) {
if (\is_array($transition) && \array_key_exists('name', $transition)) {
continue;
}
$transition['name'] = $name;
@@ -919,7 +919,7 @@ private function registerAssetsConfiguration(array $config, ContainerBuilder $co
foreach ($config['packages'] as $name => $package) {
if (null !== $package['version_strategy']) {
$version = new Reference($package['version_strategy']);
} elseif (!array_key_exists('version', $package) && null === $package['json_manifest_path']) {
} elseif (!\array_key_exists('version', $package) && null === $package['json_manifest_path']) {
// if neither version nor json_manifest_path are specified, use the default
$version = $defaultVersion;
} else {
@@ -1117,15 +1117,15 @@ private function registerValidationConfiguration(array $config, ContainerBuilder
$definition = $container->findDefinition('validator.email');
$definition->replaceArgument(0, $config['email_validation_mode']);
if (array_key_exists('enable_annotations', $config) && $config['enable_annotations']) {
if (\array_key_exists('enable_annotations', $config) && $config['enable_annotations']) {
if (!$this->annotationsConfigEnabled) {
throw new \LogicException('"enable_annotations" on the validator cannot be set as Annotations support is disabled.');
}
$validatorBuilder->addMethodCall('enableAnnotationMapping', [new Reference('annotation_reader')]);
}
if (array_key_exists('static_method', $config) && $config['static_method']) {
if (\array_key_exists('static_method', $config) && $config['static_method']) {
foreach ($config['static_method'] as $methodName) {
$validatorBuilder->addMethodCall('addMethodMapping', [$methodName]);
}
@@ -51,7 +51,7 @@ public function testCacheIsFreshAfterCacheClearedWithWarmup()
// Ensure that all *.meta files are fresh
$finder = new Finder();
$metaFiles = $finder->files()->in($this->kernel->getCacheDir())->name('*.php.meta');
// simply check that cache is warmed up
// check that cache is warmed up
$this->assertNotEmpty($metaFiles);
$configCacheFactory = new ConfigCacheFactory(true);
@@ -22,7 +22,7 @@ class ContainerDebugCommandTest extends WebTestCase
{
public function testDumpContainerIfNotExists()
{
static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml']);
static::bootKernel(['test_case' => 'ContainerDebug', 'root_config' => 'config.yml', 'debug' => true]);
$application = new Application(static::$kernel);
$application->setAutoExit(false);
@@ -62,7 +62,7 @@ protected static function createKernel(array $options = [])
$options['test_case'],
isset($options['root_config']) ? $options['root_config'] : 'config.yml',
isset($options['environment']) ? $options['environment'] : strtolower(static::getVarDir().$options['test_case']),
isset($options['debug']) ? $options['debug'] : true
isset($options['debug']) ? $options['debug'] : false
);
}
@@ -67,7 +67,7 @@ public function prepend(ContainerBuilder $container)
foreach ($container->getExtensionConfig('framework') as $config) {
if (isset($config['session']) && \is_array($config['session'])) {
$rememberMeSecureDefault = $config['session']['cookie_secure'] ?? $rememberMeSecureDefault;
$rememberMeSameSiteDefault = array_key_exists('cookie_samesite', $config['session']) ? $config['session']['cookie_samesite'] : $rememberMeSameSiteDefault;
$rememberMeSameSiteDefault = \array_key_exists('cookie_samesite', $config['session']) ? $config['session']['cookie_samesite'] : $rememberMeSameSiteDefault;
}
}
foreach ($this->listenerPositions as $position) {
@@ -412,7 +412,7 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
foreach ($this->factories as $position) {
foreach ($position as $factory) {
$key = str_replace('-', '_', $factory->getKey());
if (array_key_exists($key, $firewall)) {
if (\array_key_exists($key, $firewall)) {
$listenerKeys[] = $key;
}
}
@@ -62,7 +62,7 @@ protected static function createKernel(array $options = [])
$options['test_case'],
isset($options['root_config']) ? $options['root_config'] : 'config.yml',
isset($options['environment']) ? $options['environment'] : strtolower(static::getVarDir().$options['test_case']),
isset($options['debug']) ? $options['debug'] : true
isset($options['debug']) ? $options['debug'] : false
);
}
@@ -17,8 +17,8 @@
* If you have custom directory layout, then you have to write your own router
* and pass it as a value to 'router' option of server:run command.
*
* @author: Michał Pipa <michal.pipa.xsolve@gmail.com>
* @author: Albert Jessurum <ajessu@gmail.com>
* @author Michał Pipa <michal.pipa.xsolve@gmail.com>
* @author Albert Jessurum <ajessu@gmail.com>
*/
// Workaround https://bugs.php.net/64566
@@ -548,7 +548,7 @@ public function back()
{
do {
$request = $this->history->back();
} while (array_key_exists(serialize($request), $this->redirects));
} while (\array_key_exists(serialize($request), $this->redirects));
return $this->requestFromRequest($request, false);
}
@@ -562,7 +562,7 @@ public function forward()
{
do {
$request = $this->history->forward();
} while (array_key_exists(serialize($request), $this->redirects));
} while (\array_key_exists(serialize($request), $this->redirects));
return $this->requestFromRequest($request, false);
}
@@ -22,7 +22,7 @@ protected function setUp()
{
parent::setUp();
if (!array_key_exists('testPrune', $this->skippedTests) && !$this->createCachePool() instanceof PruneableInterface) {
if (!\array_key_exists('testPrune', $this->skippedTests) && !$this->createCachePool() instanceof PruneableInterface) {
$this->skippedTests['testPrune'] = 'Not a pruneable cache pool.';
}
}
@@ -21,7 +21,7 @@ protected function setUp()
{
parent::setUp();
if (!array_key_exists('testPrune', $this->skippedTests) && !$this->createSimpleCache() instanceof PruneableInterface) {
if (!\array_key_exists('testPrune', $this->skippedTests) && !$this->createSimpleCache() instanceof PruneableInterface) {
$this->skippedTests['testPrune'] = 'Not a pruneable cache pool.';
}
}
@@ -166,7 +166,7 @@ public static function createConnection($servers, array $options = [])
$client->setOption(\Memcached::OPT_BINARY_PROTOCOL, true);
$client->setOption(\Memcached::OPT_NO_BLOCK, true);
$client->setOption(\Memcached::OPT_TCP_NODELAY, true);
if (!array_key_exists('LIBKETAMA_COMPATIBLE', $options) && !array_key_exists(\Memcached::OPT_LIBKETAMA_COMPATIBLE, $options)) {
if (!\array_key_exists('LIBKETAMA_COMPATIBLE', $options) && !\array_key_exists(\Memcached::OPT_LIBKETAMA_COMPATIBLE, $options)) {
$client->setOption(\Memcached::OPT_LIBKETAMA_COMPATIBLE, true);
}
foreach ($options as $name => $value) {
@@ -284,7 +284,7 @@ protected function doFetch(array $ids)
$result = [];
if ($this->redis instanceof \Predis\Client) {
if ($this->redis instanceof \Predis\Client && $this->redis->getConnection() instanceof ClusterInterface) {
$values = $this->pipeline(function () use ($ids) {
foreach ($ids as $id) {
yield 'get' => [$id];
@@ -59,7 +59,7 @@ protected function preNormalize($value)
$normalized = [];
foreach ($value as $k => $v) {
if (false !== strpos($k, '-') && false === strpos($k, '_') && !array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
if (false !== strpos($k, '-') && false === strpos($k, '_') && !\array_key_exists($normalizedKey = str_replace('-', '_', $k), $value)) {
$normalized[$normalizedKey] = $v;
} else {
$normalized[$k] = $v;
@@ -223,7 +223,7 @@ protected function finalizeValue($value)
}
foreach ($this->children as $name => $child) {
if (!array_key_exists($name, $value)) {
if (!\array_key_exists($name, $value)) {
if ($child->isRequired()) {
$ex = new InvalidConfigurationException(sprintf('The child node "%s" at path "%s" must be configured.', $name, $this->getPath()));
$ex->setPath($this->getPath());
@@ -383,7 +383,7 @@ protected function mergeValues($leftSide, $rightSide)
foreach ($rightSide as $k => $v) {
// no conflict
if (!array_key_exists($k, $leftSide)) {
if (!\array_key_exists($k, $leftSide)) {
if (!$this->allowNewKeys) {
$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()));
$ex->setPath($this->getPath());
@@ -332,10 +332,10 @@ public function performNoDeepMerging()
* Allows extra config keys to be specified under an array without
* throwing an exception.
*
* Those config values are simply ignored and removed from the
* resulting array. This should be used only in special cases where
* you want to send an entire configuration array through a special
* tree that processes only part of the array.
* Those config values are ignored and removed from the resulting
* array. This should be used only in special cases where you want
* to send an entire configuration array through a special tree that
* processes only part of the array.
*
* @param bool $remove Whether to remove the extra keys
*
@@ -245,7 +245,7 @@ protected function normalizeValue($value)
// if only "value" is left
if (array_keys($v) === ['value']) {
$v = $v['value'];
if ($this->prototype instanceof ArrayNode && ($children = $this->prototype->getChildren()) && array_key_exists('value', $children)) {
if ($this->prototype instanceof ArrayNode && ($children = $this->prototype->getChildren()) && \array_key_exists('value', $children)) {
$valuePrototype = current($this->valuePrototypes) ?: clone $children['value'];
$valuePrototype->parent = $this;
$originalClosures = $this->prototype->normalizationClosures;
@@ -258,7 +258,7 @@ protected function normalizeValue($value)
}
}
if (array_key_exists($k, $normalized)) {
if (\array_key_exists($k, $normalized)) {
$ex = new DuplicateKeyException(sprintf('Duplicate key "%s" for path "%s".', $k, $this->getPath()));
$ex->setPath($this->getPath());
@@ -301,14 +301,14 @@ protected function mergeValues($leftSide, $rightSide)
}
foreach ($rightSide as $k => $v) {
// prototype, and key is irrelevant, so simply append the element
// prototype, and key is irrelevant, append the element
if (null === $this->keyAttribute) {
$leftSide[] = $v;
continue;
}
// no conflict
if (!array_key_exists($k, $leftSide)) {
if (!\array_key_exists($k, $leftSide)) {
if (!$this->allowNewKeys) {
$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.', $this->getPath()));
$ex->setPath($this->getPath());
@@ -199,6 +199,13 @@ public function doRun(InputInterface $input, OutputInterface $output)
return 0;
}
try {
// Makes ArgvInput::getFirstArgument() able to distinguish an option from an argument.
$input->bind($this->getDefinition());
} catch (ExceptionInterface $e) {
// Errors must be ignored, full binding/validation happens later when the command is known.
}
$name = $this->getCommandName($input);
if (true === $input->hasParameterOption(['--help', '-h'], true)) {
if (!$name) {
Oops, something went wrong.

0 comments on commit 87f3c36

Please sign in to comment.
You can’t perform that action at this time.