Skip to content

Use PHP8's match expression instead of switch - #39208

Closed
shdehnavi wants to merge 2 commits into
nextcloud:masterfrom
shdehnavi:match_expression_instead_of_switch
Closed

Use PHP8's match expression instead of switch#39208
shdehnavi wants to merge 2 commits into
nextcloud:masterfrom
shdehnavi:match_expression_instead_of_switch

Conversation

@shdehnavi

Copy link
Copy Markdown
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

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 CarlSchwanJuly 8, 2023 20:43
@solracsfsolracsf added this to the Nextcloud 28 milestone Jul 9, 2023
@solracsfsolracsf added 3. to review Waiting for reviews technical debt 🧱 🤔🚀 labels Jul 9, 2023
@shdehnavishdehnavi mentioned this pull request Jul 13, 2023
@shdehnavi
shdehnavi requested a review from skjnldsvJuly 14, 2023 12:13

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

Copy link
Copy Markdown
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.

@nickvergessen

Copy link
Copy Markdown
Member

Closing as per comment

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewstechnical debt🧱 🤔🚀

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@shdehnavi@nickvergessen@solracsf