Make WordPress Core

Opened 4 years ago

Closed 4 years ago

#52072 closed defect (bug) (wontfix)

Twenty Twenty-One: Immediately return expression instead of assigning it to the temporary variable

Reported by: manzurahammed's profile manzurahammed Owned by:
Milestone: Priority: normal
Severity: normal Version: 5.6
Component: Bundled Theme Keywords: has-patch
Focuses: coding-standards Cc:

Description

Immediately return expression instead of assigning it to the temporary variable

Attachments (1)

52072.patch (2.5 KB) - added by manzurahammed 4 years ago.

Download all attachments as: .zip

Change History (4)

@manzurahammed
4 years ago

#1 @poena
4 years ago

Hi!

Can you add some context and explaination to why you consider the original code a bug, and the reason for the changes?

#2 @SergeyBiryukov
4 years ago

  • Component changed from General to Bundled Theme
  • Keywords close 2nd-opinion added

Hi there, welcome to WordPress Trac! Thanks for the patch.

The existing code seems fine as is to me. It's a bit more readable, as variables like $calendar_output describe the purpose of the code, and also a bit more future-proof in case these lines need any additional adjustments in the future.

I don't think any changes are needed here for now.

#3 @desrosj
4 years ago

  • Keywords close 2nd-opinion removed
  • Milestone Awaiting Review deleted
  • Resolution set to wontfix
  • Status changed from new to closed

I agree with @SergeyBiryukov's assessment above. Thanks or the suggestion, @manzurahammed. Please do keep them coming!

Note: See TracTickets for help on using tickets.