Skip to content
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

Merged
merged 1 commit into from
Oct 5, 2023
Merged

Conversation

hamza221
Copy link
Contributor

@hamza221 hamza221 commented Oct 4, 2023

Signed-off-by: hamza221 <hamzamahjoubi221@gmail.com>
@hamza221 hamza221 added 3. to review Waiting for reviews performance 🚀 labels Oct 4, 2023
@hamza221 hamza221 self-assigned this Oct 4, 2023
@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

All modified lines are covered by tests ✅

Comparison is base (5cd1a29) 22.25% compared to head (732bf1a) 22.28%.
Report is 3 commits behind head on main.

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     
Flag Coverage Δ
javascript 13.82% <ø> (ø)
php 63.29% <ø> (+0.04%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 3 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@ChristophWurst ChristophWurst left a 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')
Copy link
Member

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')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

@miaulalala miaulalala merged commit e1c0085 into main Oct 5, 2023
40 checks passed
@miaulalala miaulalala deleted the enh/replace-getDisplayName branch October 5, 2023 09:16
Copy link
Member

@st3iny st3iny left a 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 ... 🙈

Comment on lines -106 to +107

$organizer = $this->userManager->get($config->getUserId());
$organizerId = $config->getUserId();
$organizer = $this->userManager->get($organizerId);
Copy link
Member

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.

Comment on lines -93 to +95
$user = $this->userManager->get($config->getUserId());

$userId = $config->getUserId();
$user = $this->userManager->get($userId);
Copy link
Member

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.

Comment on lines +279 to +281
$userId = $config->getUserId();
/** @var IUser $user */
$user = $this->userManager->get($config->getUserId());
$user = $this->userManager->get($userId);
Copy link
Member

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.

Comment on lines -166 to +169
$user = $this->userManager->get($config->getUserId());
$userId = $config->getUserId();
$user = $this->userManager->get($userId);
Copy link
Member

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.

@ChristophWurst
Copy link
Member

@hamza221 follow-up with the coding style fixes and revert of unnecessary optimizations?

@hamza221
Copy link
Contributor Author

hamza221 commented Oct 5, 2023

PR incoming in a bit 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants