-
Notifications
You must be signed in to change notification settings - Fork 10
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
Phpstan level 2 #245
base: development
Are you sure you want to change the base?
Phpstan level 2 #245
Conversation
Hallo @Art4, |
Prima, vielen Dank. Ich habe #244 freigegeben und prüfe noch, ob es mergen Conflicts gibt, die ich beheben muss. |
Merge Conflicts sind behoben. Dieser PR ist bereit für das Review. |
try { | ||
// FIXME: ResourceOwnerInterface cannot have method getEmail() | ||
return $keycloakUser->getEmail(); | ||
if ($keycloakUser instanceof User) { |
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.
@holema Ich bin mir nicht sicher, wie hier verfahren werden soll. Im Prinzip kann die ganze Methode reduziert werden:
private function getEmailForKeycloakUser(ResourceOwnerInterface $keycloakUser): string {
try {
return $keycloakUser->toArray()['preferred_username'];
} catch (Exception $e) {
return '';
}
}
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.
Die Idee ist, das versucht wird ob auf die email als Attribut zugegriffen werden kann.
prefered suername muss nicht unbedingt die email Adresse sein sondern kann auch ein username sein.
This PR fixes all errors for PHPStan level 2. This is a follow-up of #244.
To teach PHPStan about Doctrine repositories, I've installed the phpstan-doctrine extension as dev dependency.
This PR fixes all reported 58 errors, including #242.