-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Symfony::extractRawRoles() failed on security collector from Symfony >= 3.3 #4309
Symfony::extractRawRoles() failed on security collector from Symfony >= 3.3 #4309
Conversation
…>= 3.3. When extracting roles from security collector, you can simply utilize the getValue method of Data class, when it exists.
src/Codeception/Module/Symfony.php
Outdated
// prior to Symfony 3.3 | ||
if (method_exists($data, 'getValue')) { | ||
$roles = $data->getValue(); | ||
} |
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.
Expected 1 space after closing brace; newline found
src/Codeception/Module/Symfony.php
Outdated
@@ -521,9 +521,15 @@ protected function debugResponse($url) | |||
*/ | |||
private function extractRawRoles(Data $data) | |||
{ | |||
$raw = $data->getRawData(); | |||
// prior to Symfony 3.3 |
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.
Are you sure that this comment is correct?
getRawData
method is deprecated since 3.3 and removed in 4.0.
@Naktibalda I didn't submitted an issue for this PR but it looks like this may fix #4306 as well. Everytime a user is somehow authenticated (even with an AnonymousToken) this branch of the |
src/Codeception/Module/Symfony.php
Outdated
* | ||
* @return bool | ||
*/ | ||
private function dataIsFromSymfony3_3(Data $data): bool |
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.
Method name Symfony::dataIsFromSymfony3_3
is not in camel caps format
src/Codeception/Module/Symfony.php
Outdated
* | ||
* @return bool | ||
*/ | ||
private function dataIsFromSymfony33(Data $data) |
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 don't like this name because it will be confusing when Symfony 4.0 comes out.
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'm with you...
There are only two hard things in Computer Science: cache invalidation and naming things. -- Phil Karlton
Made the name a little more generic
@Naktibalda @Basster Confirmed, this fixes #4306 . |
…om any Symfony version
When extracting roles from security collector, you can simply utilize the getValue method of Data class, when it exists.