Make WordPress Core

Opened 5 years ago

Closed 5 years ago

#46500 closed enhancement (fixed)

Performs minor code improvements in abstract-testcase.php

Reported by: andizer's profile andizer Owned by: sergeybiryukov's profile SergeyBiryukov
Milestone: 5.2 Priority: normal
Severity: normal Version: 5.2
Component: Build/Test Tools Keywords: has-patch
Focuses: Cc:


I've done some minor code improvements to make the code in abstract-testcase a little bit better:

  • Added TRUE as third argument for in_array checks
  • Used strpos instead of substr where possible
  • Add value directly to array by key instead of array_push
  • Removed an else statement because the if already returns a value.

I hope these changes are desirable. I would love to hear this, because I can continue performing equal changes elsewhere in the testing framework.

Attachments (1)

46500.diff (4.9 KB) - added by andizer 5 years ago.

Download all attachments as: .zip

Change History (3)

5 years ago

#1 @SergeyBiryukov
5 years ago

  • Milestone changed from Awaiting Review to 5.2
  • Owner set to SergeyBiryukov
  • Status changed from new to reviewing

#2 @SergeyBiryukov
5 years ago

  • Resolution set to fixed
  • Status changed from reviewing to closed

In 44916:

Coding Standards: Minor code and performance improvements in phpunit/includes/abstract-testcase.php.

Props andizer.
Fixes #46500.

Note: See TracTickets for help on using tickets.