Skip to content

Commit 99849d8

Browse files
committed
Add "shared" flag and deprecate scopes concept
1 parent d64c66b commit 99849d8

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginFormType.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
use Symfony\Component\Form\FormError;
1717
use Symfony\Component\Form\FormEvents;
1818
use Symfony\Component\Form\FormEvent;
19-
use Symfony\Component\HttpFoundation\Request;
19+
use Symfony\Component\HttpFoundation\RequestStack;
2020
use Symfony\Component\OptionsResolver\OptionsResolver;
2121
use Symfony\Component\Security\Core\Security;
2222

@@ -29,14 +29,14 @@
2929
*/
3030
class UserLoginFormType extends AbstractType
3131
{
32-
private $request;
32+
private $requestStack;
3333

3434
/**
35-
* @param Request $request A request instance
35+
* @param RequestStack $requestStack A RequestStack instance
3636
*/
37-
public function __construct(Request $request)
37+
public function __construct(RequestStack $requestStack)
3838
{
39-
$this->request = $request;
39+
$this->requestStack = $requestStack;
4040
}
4141

4242
/**
@@ -50,7 +50,7 @@ public function buildForm(FormBuilderInterface $builder, array $options)
5050
->add('_target_path', 'hidden')
5151
;
5252

53-
$request = $this->request;
53+
$request = $this->requestStack->getCurrentRequest();
5454

5555
/* Note: since the Security component's form login listener intercepts
5656
* the POST request, this form will never really be bound to the

Tests/Functional/app/CsrfFormLogin/config.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ imports:
44
services:
55
csrf_form_login.form.type:
66
class: Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Form\UserLoginFormType
7-
scope: request
87
arguments:
9-
- @request
8+
- @request_stack
109
tags:
1110
- { name: form.type, alias: user_login }
1211

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"symfony/dom-crawler": "~2.0,>=2.0.5|~3.0.0",
3030
"symfony/form": "~2.7|~3.0.0",
3131
"symfony/framework-bundle": "~2.7|~3.0.0",
32-
"symfony/http-foundation": "~2.3|~3.0.0",
32+
"symfony/http-foundation": "~2.4|~3.0.0",
3333
"symfony/twig-bundle": "~2.7|~3.0.0",
3434
"symfony/twig-bridge": "~2.7|~3.0.0",
3535
"symfony/process": "~2.0,>=2.0.5|~3.0.0",

0 commit comments

Comments
 (0)