-
Notifications
You must be signed in to change notification settings - Fork 240
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
use \OCP\IUserManager::getDisplayName #5517
Conversation
Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #5517 +/- ##
============================================
+ Coverage 22.25% 22.28% +0.02%
Complexity 388 388
============================================
Files 240 240
Lines 11788 11793 +5
Branches 2301 2301
============================================
+ Hits 2624 2628 +4
- Misses 9164 9165 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
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.
Very nice
])); | ||
$this->userManager->expects(self::exactly(3)) | ||
->method('getDisplayName') |
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.
indentation?
])); | ||
$this->userManager->expects(self::exactly(3)) | ||
->method('getDisplayName') |
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.
same
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.
A bit late but ... 🙈
|
||
$organizer = $this->userManager->get($config->getUserId()); | ||
$organizerId = $config->getUserId(); | ||
$organizer = $this->userManager->get($organizerId); |
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.
Refactoring here doesn't make sense as the user object is required anyway. It should only be refactored when fetching the whole user object just to call getDisplayName()
and nothing else.
$user = $this->userManager->get($config->getUserId()); | ||
|
||
$userId = $config->getUserId(); | ||
$user = $this->userManager->get($userId); |
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.
Same as above applies here.
$userId = $config->getUserId(); | ||
/** @var IUser $user */ | ||
$user = $this->userManager->get($config->getUserId()); | ||
$user = $this->userManager->get($userId); |
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.
Same as above.
We can probably get rid of the user object completely though. It only seems to be used to check if the user actually exists some lines further down.
$user = $this->userManager->get($config->getUserId()); | ||
$userId = $config->getUserId(); | ||
$user = $this->userManager->get($userId); |
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.
Same as above. Potentially could get rid of the user object here too.
@hamza221 follow-up with the coding style fixes and revert of unnecessary optimizations? |
PR incoming in a bit 😅 |
ref nextcloud/groupware#53