-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Conversation
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()) |
There was a problem hiding this comment.
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? 👶
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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)?
There was a problem hiding this comment.
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) ?
There was a problem hiding this comment.
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
There is no need to pass @service_container to the voter, @request is enough. please see symfony#3216
There is no need to pass @service_container to the voter, @request is enough.