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 PHP8's match expression instead of switch #39208

Closed

Conversation

shdehnavi
Copy link
Contributor

Summary

The required adjustments have been made to the classes in the /lib/public namespace.

The improvements:

  • Using PHP8's match expression instead of switch

Checklist

shdehnavi added 2 commits July 7, 2023 03:40
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
@shdehnavi shdehnavi requested a review from CarlSchwan July 8, 2023 20:43
@solracsf solracsf added this to the Nextcloud 28 milestone Jul 9, 2023
@solracsf solracsf added 3. to review Waiting for reviews technical debt labels Jul 9, 2023
@shdehnavi shdehnavi requested a review from skjnldsv July 14, 2023 12:13

return IQueryBuilder::PARAM_STR;
return match ($types[$property]) {
'int', 'integer' => IQueryBuilder::PARAM_INT,
Copy link
Member

Choose a reason for hiding this comment

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

As mentioned in the talk PR I think this decreases readability and since it has no advantage we shouldn't do it, so that patches in the area can be backported with less chance for conflicts.

@shdehnavi shdehnavi requested a review from ChristophWurst July 14, 2023 14:00
@nickvergessen
Copy link
Member

Closing as per comment

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.

3 participants