mirror of https://github.com/FriendsOfTYPO3/tea.git synced 2024-11-24 12:16:11 +01:00

[TASK] Narrow down a type in the controller (#1270)

This fixes the last PHPStan level 9 warning.
This commit is contained in:
Oliver Klee 2024-05-06 14:46:54 +02:00 committed by GitHub
parent 60145ba685
commit f8ff931431
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 6 deletions

View file

@ -42,7 +42,10 @@ class FrontEndEditorController extends ActionController
*/ */
private function getUidOfLoggedInUser(): int private function getUidOfLoggedInUser(): int
{ {
return $this->context->getPropertyFromAspect('frontend.user', 'id'); $userUid = $this->context->getPropertyFromAspect('frontend.user', 'id');
\assert(\is_int($userUid) && $userUid >= 0);
return $userUid;
} }
/** /**

View file

@ -1,6 +1,2 @@
parameters: parameters:
ignoreErrors: ignoreErrors: []
-
message: "#^Method TTN\\\\Tea\\\\Controller\\\\FrontEndEditorController\\:\\:getUidOfLoggedInUser\\(\\) should return int\\<0, max\\> but returns mixed\\.$#"
count: 1
path: Classes/Controller/FrontEndEditorController.php