Skip to content

Commit b8fcebc

Browse files
committed
Merge branch '2.3' into 2.5
* 2.3: Remove aligned '=>' and '=' Break infinite loop while resolving aliases [Security][listener] change priority of switchuser Improved the phpdoc for security token classes bumped Symfony version to 2.3.22 updated VERSION for 2.3.21 update CONTRIBUTORS for 2.3.21 updated CHANGELOG for 2.3.21 Conflicts: src/Symfony/Bridge/Propel1/Form/ChoiceList/ModelChoiceList.php src/Symfony/Bridge/Propel1/Form/Type/ModelType.php src/Symfony/Bridge/Propel1/Logger/PropelLogger.php src/Symfony/Bridge/Propel1/Tests/Fixtures/ItemQuery.php src/Symfony/Bundle/FrameworkBundle/Command/RouterDebugCommand.php src/Symfony/Bundle/FrameworkBundle/Tests/DependencyInjection/ConfigurationTest.php src/Symfony/Bundle/FrameworkBundle/Translation/Translator.php src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php src/Symfony/Component/Console/Descriptor/JsonDescriptor.php src/Symfony/Component/Console/Formatter/OutputFormatterStyle.php src/Symfony/Component/Console/Helper/ProgressHelper.php src/Symfony/Component/Debug/ErrorHandler.php src/Symfony/Component/DependencyInjection/Container.php src/Symfony/Component/Finder/Shell/Command.php src/Symfony/Component/Form/Extension/Core/DataTransformer/NumberToLocalizedStringTransformer.php src/Symfony/Component/Form/Extension/Core/Type/CollectionType.php src/Symfony/Component/Form/Extension/Core/Type/FormType.php src/Symfony/Component/Form/Extension/Core/Type/IntegerType.php src/Symfony/Component/Form/Extension/Core/Type/NumberType.php src/Symfony/Component/Form/Extension/Csrf/Type/FormTypeCsrfExtension.php src/Symfony/Component/HttpFoundation/File/UploadedFile.php src/Symfony/Component/HttpKernel/DataCollector/LoggerDataCollector.php src/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php src/Symfony/Component/HttpKernel/EventListener/ExceptionListener.php src/Symfony/Component/HttpKernel/Kernel.php src/Symfony/Component/HttpKernel/Tests/EventListener/TestSessionListenerTest.php src/Symfony/Component/HttpKernel/Tests/HttpCache/TestMultipleHttpKernel.php src/Symfony/Component/Intl/NumberFormatter/NumberFormatter.php src/Symfony/Component/Routing/Loader/AnnotationClassLoader.php src/Symfony/Component/Routing/Route.php src/Symfony/Component/Routing/Tests/Loader/AnnotationClassLoaderTest.php src/Symfony/Component/Security/Tests/Core/Validator/Constraints/UserPasswordValidatorTest.php src/Symfony/Component/Templating/PhpEngine.php src/Symfony/Component/Validator/Constraints/ImageValidator.php src/Symfony/Component/Validator/Constraints/TypeValidator.php
2 parents af29e25 + 4e0478f commit b8fcebc

File tree

9 files changed

+43
-44
lines changed

9 files changed

+43
-44
lines changed

DataCollector/SecurityDataCollector.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,27 +37,27 @@ public function collect(Request $request, Response $response, \Exception $except
3737
{
3838
if (null === $this->context) {
3939
$this->data = array(
40-
'enabled' => false,
40+
'enabled' => false,
4141
'authenticated' => false,
42-
'token_class' => null,
43-
'user' => '',
44-
'roles' => array(),
42+
'token_class' => null,
43+
'user' => '',
44+
'roles' => array(),
4545
);
4646
} elseif (null === $token = $this->context->getToken()) {
4747
$this->data = array(
48-
'enabled' => true,
48+
'enabled' => true,
4949
'authenticated' => false,
50-
'token_class' => null,
51-
'user' => '',
52-
'roles' => array(),
50+
'token_class' => null,
51+
'user' => '',
52+
'roles' => array(),
5353
);
5454
} else {
5555
$this->data = array(
56-
'enabled' => true,
56+
'enabled' => true,
5757
'authenticated' => $token->isAuthenticated(),
58-
'token_class' => get_class($token),
59-
'user' => $token->getUsername(),
60-
'roles' => array_map(function ($role) { return $role->getRole();}, $token->getRoles()),
58+
'token_class' => get_class($token),
59+
'user' => $token->getUsername(),
60+
'roles' => array_map(function ($role) { return $role->getRole();}, $token->getRoles()),
6161
);
6262
}
6363
}

DependencyInjection/Security/Factory/AbstractFactory.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,24 +27,24 @@
2727
abstract class AbstractFactory implements SecurityFactoryInterface
2828
{
2929
protected $options = array(
30-
'check_path' => '/login_check',
31-
'use_forward' => false,
32-
'require_previous_session' => true,
30+
'check_path' => '/login_check',
31+
'use_forward' => false,
32+
'require_previous_session' => true,
3333
);
3434

3535
protected $defaultSuccessHandlerOptions = array(
3636
'always_use_default_target_path' => false,
37-
'default_target_path' => '/',
38-
'login_path' => '/login',
39-
'target_path_parameter' => '_target_path',
40-
'use_referer' => false,
37+
'default_target_path' => '/',
38+
'login_path' => '/login',
39+
'target_path_parameter' => '_target_path',
40+
'use_referer' => false,
4141
);
4242

4343
protected $defaultFailureHandlerOptions = array(
44-
'failure_path' => null,
45-
'failure_forward' => false,
46-
'login_path' => '/login',
47-
'failure_path_parameter' => '_failure_path',
44+
'failure_path' => null,
45+
'failure_forward' => false,
46+
'login_path' => '/login',
47+
'failure_path_parameter' => '_failure_path',
4848
);
4949

5050
public function create(ContainerBuilder $container, $id, $config, $userProviderId, $defaultEntryPointId)

DependencyInjection/SecurityExtension.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ private function configureDbalAclProvider(array $config, ContainerBuilder $conta
143143
->getDefinition('security.acl.dbal.schema_listener')
144144
->addTag('doctrine.event_listener', array(
145145
'connection' => $config['connection'],
146-
'event' => 'postGenerateSchema',
147-
'lazy' => true,
146+
'event' => 'postGenerateSchema',
147+
'lazy' => true,
148148
))
149149
;
150150

@@ -297,8 +297,8 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
297297
$listener = $container->setDefinition($listenerId, new DefinitionDecorator('security.logout_listener'));
298298
$listener->replaceArgument(3, array(
299299
'csrf_parameter' => $firewall['logout']['csrf_parameter'],
300-
'intention' => $firewall['logout']['csrf_token_id'],
301-
'logout_path' => $firewall['logout']['path'],
300+
'intention' => $firewall['logout']['csrf_token_id'],
301+
'logout_path' => $firewall['logout']['path'],
302302
));
303303
$listeners[] = new Reference($listenerId);
304304

@@ -354,14 +354,14 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
354354

355355
$listeners = array_merge($listeners, $authListeners);
356356

357-
// Access listener
358-
$listeners[] = new Reference('security.access_listener');
359-
360357
// Switch user listener
361358
if (isset($firewall['switch_user'])) {
362359
$listeners[] = new Reference($this->createSwitchUserListener($container, $id, $firewall['switch_user'], $defaultProvider));
363360
}
364361

362+
// Access listener
363+
$listeners[] = new Reference('security.access_listener');
364+
365365
// Determine default entry point
366366
if (isset($firewall['entry_point'])) {
367367
$defaultEntryPoint = $firewall['entry_point'];
@@ -468,7 +468,7 @@ private function createEncoder($config, ContainerBuilder $container)
468468
// pbkdf2 encoder
469469
if ('pbkdf2' === $config['algorithm']) {
470470
return array(
471-
'class' => new Parameter('security.encoder.pbkdf2.class'),
471+
'class' => new Parameter('security.encoder.pbkdf2.class'),
472472
'arguments' => array(
473473
$config['hash_algorithm'],
474474
$config['encode_as_base64'],
@@ -481,14 +481,14 @@ private function createEncoder($config, ContainerBuilder $container)
481481
// bcrypt encoder
482482
if ('bcrypt' === $config['algorithm']) {
483483
return array(
484-
'class' => new Parameter('security.encoder.bcrypt.class'),
484+
'class' => new Parameter('security.encoder.bcrypt.class'),
485485
'arguments' => array($config['cost']),
486486
);
487487
}
488488

489489
// message digest encoder
490490
return array(
491-
'class' => new Parameter('security.encoder.digest.class'),
491+
'class' => new Parameter('security.encoder.digest.class'),
492492
'arguments' => array(
493493
$config['algorithm'],
494494
$config['encode_as_base64'],

Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
1313

1414
use Symfony\Component\DependencyInjection\Reference;
15-
1615
use Symfony\Component\DependencyInjection\Parameter;
1716
use Symfony\Bundle\SecurityBundle\SecurityBundle;
1817
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
@@ -26,9 +25,9 @@ public function testRolesHierarchy()
2625
{
2726
$container = $this->getContainer('container1');
2827
$this->assertEquals(array(
29-
'ROLE_ADMIN' => array('ROLE_USER'),
28+
'ROLE_ADMIN' => array('ROLE_USER'),
3029
'ROLE_SUPER_ADMIN' => array('ROLE_USER', 'ROLE_ADMIN', 'ROLE_ALLOWED_TO_SWITCH'),
31-
'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'),
30+
'ROLE_REMOTE' => array('ROLE_USER', 'ROLE_ADMIN'),
3231
), $container->getParameter('security.role_hierarchy.roles'));
3332
}
3433

@@ -82,8 +81,8 @@ public function testFirewalls()
8281
'security.authentication.listener.basic.secure',
8382
'security.authentication.listener.digest.secure',
8483
'security.authentication.listener.anonymous.secure',
85-
'security.access_listener',
8684
'security.authentication.switchuser_listener.secure',
85+
'security.access_listener',
8786
),
8887
array(
8988
'security.channel_listener',

Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function testCreate()
3636
'index_5' => new Reference('qux'),
3737
'index_6' => new Reference('bar'),
3838
'index_7' => array(
39-
'use_forward' => true,
39+
'use_forward' => true,
4040
),
4141
), $definition->getArguments());
4242

Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public function loginAction()
2222
$form = $this->container->get('form.factory')->create('user_login');
2323

2424
return $this->container->get('templating')->renderResponse('CsrfFormLoginBundle:Login:login.html.twig', array(
25-
'form' => $form->createView(),
25+
'form' => $form->createView(),
2626
));
2727
}
2828

Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public function loginAction(Request $request)
3030
return $this->container->get('templating')->renderResponse('FormLoginBundle:Localized:login.html.twig', array(
3131
// last username entered by the user
3232
'last_username' => $request->getSession()->get(SecurityContext::LAST_USERNAME),
33-
'error' => $error,
33+
'error' => $error,
3434
));
3535
}
3636

Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public function loginAction(Request $request)
3131
return $this->container->get('templating')->renderResponse('FormLoginBundle:Login:login.html.twig', array(
3232
// last username entered by the user
3333
'last_username' => $request->getSession()->get(SecurityContext::LAST_USERNAME),
34-
'error' => $error,
34+
'error' => $error,
3535
));
3636
}
3737

Tests/Functional/SwitchUserTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,10 @@ public function testSwitchedUserExit()
5454
public function getTestParameters()
5555
{
5656
return array(
57-
'unauthorized_user_cannot_switch' => array('user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403),
58-
'authorized_user_can_switch' => array('user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200),
57+
'unauthorized_user_cannot_switch' => array('user_cannot_switch_1', 'user_cannot_switch_1', 'user_cannot_switch_1', 403),
58+
'authorized_user_can_switch' => array('user_can_switch', 'user_cannot_switch_1', 'user_cannot_switch_1', 200),
5959
'authorized_user_cannot_switch_to_non_existent' => array('user_can_switch', 'user_does_not_exist', 'user_can_switch', 500),
60-
'authorized_user_can_switch_to_himself' => array('user_can_switch', 'user_can_switch', 'user_can_switch', 200),
60+
'authorized_user_can_switch_to_himself' => array('user_can_switch', 'user_can_switch', 'user_can_switch', 200),
6161
);
6262
}
6363

0 commit comments

Comments
 (0)