Permalink
Browse files

fixed CS for lambdas

  • Loading branch information...
1 parent 93edf44 commit 35b407f0165be3c85cc8a626c9764b3ed606c963 @fabpot fabpot committed Dec 28, 2013
Showing with 104 additions and 105 deletions.
  1. +1 −1 ...ony/Bridge/Doctrine/DependencyInjection/CompilerPass/RegisterEventListenersAndSubscribersPass.php
  2. +1 −1 src/Symfony/Bridge/Doctrine/Tests/Validator/Constraints/UniqueValidatorTest.php
  3. +3 −3 src/Symfony/Bundle/FrameworkBundle/Command/ContainerDebugCommand.php
  4. +16 −16 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/Configuration.php
  5. +3 −3 src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php
  6. +1 −1 src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/FrameworkExtensionTest.php
  7. +1 −1 src/Symfony/Bundle/SecurityBundle/DataCollector/SecurityDataCollector.php
  8. +14 −14 src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php
  9. +1 −1 src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RememberMeFactory.php
  10. +1 −1 src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php
  11. +1 −1 src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php
  12. +6 −6 src/Symfony/Bundle/TwigBundle/DependencyInjection/Configuration.php
  13. +1 −1 src/Symfony/Component/BrowserKit/Tests/CookieJarTest.php
  14. +1 −1 src/Symfony/Component/Config/Definition/Builder/ArrayNodeDefinition.php
  15. +9 −9 src/Symfony/Component/Config/Definition/Builder/ExprBuilder.php
  16. +0 −1 src/Symfony/Component/Config/Tests/Definition/ArrayNodeTest.php
  17. +3 −3 src/Symfony/Component/Config/Tests/Definition/Builder/ExprBuilderTest.php
  18. +4 −4 src/Symfony/Component/Config/Tests/Definition/NormalizationTest.php
  19. +1 −1 src/Symfony/Component/Console/Application.php
  20. +2 −2 src/Symfony/Component/Console/Helper/DialogHelper.php
  21. +1 −1 src/Symfony/Component/Console/Shell.php
  22. +1 −1 src/Symfony/Component/Debug/ErrorHandler.php
  23. +2 −2 src/Symfony/Component/Debug/Tests/ErrorHandlerTest.php
  24. +1 −1 src/Symfony/Component/EventDispatcher/Tests/EventDispatcherTest.php
  25. +1 −1 src/Symfony/Component/Finder/Finder.php
  26. +2 −2 src/Symfony/Component/Finder/Shell/Command.php
  27. +3 −3 src/Symfony/Component/Finder/Tests/FinderTest.php
  28. +1 −1 src/Symfony/Component/Finder/Tests/Iterator/MockFileListIterator.php
  29. +2 −2 src/Symfony/Component/Form/Tests/Extension/Validator/Constraints/FormValidatorTest.php
  30. +1 −1 src/Symfony/Component/Form/Tests/Extension/Validator/Type/BaseValidatorExtensionTest.php
  31. +1 −1 src/Symfony/Component/HttpFoundation/AcceptHeaderItem.php
  32. +3 −3 src/Symfony/Component/HttpFoundation/Tests/Session/Storage/Handler/MongoDbSessionHandlerTest.php
  33. +1 −1 src/Symfony/Component/HttpKernel/Profiler/BaseMemcacheProfilerStorage.php
  34. +1 −1 src/Symfony/Component/HttpKernel/Tests/DataCollector/RequestDataCollectorTest.php
  35. +2 −2 src/Symfony/Component/HttpKernel/Tests/DependencyInjection/ContainerAwareHttpKernelTest.php
  36. +1 −1 src/Symfony/Component/HttpKernel/Tests/HttpKernelTest.php
  37. +3 −3 src/Symfony/Component/Intl/DateFormatter/DateFormat/FullTransformer.php
  38. +1 −1 src/Symfony/Component/Intl/DateFormatter/DateFormat/MonthTransformer.php
  39. +1 −1 src/Symfony/Component/Process/Tests/SignalListener.php
  40. +1 −1 src/Symfony/Component/Routing/Tests/Fixtures/CustomXmlFileLoader.php
  41. +1 −1 src/Symfony/Component/Security/Tests/Core/Util/SecureRandomTest.php
  42. +1 −1 src/Symfony/Component/Validator/Tests/Constraints/ChoiceValidatorTest.php
  43. +1 −1 src/Symfony/Component/Validator/Tests/Mapping/ClassMetadataFactoryTest.php
  44. +1 −1 src/Symfony/Component/Yaml/Unescaper.php
@@ -55,7 +55,7 @@ public function process(ContainerBuilder $container)
$this->container = $container;
$this->connections = $container->getParameter($this->connections);
- $sortFunc = function($a, $b) {
+ $sortFunc = function ($a, $b) {
$a = isset($a['priority']) ? $a['priority'] : 0;
$b = isset($b['priority']) ? $b['priority'] : 0;
@@ -295,7 +295,7 @@ public function testValidateUniquenessWithUnrewoundArray()
$repository->expects($this->once())
->method('findByCustom')
->will(
- $this->returnCallback(function() use ($entity) {
+ $this->returnCallback(function () use ($entity) {
$returnValue = array(
$entity,
);
@@ -207,12 +207,12 @@ protected function outputServices(OutputInterface $output, $serviceIds, $showPri
}
}
$format = '%-'.$maxName.'s ';
- $format .= implode("", array_map(function($length) { return "%-{$length}s "; }, $maxTags));
+ $format .= implode("", array_map(function ($length) { return "%-{$length}s "; }, $maxTags));
$format .= '%-'.$maxScope.'s %s';
// the title field needs extra space to make up for comment tags
$format1 = '%-'.($maxName + 19).'s ';
- $format1 .= implode("", array_map(function($length) { return '%-'.($length + 19).'s '; }, $maxTags));
+ $format1 .= implode("", array_map(function ($length) { return '%-'.($length + 19).'s '; }, $maxTags));
$format1 .= '%-'.($maxScope + 19).'s %s';
$tags = array();
@@ -288,7 +288,7 @@ protected function outputService(OutputInterface $output, $serviceId)
$output->writeln('<comment>Tags</comment>');
foreach ($tags as $tagName => $tagData) {
foreach ($tagData as $singleTagData) {
- $output->writeln(sprintf(' - %-30s (%s)', $tagName, implode(', ', array_map(function($key, $value) {
+ $output->writeln(sprintf(' - %-30s (%s)', $tagName, implode(', ', array_map(function ($key, $value) {
return sprintf('<info>%s</info>: %s', $key, $value);
}, array_keys($singleTagData), array_values($singleTagData)))));
}
@@ -41,12 +41,12 @@ public function getConfigTreeBuilder()
->end()
->arrayNode('trusted_proxies')
->beforeNormalization()
- ->ifTrue(function($v) { return !is_array($v) && !is_null($v); })
- ->then(function($v) { return is_bool($v) ? array() : preg_split('/\s*,\s*/', $v); })
+ ->ifTrue(function ($v) { return !is_array($v) && !is_null($v); })
+ ->then(function ($v) { return is_bool($v) ? array() : preg_split('/\s*,\s*/', $v); })
->end()
->prototype('scalar')
->validate()
- ->ifTrue(function($v) {
+ ->ifTrue(function ($v) {
if (empty($v)) {
return false;
}
@@ -70,8 +70,8 @@ public function getConfigTreeBuilder()
->scalarNode('default_locale')->defaultValue('en')->end()
->arrayNode('trusted_hosts')
->beforeNormalization()
- ->ifTrue(function($v) { return is_string($v); })
- ->then(function($v) { return array($v); })
+ ->ifTrue(function ($v) { return is_string($v); })
+ ->then(function ($v) { return array($v); })
->end()
->prototype('scalar')->end()
->end()
@@ -226,7 +226,7 @@ private function addSessionSection(ArrayNodeDefinition $rootNode)
private function addTemplatingSection(ArrayNodeDefinition $rootNode)
{
- $organizeUrls = function($urls) {
+ $organizeUrls = function ($urls) {
$urls += array(
'http' => array(),
'ssl' => array(),
@@ -263,8 +263,8 @@ private function addTemplatingSection(ArrayNodeDefinition $rootNode)
->addDefaultChildrenIfNoneSet()
->prototype('scalar')->defaultValue('FrameworkBundle:Form')->end()
->validate()
- ->ifTrue(function($v) {return !in_array('FrameworkBundle:Form', $v); })
- ->then(function($v){
+ ->ifTrue(function ($v) {return !in_array('FrameworkBundle:Form', $v); })
+ ->then(function ($v) {
return array_merge(array('FrameworkBundle:Form'), $v);
})
->end()
@@ -278,8 +278,8 @@ private function addTemplatingSection(ArrayNodeDefinition $rootNode)
->performNoDeepMerging()
->addDefaultsIfNotSet()
->beforeNormalization()
- ->ifTrue(function($v) { return !is_array($v); })
- ->then(function($v) { return array($v); })
+ ->ifTrue(function ($v) { return !is_array($v); })
+ ->then(function ($v) { return array($v); })
->end()
->beforeNormalization()
->always()
@@ -303,8 +303,8 @@ private function addTemplatingSection(ArrayNodeDefinition $rootNode)
->isRequired()
->requiresAtLeastOneElement()
->beforeNormalization()
- ->ifTrue(function($v){ return !is_array($v); })
- ->then(function($v){ return array($v); })
+ ->ifTrue(function ($v) { return !is_array($v); })
+ ->then(function ($v) { return array($v); })
->end()
->prototype('scalar')->end()
->end()
@@ -313,8 +313,8 @@ private function addTemplatingSection(ArrayNodeDefinition $rootNode)
->children()
->arrayNode('loaders')
->beforeNormalization()
- ->ifTrue(function($v){ return !is_array($v); })
- ->then(function($v){ return array($v); })
+ ->ifTrue(function ($v) { return !is_array($v); })
+ ->then(function ($v) { return array($v); })
->end()
->prototype('scalar')->end()
->end()
@@ -332,8 +332,8 @@ private function addTemplatingSection(ArrayNodeDefinition $rootNode)
->performNoDeepMerging()
->addDefaultsIfNotSet()
->beforeNormalization()
- ->ifTrue(function($v) { return !is_array($v); })
- ->then(function($v) { return array($v); })
+ ->ifTrue(function ($v) { return !is_array($v); })
+ ->then(function ($v) { return array($v); })
->end()
->beforeNormalization()
->always()
@@ -389,7 +389,7 @@ private function registerTemplatingConfiguration(array $config, $ide, ContainerB
// Apply request scope to assets helper if one or more packages are request-scoped
$requireRequestScope = array_reduce(
$namedPackages,
- function($v, Reference $ref) use ($container) {
+ function ($v, Reference $ref) use ($container) {
return $v || 'request' === $container->getDefinition($ref)->getScope();
},
'request' === $defaultPackage->getScope()
@@ -400,7 +400,7 @@ function($v, Reference $ref) use ($container) {
}
if (!empty($config['loaders'])) {
- $loaders = array_map(function($loader) { return new Reference($loader); }, $config['loaders']);
+ $loaders = array_map(function ($loader) { return new Reference($loader); }, $config['loaders']);
// Use a delegation unless only a single loader was registered
if (1 === count($loaders)) {
@@ -437,7 +437,7 @@ function($v, Reference $ref) use ($container) {
}
$container->setParameter('templating.engines', $config['engines']);
- $engines = array_map(function($engine) { return new Reference('templating.engine.'.$engine); }, $config['engines']);
+ $engines = array_map(function ($engine) { return new Reference('templating.engine.'.$engine); }, $config['engines']);
// Use a delegation unless only a single engine was registered
if (1 === count($engines)) {
@@ -181,7 +181,7 @@ public function testTranslator()
}
}
- $files = array_map(function($resource) { return realpath($resource[1]); }, $resources);
+ $files = array_map(function ($resource) { return realpath($resource[1]); }, $resources);
$ref = new \ReflectionClass('Symfony\Component\Validator\Validator');
$this->assertContains(
strtr(dirname($ref->getFileName()) . '/Resources/translations/validators.en.xlf', '/', DIRECTORY_SEPARATOR),
@@ -57,7 +57,7 @@ public function collect(Request $request, Response $response, \Exception $except
'authenticated' => $token->isAuthenticated(),
'token_class' => get_class($token),
'user' => $token->getUsername(),
- 'roles' => array_map(function ($role){ return $role->getRole();}, $token->getRoles()),
+ 'roles' => array_map(function ($role) { return $role->getRole();}, $token->getRoles()),
);
}
}
@@ -132,10 +132,10 @@ private function addRoleHierarchySection(ArrayNodeDefinition $rootNode)
->useAttributeAsKey('id')
->prototype('array')
->performNoDeepMerging()
- ->beforeNormalization()->ifString()->then(function($v) { return array('value' => $v); })->end()
+ ->beforeNormalization()->ifString()->then(function ($v) { return array('value' => $v); })->end()
->beforeNormalization()
- ->ifTrue(function($v) { return is_array($v) && isset($v['value']); })
- ->then(function($v) { return preg_split('/\s*,\s*/', $v['value']); })
+ ->ifTrue(function ($v) { return is_array($v) && isset($v['value']); })
+ ->then(function ($v) { return preg_split('/\s*,\s*/', $v['value']); })
->end()
->prototype('scalar')->end()
->end()
@@ -162,18 +162,18 @@ private function addAccessControlSection(ArrayNodeDefinition $rootNode)
->end()
->scalarNode('host')->defaultNull()->end()
->arrayNode('ips')
- ->beforeNormalization()->ifString()->then(function($v) { return array($v); })->end()
+ ->beforeNormalization()->ifString()->then(function ($v) { return array($v); })->end()
->prototype('scalar')->end()
->end()
->arrayNode('methods')
- ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end()
+ ->beforeNormalization()->ifString()->then(function ($v) { return preg_split('/\s*,\s*/', $v); })->end()
->prototype('scalar')->end()
->end()
->end()
->fixXmlConfig('role')
->children()
->arrayNode('roles')
- ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end()
+ ->beforeNormalization()->ifString()->then(function ($v) { return preg_split('/\s*,\s*/', $v); })->end()
->prototype('scalar')->end()
->end()
->end()
@@ -223,8 +223,8 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
->children()
->arrayNode('delete_cookies')
->beforeNormalization()
- ->ifTrue(function($v) { return is_array($v) && is_int(key($v)); })
- ->then(function($v) { return array_map(function($v) { return array('name' => $v); }, $v); })
+ ->ifTrue(function ($v) { return is_array($v) && is_int(key($v)); })
+ ->then(function ($v) { return array_map(function ($v) { return array('name' => $v); }, $v); })
->end()
->useAttributeAsKey('name')
->prototype('array')
@@ -278,10 +278,10 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
$firewallNodeBuilder
->end()
->validate()
- ->ifTrue(function($v) {
+ ->ifTrue(function ($v) {
return true === $v['security'] && isset($v['pattern']) && !isset($v['request_matcher']);
})
- ->then(function($firewall) use ($abstractFactoryKeys) {
+ ->then(function ($firewall) use ($abstractFactoryKeys) {
foreach ($abstractFactoryKeys as $k) {
if (!isset($firewall[$k]['check_path'])) {
continue;
@@ -331,7 +331,7 @@ private function addProvidersSection(ArrayNodeDefinition $rootNode)
->arrayNode('providers')
->beforeNormalization()
->ifString()
- ->then(function($v) { return preg_split('/\s*,\s*/', $v); })
+ ->then(function ($v) { return preg_split('/\s*,\s*/', $v); })
->end()
->prototype('scalar')->end()
->end()
@@ -349,11 +349,11 @@ private function addProvidersSection(ArrayNodeDefinition $rootNode)
$providerNodeBuilder
->validate()
- ->ifTrue(function($v){return count($v) > 1;})
+ ->ifTrue(function ($v) {return count($v) > 1;})
->thenInvalid('You cannot set multiple provider types for the same provider')
->end()
->validate()
- ->ifTrue(function($v){return count($v) === 0;})
+ ->ifTrue(function ($v) {return count($v) === 0;})
->thenInvalid('You must set a provider definition for the provider.')
->end()
;
@@ -378,7 +378,7 @@ private function addEncodersSection(ArrayNodeDefinition $rootNode)
->prototype('array')
->canBeUnset()
->performNoDeepMerging()
- ->beforeNormalization()->ifString()->then(function($v) { return array('algorithm' => $v); })->end()
+ ->beforeNormalization()->ifString()->then(function ($v) { return array('algorithm' => $v); })->end()
->children()
->scalarNode('algorithm')->cannotBeEmpty()->end()
->scalarNode('hash_algorithm')->info('Name of hashing algorithm for PBKDF2 (i.e. sha256, sha512, etc..) See hash_algos() for a list of supported algorithms.')->defaultValue('sha512')->end()
@@ -126,7 +126,7 @@ public function addConfiguration(NodeDefinition $node)
->scalarNode('token_provider')->end()
->arrayNode('user_providers')
->beforeNormalization()
- ->ifString()->then(function($v) { return array($v); })
+ ->ifString()->then(function ($v) { return array($v); })
->end()
->prototype('scalar')->end()
->end()
@@ -57,7 +57,7 @@ public function addConfiguration(NodeDefinition $node)
->children()
->scalarNode('password')->defaultValue(uniqid())->end()
->arrayNode('roles')
- ->beforeNormalization()->ifString()->then(function($v) { return preg_split('/\s*,\s*/', $v); })->end()
+ ->beforeNormalization()->ifString()->then(function ($v) { return preg_split('/\s*,\s*/', $v); })->end()
->prototype('scalar')->end()
->end()
->end()
@@ -229,7 +229,7 @@ private function createFirewalls($config, ContainerBuilder $container)
$mapDef->replaceArgument(1, $map);
// add authentication providers to authentication manager
- $authenticationProviders = array_map(function($id) {
+ $authenticationProviders = array_map(function ($id) {
return new Reference($id);
}, array_values(array_unique($authenticationProviders)));
$container
Oops, something went wrong.

0 comments on commit 35b407f

Please sign in to comment.