Skip to content

Changed parameter container to request #3216

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 4 commits into from

Conversation

maks-rafalko
Copy link
Contributor

There is no need to pass @service_container to the voter, @request is enough.

There is no need to pass @service_container to the voter, @request is enough.
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;

class ClientIpVoter implements VoterInterface
{
public function __construct(ContainerInterface $container, array $blacklistedIp = array())
public function __construct(Request $request, array $blacklistedIp = array())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be the request or the request_stack? 👶

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, indeed. For 2.3 this should be changed to use the request_stack

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought it is for 2.4+ as mentioned in here.
I'll update PR

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yeah, my mistake. Could you please reopen this PR for the 2.4 branch (master)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will do the same changes for 2.4 (master). But what about this PR (current branch) ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This pr should be closed, for the same reasons as mentioned in #3211

maks-rafalko added a commit to maks-rafalko/symfony-docs that referenced this pull request Nov 22, 2013
There is no need to pass @service_container to the voter, @request is enough.

please see symfony#3216
weaverryan pushed a commit that referenced this pull request Nov 28, 2013
There is no need to pass @service_container to the voter, @request is enough.

please see #3216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants