Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#52072 closed defect (bug) (wontfix)

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

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

Description

Immediately return expression instead of assigning it to the temporary variable

Attachments (1)

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

Download all attachments as: .zip

Change History (4)

#1 @poena
6 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
6 years ago

  • Component General → 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
6 years ago

  • Keywords close 2nd-opinion removed
  • Milestone Awaiting Review
  • Resolution → wontfix
  • Status new → 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.